Cygwin: drop wincap::has_precise_system_time

Only required for Windows 7.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2022-11-15 17:13:28 +01:00
parent 48953788b3
commit 70d77662f5
4 changed files with 5 additions and 31 deletions

View File

@ -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 ());
}
void inline
@ -74,9 +69,7 @@ clk_realtime_t::now (clockid_t clockid, struct timespec *ts)
{
LARGE_INTEGER now;
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 -= FACTOR;
ts->tv_sec = now.QuadPart / NS100PERSEC;
@ -236,10 +229,7 @@ clk_realtime_t::resolution (struct timespec *ts)
{
init ();
ts->tv_sec = 0;
if (wincap.has_precise_system_time ())
ts->tv_nsec = NSPERSEC / ticks_per_sec;
else
ts->tv_nsec = period * (NSPERSEC/NS100PERSEC);
ts->tv_nsec = NSPERSEC / ticks_per_sec;
}
void

View File

@ -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)

View File

@ -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);
}
/* Cygwin internal */

View File

@ -24,7 +24,6 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = {
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_common"), shared)) = {
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_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,
@ -114,7 +111,6 @@ wincaps wincap_10_1507 __attribute__((section (".cygwin_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 (".cygwin_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)) =
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)) =
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)) =
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)) =
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)) =
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)) =
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)) = {
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,