|
iPXE
|
x86 CPU feature detection More...
#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | x86_feature_registers |
| An x86 CPU feature register set. More... | |
| struct | x86_features |
| x86 CPU features More... | |
Macros | |
| #define | CPUID_FLAG 0x00200000UL |
| CPUID support flag. More... | |
| #define | CPUID_EXTENDED 0x80000000UL |
| CPUID extended function. More... | |
| #define | CPUID_HYPERVISOR 0x40000000UL |
| CPUID hypervisor function. More... | |
| #define | CPUID_VENDOR_ID 0x00000000UL |
| Get vendor ID and largest standard function. More... | |
| #define | CPUID_FEATURES 0x00000001UL |
| Get standard features. More... | |
| #define | CPUID_FEATURES_INTEL_ECX_RDRAND 0x40000000UL |
| RDRAND instruction is supported. More... | |
| #define | CPUID_FEATURES_INTEL_ECX_HYPERVISOR 0x80000000UL |
| Hypervisor is present. More... | |
| #define | CPUID_FEATURES_INTEL_EDX_TSC 0x00000010UL |
| TSC is present. More... | |
| #define | CPUID_FEATURES_INTEL_EDX_FXSR 0x01000000UL |
| FXSAVE and FXRSTOR are supported. More... | |
| #define | CPUID_AMD_MAX_FN 0x80000000UL |
| Get largest extended function. More... | |
| #define | CPUID_AMD_CHECK 0x80000000UL |
| Extended function existence check. More... | |
| #define | CPUID_AMD_CHECK_MASK 0xffff0000UL |
| Extended function existence check mask. More... | |
| #define | CPUID_AMD_FEATURES 0x80000001UL |
| Get extended features. More... | |
| #define | CPUID_MODEL 0x80000002UL |
| Get CPU model. More... | |
| #define | CPUID_APM 0x80000007UL |
| Get APM information. More... | |
| #define | CPUID_APM_EDX_TSC_INVARIANT 0x00000100UL |
| Invariant TSC. More... | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| static | __attribute__ ((always_inline)) void cpuid(uint32_t function |
| Issue CPUID instruction. More... | |
| int | cpuid_supported (uint32_t function) |
| Check whether or not CPUID function is supported. More... | |
| void | x86_features (struct x86_features *features) |
| Get x86 CPU features. More... | |
Variables | |
| struct x86_feature_registers | __attribute__ |
| static uint32_t | subfunction |
| static uint32_t uint32_t * | eax |
| static uint32_t uint32_t uint32_t * | ebx |
| static uint32_t uint32_t uint32_t uint32_t * | ecx |
| static uint32_t uint32_t uint32_t uint32_t uint32_t * | edx |
x86 CPU feature detection
Definition in file cpuid.h.
| #define CPUID_HYPERVISOR 0x40000000UL |
| #define CPUID_VENDOR_ID 0x00000000UL |
| #define CPUID_FEATURES_INTEL_ECX_RDRAND 0x40000000UL |
| #define CPUID_FEATURES_INTEL_ECX_HYPERVISOR 0x80000000UL |
| #define CPUID_FEATURES_INTEL_EDX_TSC 0x00000010UL |
| #define CPUID_FEATURES_INTEL_EDX_FXSR 0x01000000UL |
| #define CPUID_AMD_MAX_FN 0x80000000UL |
| #define CPUID_AMD_CHECK 0x80000000UL |
| #define CPUID_AMD_CHECK_MASK 0xffff0000UL |
| #define CPUID_AMD_FEATURES 0x80000001UL |
| #define CPUID_APM_EDX_TSC_INVARIANT 0x00000100UL |
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
inlinestatic |
Issue CPUID instruction.
| function | CPUID function (input via eax) |
| subfunction | CPUID subfunction (input via ecx) |
| eax | Output via eax |
| ebx | Output via ebx |
| ecx | Output via ecx |
| edx | Output via edx |
| int cpuid_supported | ( | uint32_t | function | ) |
Check whether or not CPUID function is supported.
| function | CPUID function |
| rc | Return status code |
Definition at line 75 of file cpuid.c.
References colour, CPUID_AMD_CHECK_MASK, CPUID_EXTENDED, CPUID_HYPERVISOR, cpuid_instruction_supported(), DBGC, discard_c, EINVAL, ENOTTY, and rc.
Referenced by cpuid_settings_fetch(), rdtsc_probe(), x86_amd_features(), and x86_intel_features().
| void x86_features | ( | struct x86_features * | features | ) |
Get x86 CPU features.
| features | x86 CPU features to fill in |
Definition at line 163 of file cpuid.c.
References features, memset(), x86_amd_features(), and x86_intel_features().
Referenced by check_fxsr(), cpuid_exec(), hv_check_hv(), rdrand_entropy_enable(), and rtc_entropy_enable().
| uint32_t subfunction |
Definition at line 89 of file cpuid.h.
Referenced by cpuid_settings_fetch().
Definition at line 89 of file cpuid.h.
Referenced by hv_map_hypercall(), and hvm_cpuid_base().
Definition at line 89 of file cpuid.h.
Referenced by hv_map_hypercall(), and hvm_cpuid_base().
Definition at line 90 of file cpuid.h.
Referenced by hv_map_hypercall(), and hvm_cpuid_base().
1.8.15