ReactOS 0.4.15-dev-8119-g4fb2fdb
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
23
24typedef struct _HARDWARE_TIMER
25{
33
34/* FUNCTIONS ******************************************************************/
35
38
40(
42 ULONGLONG Delay, /* nanoseconds */
44);
45
50
53
54#endif /* _CLOCK_H_ */
unsigned char BOOLEAN
#define VOID
Definition: acefi.h:82
PHARDWARE_TIMER CreateHardwareTimer(ULONG Flags, ULONGLONG Delay, PHARDWARE_TIMER_PROC Callback)
Definition: clock.c:144
VOID DisableHardwareTimer(PHARDWARE_TIMER Timer)
Definition: clock.c:183
ULONGLONG CurrentIps
Definition: clock.c:49
BOOLEAN ClockInitialize(VOID)
Definition: clock.c:219
VOID ClockUpdate(VOID)
Definition: clock.c:76
VOID DestroyHardwareTimer(PHARDWARE_TIMER Timer)
Definition: clock.c:210
struct _HARDWARE_TIMER HARDWARE_TIMER
VOID EnableHardwareTimer(PHARDWARE_TIMER Timer)
Definition: clock.c:161
struct _HARDWARE_TIMER * PHARDWARE_TIMER
VOID(FASTCALL * PHARDWARE_TIMER_PROC)(ULONGLONG ElapsedTime)
Definition: clock.h:22
ULONGLONG CurrentCycleCount
Definition: clock.c:48
VOID SetHardwareTimerDelay(PHARDWARE_TIMER Timer, ULONGLONG NewDelay)
Definition: clock.c:197
#define FASTCALL
Definition: nt_native.h:50
long LONG
Definition: pedump.c:60
PHARDWARE_TIMER_PROC Callback
Definition: clock.h:31
LARGE_INTEGER LastTick
Definition: clock.h:30
ULONGLONG Delay
Definition: clock.h:29
LONG EnableCount
Definition: clock.h:28
LIST_ENTRY Link
Definition: clock.h:26
ULONG Flags
Definition: clock.h:27
Definition: typedefs.h:120
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:458
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170