sync with OpenBSD -current
This commit is contained in:
parent
c9341f2e4a
commit
22b3fbc138
14 changed files with 148 additions and 125 deletions
|
@ -16,12 +16,18 @@ static inline bool
|
|||
static_cpu_has(uint16_t f)
|
||||
{
|
||||
switch (f) {
|
||||
case X86_FEATURE_CLFLUSH:
|
||||
return curcpu()->ci_cflushsz != 0;
|
||||
case X86_FEATURE_XMM4_1:
|
||||
return (cpu_ecxfeature & CPUIDECX_SSE41) != 0;
|
||||
#ifdef __amd64__
|
||||
case X86_FEATURE_CLFLUSH:
|
||||
case X86_FEATURE_PAT:
|
||||
return true;
|
||||
#else
|
||||
case X86_FEATURE_CLFLUSH:
|
||||
return curcpu()->ci_cflushsz != 0;
|
||||
case X86_FEATURE_PAT:
|
||||
return (curcpu()->ci_feature_flags & CPUID_PAT) != 0;
|
||||
#endif
|
||||
case X86_FEATURE_HYPERVISOR:
|
||||
return (cpu_ecxfeature & CPUIDECX_HV) != 0;
|
||||
default:
|
||||
|
@ -32,7 +38,7 @@ static_cpu_has(uint16_t f)
|
|||
static inline bool
|
||||
pat_enabled(void)
|
||||
{
|
||||
return ((curcpu()->ci_feature_flags & CPUID_PAT) != 0);
|
||||
return static_cpu_has(X86_FEATURE_PAT);
|
||||
}
|
||||
|
||||
#define boot_cpu_has(x) static_cpu_has(x)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue