x86_64 (long mode): GDT, IDT, TSS, CPUID, MSR, CPU registers
More...
|
| enum class | CPUID : igros_dword_t {
VENDOR = 0x00000000_u32
, FEATURES = 0x00000001_u32
, CACHE_TLB = 0x00000002_u32
, EXTENDED_FEATURES = 0x00000007_u32
,
EXTENDED_MAX = 0x80000000_u32
, EXTENDED_INFO = 0x80000001_u32
, ADDRESS_SIZES = 0x80000008_u32
} |
| | CPUID leaves. More...
|
| enum class | CPUID_EXT_EDX : igros_dword_t { NX = 0x00100000_u32
, PAGE_1GB = 0x04000000_u32
, LONG_MODE = 0x20000000_u32
} |
| | CPUID extended feature flags (leaf 80000001h, EDX). More...
|
| enum class | MSR : igros_dword_t {
APIC_BASE = 0x0000001B_u32
, EFER = 0xC0000080_u32
, STAR = 0xC0000081_u32
, LSTAR = 0xC0000082_u32
,
FMASK = 0xC0000084_u32
, FS_BASE = 0xC0000100_u32
, GS_BASE = 0xC0000101_u32
, KERNEL_GS_BASE = 0xC0000102_u32
} |
| | Model specific registers. More...
|
| enum class | EFER : igros_quad_t { SCE = 0x0000000000000001_u64
, LME = 0x0000000000000100_u64
, LMA = 0x0000000000000400_u64
, NXE = 0x0000000000000800_u64
} |
| | EFER register bits. More...
|
x86_64 (long mode): GDT, IDT, TSS, CPUID, MSR, CPU registers
◆ CPUID
CPUID leaves.
| Enumerator |
|---|
| VENDOR | Max basic leaf and vendor string.
|
| FEATURES | Version and feature flags.
|
| CACHE_TLB | Cache and TLB descriptors.
|
| EXTENDED_FEATURES | Structured extended features (subleaf 0).
|
| EXTENDED_MAX | Max extended leaf.
|
| EXTENDED_INFO | Extended feature flags (long mode, NX, 1 GB pages).
|
| ADDRESS_SIZES | Physical and linear address sizes.
|
Definition at line 25 of file cpuid.hpp.
◆ CPUID_EXT_EDX
CPUID extended feature flags (leaf 80000001h, EDX).
| Enumerator |
|---|
| NX | No-execute page protection.
|
| PAGE_1GB | 1 GB pages
|
| LONG_MODE | Long mode (64-bit).
|
Definition at line 36 of file cpuid.hpp.
◆ EFER
EFER register bits.
| Enumerator |
|---|
| SCE | SYSCALL enable.
|
| LME | Long mode enable.
|
| LMA | Long mode active.
|
| NXE | No-execute enable.
|
Definition at line 37 of file msr.hpp.
◆ MSR
Model specific registers.
| Enumerator |
|---|
| APIC_BASE | Local APIC base.
|
| EFER | Extended feature enable.
|
| STAR | SYSCALL segments.
|
| LSTAR | SYSCALL 64-bit entry.
|
| FMASK | SYSCALL RFLAGS mask.
|
| FS_BASE | FS segment base.
|
| GS_BASE | GS segment base.
|
| KERNEL_GS_BASE | SWAPGS target.
|
Definition at line 25 of file msr.hpp.
◆ cpuid()
Execute CPUID (CPUID is always available in long mode; caller checks leaf is supported).
- Parameters
-
- Returns
- EAX, EBX, ECX and EDX values
Definition at line 56 of file cpuid.hpp.
◆ cpuidHasLeaf()
| auto igros::x86_64::cpuidHasLeaf |
( |
const CPUID | leaf | ) |
->bool |
|
inlinenodiscardnoexcept |
Check CPUID leaf is supported (basic and extended ranges are checked separately).
- Parameters
-
- Returns
- true if leaf is within supported range
Definition at line 70 of file cpuid.hpp.
◆ readMSR()
Read MSR register (RDMSR returns EDX:EAX).
- Parameters
-
- Returns
- Register value
Definition at line 49 of file msr.hpp.
◆ writeMSR()
Write MSR register (WRMSR takes EDX:EAX).
- Parameters
-
| reg | Register |
| value | New register value |
Definition at line 59 of file msr.hpp.