public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Cygwin: drop support for systems not supporting QueryUnbiasedInterruptTime
Date: Fri, 29 Oct 2021 19:03:27 +0000 (GMT)	[thread overview]
Message-ID: <20211029190327.CA0FF3857816@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=e8bfe362814ea5e6837cb94656fbc54a743ca940

commit e8bfe362814ea5e6837cb94656fbc54a743ca940
Author: Corinna Vinschen <corinna@vinschen.de>
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 <corinna@vinschen.de>

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)


                 reply	other threads:[~2021-10-29 19:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211029190327.CA0FF3857816@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).