ntdll: Report rdtsc processor feature if supported.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48386
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Paul Gofman 2020-02-13 14:11:25 +03:00 committed by Alexandre Julliard
parent 9689d07740
commit fc8e9bac5f
2 changed files with 7 additions and 0 deletions

View File

@ -1122,6 +1122,7 @@ static inline void get_cpuinfo(SYSTEM_CPU_INFORMATION* info)
user_shared_data->ProcessorFeatures[PF_VIRT_FIRMWARE_ENABLED] = (regs2[2] >> 2) & 1;
user_shared_data->ProcessorFeatures[PF_NX_ENABLED] = (regs2[3] >> 20) & 1;
user_shared_data->ProcessorFeatures[PF_3DNOW_INSTRUCTIONS_AVAILABLE] = (regs2[3] >> 31) & 1;
user_shared_data->ProcessorFeatures[PF_RDTSC_INSTRUCTION_AVAILABLE] = (regs2[3] >> 27) & 1;
if (regs2[3] >> 31) info->FeatureSet |= CPU_FEATURE_3DNOW;
}
}
@ -1143,6 +1144,7 @@ static inline void get_cpuinfo(SYSTEM_CPU_INFORMATION* info)
{
do_cpuid(0x80000001, regs2); /* get vendor features */
user_shared_data->ProcessorFeatures[PF_NX_ENABLED] = (regs2[3] >> 20) & 1;
user_shared_data->ProcessorFeatures[PF_RDTSC_INSTRUCTION_AVAILABLE] = (regs2[3] >> 27) & 1;
}
}
else

View File

@ -523,6 +523,11 @@ static void test_user_shared_data(void)
ok(user_shared_data->NumberOfPhysicalPages == sbi.MmNumberOfPhysicalPages,
"Got number of physical pages %#x, expected %#x.\n",
user_shared_data->NumberOfPhysicalPages, sbi.MmNumberOfPhysicalPages);
#if defined(__i386__) || defined(__x86_64__)
ok(user_shared_data->ProcessorFeatures[PF_RDTSC_INSTRUCTION_AVAILABLE] /* Supported since Pentium CPUs. */,
"_RDTSC not available.\n");
#endif
}
START_TEST(virtual)