From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 5A83D386102D; Sun, 4 Dec 2022 13:27:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5A83D386102D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1670160442; bh=jQe8XwlgzkIGg/6w4iyCp4T3ieD427ZLq79KG8IIsjk=; h=From:To:Subject:Date:From; b=s9kcgjPrqVBEWEBhG+IHnjlfVcwkZtw/PEbeJSdVfaNIsHjY3MRNlNL6PuW9fKfZt UmNuhhxeYwy2ELum/3xvuncQ6lDmUdoribwKSYypKyr4y6G/qjFh3pCXwMtRdDVN4u lBaTjf0S59NxqNGNzIrdlOCPzJpMJz+81C9v1UTg= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: drop wincap::has_precise_system_time X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: 48953788b377c5e4e789f21106c47b645e1366de X-Git-Newrev: 70d77662f5742718eb37dbd9e373fe7ab12b8c36 Message-Id: <20221204132722.5A83D386102D@sourceware.org> Date: Sun, 4 Dec 2022 13:27:22 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D70d77662f57= 42718eb37dbd9e373fe7ab12b8c36 commit 70d77662f5742718eb37dbd9e373fe7ab12b8c36 Author: Corinna Vinschen AuthorDate: Tue Nov 15 17:13:28 2022 +0100 Commit: Corinna Vinschen CommitDate: Sun Dec 4 14:01:41 2022 +0100 Cygwin: drop wincap::has_precise_system_time =20 Only required for Windows 7. =20 Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/clock.cc | 18 ++++-------------- winsup/cygwin/local_includes/wincap.h | 2 -- winsup/cygwin/times.cc | 4 +--- winsup/cygwin/wincap.cc | 12 ------------ 4 files changed, 5 insertions(+), 31 deletions(-) diff --git a/winsup/cygwin/clock.cc b/winsup/cygwin/clock.cc index 0c0bd9994e3e..1c675f0f26c8 100644 --- a/winsup/cygwin/clock.cc +++ b/winsup/cygwin/clock.cc @@ -40,13 +40,8 @@ clk_t::init () void inline clk_realtime_t::init () { - if (wincap.has_precise_system_time ()) - { - if (!ticks_per_sec) - InterlockedExchange64 (&ticks_per_sec, system_qpc_tickspersec ()); - } - else if (!period) - InterlockedExchange64 (&period, system_tickcount_period ()); + if (!ticks_per_sec) + InterlockedExchange64 (&ticks_per_sec, system_qpc_tickspersec ()); } =20 void inline @@ -74,9 +69,7 @@ clk_realtime_t::now (clockid_t clockid, struct timespec *= ts) { LARGE_INTEGER now; =20 - wincap.has_precise_system_time () - ? GetSystemTimePreciseAsFileTime ((LPFILETIME) &now) - : GetSystemTimeAsFileTime ((LPFILETIME) &now); + GetSystemTimePreciseAsFileTime ((LPFILETIME) &now); /* Add conversion factor for UNIX vs. Windows base time */ now.QuadPart -=3D FACTOR; ts->tv_sec =3D now.QuadPart / NS100PERSEC; @@ -236,10 +229,7 @@ clk_realtime_t::resolution (struct timespec *ts) { init (); ts->tv_sec =3D 0; - if (wincap.has_precise_system_time ()) - ts->tv_nsec =3D NSPERSEC / ticks_per_sec; - else - ts->tv_nsec =3D period * (NSPERSEC/NS100PERSEC); + ts->tv_nsec =3D NSPERSEC / ticks_per_sec; } =20 void diff --git a/winsup/cygwin/local_includes/wincap.h b/winsup/cygwin/local_in= cludes/wincap.h index 1075f3bea85e..0a2ad7b59159 100644 --- a/winsup/cygwin/local_includes/wincap.h +++ b/winsup/cygwin/local_includes/wincap.h @@ -17,7 +17,6 @@ struct wincaps ops generated by gcc are off by 4 bytes. */ struct __attribute__ ((aligned (8))) { unsigned is_server : 1; - unsigned has_precise_system_time : 1; unsigned has_microsoft_accounts : 1; unsigned has_new_pebteb_region : 1; unsigned has_broken_whoami : 1; @@ -75,7 +74,6 @@ public: } intptr_t IMPLEMENT (mmap_storage_high) bool IMPLEMENT (is_server) - bool IMPLEMENT (has_precise_system_time) bool IMPLEMENT (has_microsoft_accounts) bool IMPLEMENT (has_new_pebteb_region) bool IMPLEMENT (has_broken_whoami) diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc index 4ab432925e56..ddea061b8920 100644 --- a/winsup/cygwin/times.cc +++ b/winsup/cygwin/times.cc @@ -29,9 +29,7 @@ details. */ static inline void __attribute__ ((always_inline)) get_system_time (PLARGE_INTEGER systime) { - wincap.has_precise_system_time () - ? GetSystemTimePreciseAsFileTime ((LPFILETIME) systime) - : GetSystemTimeAsFileTime ((LPFILETIME) systime); + GetSystemTimePreciseAsFileTime ((LPFILETIME) systime); } =20 /* Cygwin internal */ diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc index 15400d8d0f57..7ee8f4b06ea8 100644 --- a/winsup/cygwin/wincap.cc +++ b/winsup/cygwin/wincap.cc @@ -24,7 +24,6 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_com= mon"), shared)) =3D { mmap_storage_high:__MMAP_STORAGE_HIGH_LEGACY, { is_server:false, - has_precise_system_time:false, has_microsoft_accounts:false, has_new_pebteb_region:false, has_broken_whoami:true, @@ -54,7 +53,6 @@ wincaps wincap_8 __attribute__((section (".cygwin_dll_com= mon"), shared)) =3D { mmap_storage_high:__MMAP_STORAGE_HIGH_LEGACY, { is_server:false, - has_precise_system_time:true, has_microsoft_accounts:true, has_new_pebteb_region:false, has_broken_whoami:false, @@ -84,7 +82,6 @@ wincaps wincap_8_1 __attribute__((section (".cygwin_dll_c= ommon"), shared)) =3D { mmap_storage_high:__MMAP_STORAGE_HIGH, { is_server:false, - has_precise_system_time:true, has_microsoft_accounts:true, has_new_pebteb_region:false, has_broken_whoami:false, @@ -114,7 +111,6 @@ wincaps wincap_10_1507 __attribute__((section (".cygwi= n_dll_common"), shared)) mmap_storage_high:__MMAP_STORAGE_HIGH, { is_server:false, - has_precise_system_time:true, has_microsoft_accounts:true, has_new_pebteb_region:false, has_broken_whoami:false, @@ -144,7 +140,6 @@ wincaps wincap_10_1607 __attribute__((section (".cygwi= n_dll_common"), shared)) mmap_storage_high:__MMAP_STORAGE_HIGH, { is_server:false, - has_precise_system_time:true, has_microsoft_accounts:true, has_new_pebteb_region:false, has_broken_whoami:false, @@ -174,7 +169,6 @@ wincaps wincap_10_1703 __attribute__((section (".cygwin= _dll_common"), shared)) =3D mmap_storage_high:__MMAP_STORAGE_HIGH, { is_server:false, - has_precise_system_time:true, has_microsoft_accounts:true, has_new_pebteb_region:true, has_broken_whoami:false, @@ -204,7 +198,6 @@ wincaps wincap_10_1709 __attribute__((section (".cygwin= _dll_common"), shared)) =3D mmap_storage_high:__MMAP_STORAGE_HIGH, { is_server:false, - has_precise_system_time:true, has_microsoft_accounts:true, has_new_pebteb_region:true, has_broken_whoami:false, @@ -234,7 +227,6 @@ wincaps wincap_10_1803 __attribute__((section (".cygwin= _dll_common"), shared)) =3D mmap_storage_high:__MMAP_STORAGE_HIGH, { is_server:false, - has_precise_system_time:true, has_microsoft_accounts:true, has_new_pebteb_region:true, has_broken_whoami:false, @@ -264,7 +256,6 @@ wincaps wincap_10_1809 __attribute__((section (".cygwin= _dll_common"), shared)) =3D mmap_storage_high:__MMAP_STORAGE_HIGH, { is_server:false, - has_precise_system_time:true, has_microsoft_accounts:true, has_new_pebteb_region:true, has_broken_whoami:false, @@ -294,7 +285,6 @@ wincaps wincap_10_1903 __attribute__((section (".cygwin= _dll_common"), shared)) =3D mmap_storage_high:__MMAP_STORAGE_HIGH, { is_server:false, - has_precise_system_time:true, has_microsoft_accounts:true, has_new_pebteb_region:true, has_broken_whoami:false, @@ -324,7 +314,6 @@ wincaps wincap_10_2004 __attribute__((section (".cygwin= _dll_common"), shared)) =3D mmap_storage_high:__MMAP_STORAGE_HIGH, { is_server:false, - has_precise_system_time:true, has_microsoft_accounts:true, has_new_pebteb_region:true, has_broken_whoami:false, @@ -354,7 +343,6 @@ wincaps wincap_11 __attribute__((section (".cygwin_dll_= common"), shared)) =3D { mmap_storage_high:__MMAP_STORAGE_HIGH, { is_server:false, - has_precise_system_time:true, has_microsoft_accounts:true, has_new_pebteb_region:true, has_broken_whoami:false,