ReactOS  0.4.13-dev-563-g0561610
clock.h
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: GPL - See COPYING in the top level directory
3  * PROJECT: ReactOS Virtual DOS Machine
4  * FILE: subsystems/mvdm/ntvdm/clock.h
5  * PURPOSE: Clock for VDM
6  * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
7  * Hermes Belusca-Maito (hermes.belusca@sfr.fr)
8  */
9 
10 #ifndef _CLOCK_H_
11 #define _CLOCK_H_
12 
13 /* DEFINITIONS ****************************************************************/
14 
15 #define HARDWARE_TIMER_ENABLED (1 << 0)
16 #define HARDWARE_TIMER_ONESHOT (1 << 1)
17 #define HARDWARE_TIMER_PRECISE (1 << 2)
18 
19 /* Converts a frequency in Hertz into a duration in nanoseconds */
20 #define HZ_TO_NS(Freq) (ULONGLONG)(1000000000ULL / (ULONGLONG)(Freq))
21 
22 typedef VOID (FASTCALL *PHARDWARE_TIMER_PROC)(ULONGLONG ElapsedTime);
23 
24 typedef struct _HARDWARE_TIMER
25 {
33 
34 /* FUNCTIONS ******************************************************************/
35 
37 extern ULONGLONG CurrentIps;
38 
40 (
41  ULONG Flags,
42  ULONGLONG Delay, /* nanoseconds */
44 );
45 
50 
53 
54 #endif /* _CLOCK_H_ */
ULONGLONG CurrentCycleCount
Definition: clock.c:48
struct _HARDWARE_TIMER HARDWARE_TIMER
PHARDWARE_TIMER CreateHardwareTimer(ULONG Flags, ULONGLONG Delay, PHARDWARE_TIMER_PROC Callback)
Definition: clock.c:144
ULONGLONG Delay
Definition: clock.h:29
VOID(FASTCALL * PHARDWARE_TIMER_PROC)(ULONGLONG ElapsedTime)
Definition: clock.h:22
ULONG Flags
Definition: clock.h:27
VOID ClockUpdate(VOID)
Definition: clock.c:76
#define FASTCALL
Definition: nt_native.h:50
VOID DestroyHardwareTimer(PHARDWARE_TIMER Timer)
Definition: clock.c:210
PHARDWARE_TIMER_PROC Callback
Definition: clock.h:31
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
long LONG
Definition: pedump.c:60
VOID EnableHardwareTimer(PHARDWARE_TIMER Timer)
Definition: clock.c:161
VOID DisableHardwareTimer(PHARDWARE_TIMER Timer)
Definition: clock.c:183
unsigned char BOOLEAN
BOOLEAN ClockInitialize(VOID)
Definition: clock.c:219
LIST_ENTRY Link
Definition: clock.h:26
struct _HARDWARE_TIMER * PHARDWARE_TIMER
ULONGLONG CurrentIps
Definition: clock.c:49
uint64_t ULONGLONG
Definition: typedefs.h:65
#define VOID
Definition: acefi.h:82
LONG EnableCount
Definition: clock.h:28
Definition: typedefs.h:117
LARGE_INTEGER LastTick
Definition: clock.h:30
unsigned int ULONG
Definition: retypes.h:1
LPFNPSPCALLBACK Callback
Definition: desk.c:111
VOID SetHardwareTimerDelay(PHARDWARE_TIMER Timer, ULONGLONG NewDelay)
Definition: clock.c:197