Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2011-03-29 14:21:30 +0400
committerCorinna Vinschen <corinna@vinschen.de>2011-03-29 14:21:30 +0400
commitcd50649255074f7d76400127ed7613d78c08488b (patch)
tree0a024d44927d7dad724cb093591ad8fc4bf32d80 /winsup/cygwin/ntdll.h
parent700c641dfa72b292a231810ab35d93849f4c8fe1 (diff)
* autoload.cc (winmm): Remove time functions. Don't treat
unloadable wave functions as fatal. * hires.h (hires_ms::timeGetTime_ns): New private method. (hires_ms::dmsecs): Call timeGetTime_ns here. * ntdll.h (struct _KSYSTEM_TIME): Define. (KUSER_SHARED_DATA): Redefine to allow access to InterruptTime. (SharedUserData): Define here. (NtQueryTimerResolution): Declare. (NtSetTimerResolution): Declare. * path.cc (SharedUserData): Move to ntdll.h. * times.cc (hires_ms::timeGetTime_ns): New private method. Use throughout instead of timeGetTime. Document entire functionality of timeGetTime in case we need it. (hires_ms::resolution): Try a call to NtQueryTimerResolution to fetch current period. Fall back to heuristic if that fails. Cast to DWORD in assignments to minperiod. (clock_setres): Align period to possible values per a call to NtQueryTimerResolution. Explain why. Replace calls to timeBeginPeriod and timeEndPeriod with underlying call to NtSetTimerResolution. Use status code from NtSetTimerResolution to compute errno. Convert period to ULONGLONG and store 100ns value to simplify code.
Diffstat (limited to 'winsup/cygwin/ntdll.h')
-rw-r--r--winsup/cygwin/ntdll.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/winsup/cygwin/ntdll.h b/winsup/cygwin/ntdll.h
index 54c56f027..cd8e1f106 100644
--- a/winsup/cygwin/ntdll.h
+++ b/winsup/cygwin/ntdll.h
@@ -599,9 +599,18 @@ typedef struct _TEB
/* A lot more follows... */
} TEB, *PTEB;
+typedef struct _KSYSTEM_TIME
+{
+ ULONG LowPart;
+ LONG High1Time;
+ LONG High2Time;
+} KSYSTEM_TIME, *PKSYSTEM_TIME;
+
typedef struct _KUSER_SHARED_DATA
{
- BYTE Reserved1[0x2dc];
+ BYTE Reserved1[0x08];
+ KSYSTEM_TIME InterruptTime;
+ BYTE Reserved2[0x2c8];
ULONG DismountCount;
/* A lot more follows... */
} KUSER_SHARED_DATA, *PKUSER_SHARED_DATA;
@@ -889,6 +898,11 @@ typedef enum _EVENT_INFORMATION_CLASS
#define NtCurrentProcess() ((HANDLE) 0xffffffff)
#define NtCurrentThread() ((HANDLE) 0xfffffffe)
+/* This is the mapping of the KUSER_SHARED_DATA structure into the 32 bit
+ user address space. We need it here to access the current DismountCount. */
+static KUSER_SHARED_DATA &SharedUserData
+ = *(volatile PKUSER_SHARED_DATA) 0x7ffe0000;
+
extern "C"
{
NTSTATUS NTAPI NtAdjustPrivilegesToken (HANDLE, BOOLEAN, PTOKEN_PRIVILEGES,
@@ -970,6 +984,7 @@ extern "C"
NTSTATUS NTAPI NtQuerySecurityObject (HANDLE, SECURITY_INFORMATION,
PSECURITY_DESCRIPTOR, ULONG, PULONG);
NTSTATUS NTAPI NtQuerySymbolicLinkObject (HANDLE, PUNICODE_STRING, PULONG);
+ NTSTATUS NTAPI NtQueryTimerResolution (PULONG, PULONG, PULONG);
NTSTATUS NTAPI NtQueryVirtualMemory (HANDLE, PVOID, MEMORY_INFORMATION_CLASS,
PVOID, ULONG, PULONG);
NTSTATUS NTAPI NtQueryVolumeInformationFile (HANDLE, IO_STATUS_BLOCK *,
@@ -984,6 +999,7 @@ extern "C"
FILE_INFORMATION_CLASS);
NTSTATUS NTAPI NtSetSecurityObject (HANDLE, SECURITY_INFORMATION,
PSECURITY_DESCRIPTOR);
+ NTSTATUS NTAPI NtSetTimerResolution (ULONG, BOOLEAN, PULONG);
NTSTATUS NTAPI NtUnlockVirtualMemory (HANDLE, PVOID *, ULONG *, ULONG);
NTSTATUS NTAPI NtUnmapViewOfSection (HANDLE, PVOID);
NTSTATUS NTAPI NtWriteFile (HANDLE, HANDLE, PIO_APC_ROUTINE, PVOID,