Author: hbelusca
Date: Fri Apr 17 23:58:01 2015
New Revision: 67234
URL:
http://svn.reactos.org/svn/reactos?rev=67234&view=rev
Log:
[NTVDM]: For CreateHardwareTimer, use frequencies (in hertz) instead of using milliseconds
or nanoseconds (depending on some additional flag to be specified). It's therefore
easier to specify what you want.
Modified:
trunk/reactos/subsystems/mvdm/ntvdm/clock.c
trunk/reactos/subsystems/mvdm/ntvdm/clock.h
trunk/reactos/subsystems/mvdm/ntvdm/hardware/cmos.c
trunk/reactos/subsystems/mvdm/ntvdm/hardware/mouse.c
trunk/reactos/subsystems/mvdm/ntvdm/hardware/pit.c
trunk/reactos/subsystems/mvdm/ntvdm/hardware/ps2.c
trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c
Modified: trunk/reactos/subsystems/mvdm/ntvdm/clock.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/cloc…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/clock.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/clock.c [iso-8859-1] Fri Apr 17 23:58:01 2015
@@ -141,7 +141,7 @@
}
}
-PHARDWARE_TIMER CreateHardwareTimer(ULONG Flags, ULONG Delay, PHARDWARE_TIMER_PROC
Callback)
+PHARDWARE_TIMER CreateHardwareTimer(ULONG Flags, ULONG Frequency, PHARDWARE_TIMER_PROC
Callback)
{
PHARDWARE_TIMER Timer;
@@ -151,7 +151,7 @@
Timer->Flags = Flags & ~HARDWARE_TIMER_ENABLED;
Timer->EnableCount = 0;
Timer->Callback = Callback;
- SetHardwareTimerDelay(Timer, (ULONGLONG)Delay);
+ SetHardwareTimerDelay(Timer, 1000000000ULL / (ULONGLONG)Frequency);
if (Flags & HARDWARE_TIMER_ENABLED) EnableHardwareTimer(Timer);
return Timer;
@@ -202,7 +202,7 @@
}
else
{
- Timer->Delay = NewDelay;
+ Timer->Delay = NewDelay / 1000000ULL;
}
}
@@ -234,7 +234,7 @@
#ifdef IPS_DISPLAY
- IpsTimer = CreateHardwareTimer(HARDWARE_TIMER_ENABLED, 1000, IpsDisplayCallback);
+ IpsTimer = CreateHardwareTimer(HARDWARE_TIMER_ENABLED, 1, IpsDisplayCallback);
if (IpsTimer == NULL)
{
wprintf(L"FATAL: Cannot create IPS display timer.\n");
Modified: trunk/reactos/subsystems/mvdm/ntvdm/clock.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/cloc…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/clock.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/clock.h [iso-8859-1] Fri Apr 17 23:58:01 2015
@@ -35,7 +35,7 @@
PHARDWARE_TIMER CreateHardwareTimer
(
ULONG Flags,
- ULONG Delay, /* milliseconds for normal timers, nanoseconds for precise timers */
+ ULONG Frequency, // in Hz
PHARDWARE_TIMER_PROC Callback
);
VOID EnableHardwareTimer(PHARDWARE_TIMER Timer);
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/cmos.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/cmos.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/cmos.c [iso-8859-1] Fri Apr 17 23:58:01
2015
@@ -501,9 +501,9 @@
RegisterIoPort(CMOS_ADDRESS_PORT, NULL , CmosWritePort);
RegisterIoPort(CMOS_DATA_PORT , CmosReadPort, CmosWritePort);
- ClockTimer = CreateHardwareTimer(HARDWARE_TIMER_ENABLED, 1000, RtcTimeUpdate);
+ ClockTimer = CreateHardwareTimer(HARDWARE_TIMER_ENABLED, 1, RtcTimeUpdate);
PeriodicTimer = CreateHardwareTimer(HARDWARE_TIMER_ENABLED | HARDWARE_TIMER_PRECISE,
- 1000000, /* 1,000,000 ns = 1 ms */
+ 1000,
RtcPeriodicTick);
}
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/mouse.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/mouse.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/mouse.c [iso-8859-1] Fri Apr 17 23:58:01
2015
@@ -454,7 +454,7 @@
MouseMutex = CreateMutex(NULL, FALSE, NULL);
if (MouseMutex == NULL) return FALSE;
- StreamTimer = CreateHardwareTimer(HARDWARE_TIMER_ENABLED, 10,
MouseStreamingCallback);
+ StreamTimer = CreateHardwareTimer(HARDWARE_TIMER_ENABLED, 100,
MouseStreamingCallback);
MouseReset();
return TRUE;
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/pit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/pit.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/pit.c [iso-8859-1] Fri Apr 17 23:58:01
2015
@@ -511,7 +511,7 @@
/* Register the hardware timer */
MasterClock = CreateHardwareTimer(HARDWARE_TIMER_ENABLED | HARDWARE_TIMER_PRECISE,
- 1000000000ULL / PIT_BASE_FREQUENCY,
+ PIT_BASE_FREQUENCY,
PitClock);
}
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/ps2.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/ps2.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/ps2.c [iso-8859-1] Fri Apr 17 23:58:01
2015
@@ -405,7 +405,7 @@
RegisterIoPort(PS2_CONTROL_PORT, PS2ReadPort, PS2WritePort);
RegisterIoPort(PS2_DATA_PORT , PS2ReadPort, PS2WritePort);
- IrqTimer = CreateHardwareTimer(HARDWARE_TIMER_ONESHOT, 10, GeneratePS2Irq);
+ IrqTimer = CreateHardwareTimer(HARDWARE_TIMER_ONESHOT, 100, GeneratePS2Irq);
return TRUE;
}
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c [iso-8859-1] Fri Apr 17
23:58:01 2015
@@ -2127,8 +2127,8 @@
RegisterIoPort(0x3D8, VgaReadPort, VgaWritePort); // CGA_MODE_CTRL_REG
RegisterIoPort(0x3D9, VgaReadPort, VgaWritePort); // CGA_PAL_CTRL_REG
- HSyncTimer = CreateHardwareTimer(HARDWARE_TIMER_ENABLED, 0, VgaHorizontalRetrace);
- VSyncTimer = CreateHardwareTimer(HARDWARE_TIMER_ENABLED, 16, VgaVerticalRetrace);
+ HSyncTimer = CreateHardwareTimer(HARDWARE_TIMER_ENABLED, 31469,
VgaHorizontalRetrace);
+ VSyncTimer = CreateHardwareTimer(HARDWARE_TIMER_ENABLED, 60, VgaVerticalRetrace);
/* Return success */
return TRUE;