21#define APIC_SPIV 0x0f0
22#define APIC_SPIV_APIC_ENABLED 0x00100
25#define APIC_DM_NMI 0x00400
26#define APIC_ICR_BUSY 0x01000
27#define APIC_DEST_SELF 0x40000
29#define APIC_ICR2 0x310
31#define APIC_DEFAULT_BASE 0xfee00000ul
69 asm volatile (
"rdmsr" :
"=a" (val)
77 asm volatile (
"wrmsr" ::
84 asm volatile (
"wrmsr" ::
static uint32_t apic_mmio_read(unsigned int reg)
static void apic_msr_write(unsigned int reg, uint32_t val)
enum apic_mode cur_apic_mode
static void apic_msr_icr_write(uint64_t val)
static void apic_mmio_write(unsigned int reg, uint32_t val)
#define APIC_DEFAULT_BASE
static void apic_icr_write(uint64_t val)
static void apic_mmio_icr_write(uint64_t val)
static uint32_t apic_read(unsigned int reg)
static uint32_t apic_msr_read(unsigned int reg)
static void apic_write(unsigned int reg, uint32_t val)
int apic_init(enum apic_mode mode)
Discover and initialise the local APIC to the requested mode.
#define _p(v)
Express an abitrary integer v as void *.
Common declarations for all tests.