enum apic_mode cur_apic_mode
static enum apic_mode apicbase_to_mode(uint64_t apicbase)
int apic_init(enum apic_mode mode)
Discover and initialise the local APIC to the requested mode.
x86 Local APIC register definitions and utility functions.
#define APIC_DEFAULT_BASE
#define APIC_SPIV_APIC_ENABLED
static void apic_write(unsigned int reg, uint32_t val)
static uint64_t rdmsr(uint32_t idx)
Thin wrapper around an rdmsr instruction.
static void wrmsr(uint32_t idx, uint64_t val)
Thin wrapper around an wrmsr instruction.
static bool rdmsr_safe(uint32_t idx, uint64_t *val)
Wrapper around rdmsr which safely catches #GP[0].