* 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.
This commit is contained in:
Corinna Vinschen
2011-03-29 10:21:30 +00:00
parent 700c641dfa
commit cd50649255
6 changed files with 163 additions and 59 deletions

View File

@@ -3460,11 +3460,6 @@ static PFAST_CWD *fast_cwd_ptr
static int fast_cwd_version
__attribute__((section (".cygwin_dll_common"), shared)) = 1;
/* 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;
#define peek32(x) (*(uint32_t *)(x))
/* This function scans the code in ntdll.dll to find the address of the