From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id CA0FF3857816; Fri, 29 Oct 2021 19:03:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA0FF3857816 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: drop support for systems not supporting QueryUnbiasedInterruptTime X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: e36811afb4d86dc70aa3c8c06dafbc3f9782f456 X-Git-Newrev: e8bfe362814ea5e6837cb94656fbc54a743ca940 Message-Id: <20211029190327.CA0FF3857816@sourceware.org> Date: Fri, 29 Oct 2021 19:03:27 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2021 19:03:27 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=e8bfe362814ea5e6837cb94656fbc54a743ca940 commit e8bfe362814ea5e6837cb94656fbc54a743ca940 Author: Corinna Vinschen Date: Fri Oct 29 18:01:33 2021 +0200 Cygwin: drop support for systems not supporting QueryUnbiasedInterruptTime i. e., Vista/2008 Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/clock.cc | 25 ++++++------------------- winsup/cygwin/wincap.cc | 11 ----------- 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 9c0b787ba..e010ed488 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 dbf36272b..b94f38e31 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 150ad253b..5b81af562 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)