diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2021-10-29 18:01:33 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2021-10-29 18:19:40 +0200 |
commit | e8bfe362814ea5e6837cb94656fbc54a743ca940 (patch) | |
tree | 2837fda75c7e669752e9c761a1ffd08b88742559 /winsup | |
parent | e36811afb4d86dc70aa3c8c06dafbc3f9782f456 (diff) | |
download | newlib-e8bfe362814ea5e6837cb94656fbc54a743ca940.zip newlib-e8bfe362814ea5e6837cb94656fbc54a743ca940.tar.gz newlib-e8bfe362814ea5e6837cb94656fbc54a743ca940.tar.bz2 |
Cygwin: drop support for systems not supporting QueryUnbiasedInterruptTime
i. e., Vista/2008
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/clock.cc | 25 | ||||
-rw-r--r-- | winsup/cygwin/wincap.cc | 11 | ||||
-rw-r--r-- | winsup/cygwin/wincap.h | 2 |
3 files changed, 6 insertions, 32 deletions
diff --git a/winsup/cygwin/clock.cc b/winsup/cygwin/clock.cc index 9c0b787..e010ed4 100644 --- a/winsup/cygwin/clock.cc +++ b/winsup/cygwin/clock.cc @@ -190,26 +190,13 @@ clk_monotonic_t::now (clockid_t clockid, struct timespec *ts) int clk_monotonic_coarse_t::now (clockid_t clockid, struct timespec *ts) { - if (wincap.has_unbiased_interrupt_time ()) - { - /* Suspend time not taken into account, as on Linux */ - ULONGLONG now; - - QueryUnbiasedInterruptTime (&now); - ts->tv_sec = now / NS100PERSEC; - now %= NS100PERSEC; - ts->tv_nsec = now * (NSPERSEC/NS100PERSEC); - } - else - { - /* Vista-only: GetTickCount64 is biased but it's coarse and monotonic. */ - ULONGLONG now; + /* Suspend time not taken into account, as on Linux */ + ULONGLONG now; - now = GetTickCount64 (); /* Returns ms since boot */ - ts->tv_sec = now / MSPERSEC; - now %= MSPERSEC; - ts->tv_nsec = now * (NSPERSEC/MSPERSEC); - } + QueryUnbiasedInterruptTime (&now); + ts->tv_sec = now / NS100PERSEC; + now %= NS100PERSEC; + ts->tv_nsec = now * (NSPERSEC/NS100PERSEC); return 0; } diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc index dbf3627..b94f38e 100644 --- a/winsup/cygwin/wincap.cc +++ b/winsup/cygwin/wincap.cc @@ -34,7 +34,6 @@ wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = { has_new_pebteb_region:false, has_broken_whoami:true, has_unprivileged_createsymlink:false, - has_unbiased_interrupt_time:false, has_precise_interrupt_time:false, has_posix_unlink_semantics:false, has_posix_unlink_semantics_with_ignore_readonly:false, @@ -69,7 +68,6 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = { has_new_pebteb_region:false, has_broken_whoami:true, has_unprivileged_createsymlink:false, - has_unbiased_interrupt_time:true, has_precise_interrupt_time:false, has_posix_unlink_semantics:false, has_posix_unlink_semantics_with_ignore_readonly:false, @@ -104,7 +102,6 @@ wincaps wincap_8 __attribute__((section (".cygwin_dll_common"), shared)) = { has_new_pebteb_region:false, has_broken_whoami:false, has_unprivileged_createsymlink:false, - has_unbiased_interrupt_time:true, has_precise_interrupt_time:false, has_posix_unlink_semantics:false, has_posix_unlink_semantics_with_ignore_readonly:false, @@ -139,7 +136,6 @@ wincaps wincap_8_1 __attribute__((section (".cygwin_dll_common"), shared)) = { has_new_pebteb_region:false, has_broken_whoami:false, has_unprivileged_createsymlink:false, - has_unbiased_interrupt_time:true, has_precise_interrupt_time:false, has_posix_unlink_semantics:false, has_posix_unlink_semantics_with_ignore_readonly:false, @@ -174,7 +170,6 @@ wincaps wincap_10_1507 __attribute__((section (".cygwin_dll_common"), shared)) has_new_pebteb_region:false, has_broken_whoami:false, has_unprivileged_createsymlink:false, - has_unbiased_interrupt_time:true, has_precise_interrupt_time:true, has_posix_unlink_semantics:false, has_posix_unlink_semantics_with_ignore_readonly:false, @@ -209,7 +204,6 @@ wincaps wincap_10_1607 __attribute__((section (".cygwin_dll_common"), shared)) has_new_pebteb_region:false, has_broken_whoami:false, has_unprivileged_createsymlink:false, - has_unbiased_interrupt_time:true, has_precise_interrupt_time:true, has_posix_unlink_semantics:false, has_posix_unlink_semantics_with_ignore_readonly:false, @@ -244,7 +238,6 @@ wincaps wincap_10_1703 __attribute__((section (".cygwin_dll_common"), shared)) = has_new_pebteb_region:true, has_broken_whoami:false, has_unprivileged_createsymlink:true, - has_unbiased_interrupt_time:true, has_precise_interrupt_time:true, has_posix_unlink_semantics:false, has_posix_unlink_semantics_with_ignore_readonly:false, @@ -279,7 +272,6 @@ wincaps wincap_10_1709 __attribute__((section (".cygwin_dll_common"), shared)) = has_new_pebteb_region:true, has_broken_whoami:false, has_unprivileged_createsymlink:true, - has_unbiased_interrupt_time:true, has_precise_interrupt_time:true, has_posix_unlink_semantics:true, has_posix_unlink_semantics_with_ignore_readonly:false, @@ -314,7 +306,6 @@ wincaps wincap_10_1803 __attribute__((section (".cygwin_dll_common"), shared)) = has_new_pebteb_region:true, has_broken_whoami:false, has_unprivileged_createsymlink:true, - has_unbiased_interrupt_time:true, has_precise_interrupt_time:true, has_posix_unlink_semantics:true, has_posix_unlink_semantics_with_ignore_readonly:false, @@ -349,7 +340,6 @@ wincaps wincap_10_1809 __attribute__((section (".cygwin_dll_common"), shared)) = has_new_pebteb_region:true, has_broken_whoami:false, has_unprivileged_createsymlink:true, - has_unbiased_interrupt_time:true, has_precise_interrupt_time:true, has_posix_unlink_semantics:true, has_posix_unlink_semantics_with_ignore_readonly:true, @@ -384,7 +374,6 @@ wincaps wincap_10_1903 __attribute__((section (".cygwin_dll_common"), shared)) = has_new_pebteb_region:true, has_broken_whoami:false, has_unprivileged_createsymlink:true, - has_unbiased_interrupt_time:true, has_precise_interrupt_time:true, has_posix_unlink_semantics:true, has_posix_unlink_semantics_with_ignore_readonly:true, diff --git a/winsup/cygwin/wincap.h b/winsup/cygwin/wincap.h index 150ad25..5b81af5 100644 --- a/winsup/cygwin/wincap.h +++ b/winsup/cygwin/wincap.h @@ -28,7 +28,6 @@ struct wincaps unsigned has_new_pebteb_region : 1; unsigned has_broken_whoami : 1; unsigned has_unprivileged_createsymlink : 1; - unsigned has_unbiased_interrupt_time : 1; unsigned has_precise_interrupt_time : 1; unsigned has_posix_unlink_semantics : 1; unsigned has_posix_unlink_semantics_with_ignore_readonly : 1; @@ -95,7 +94,6 @@ public: bool IMPLEMENT (has_new_pebteb_region) bool IMPLEMENT (has_broken_whoami) bool IMPLEMENT (has_unprivileged_createsymlink) - bool IMPLEMENT (has_unbiased_interrupt_time) bool IMPLEMENT (has_precise_interrupt_time) bool IMPLEMENT (has_posix_unlink_semantics) bool IMPLEMENT (has_posix_unlink_semantics_with_ignore_readonly) |