15#define APIC_REG_LAPIC_VERSION 0x30
16#define APIC_REG_PRIO_TASK 0x80
17#define APIC_REG_PRIO_ARBITRATION 0x90
18#define APIC_REG_PRIO_PROCESSOR 0xA0
19#define APIC_REG_EOI 0xB0
20#define APIC_REG_REMOTE_READ 0xC0
21#define APIC_REG_LOGICAL_DEST 0xD0
22#define APIC_REG_DEST_FORMAT 0xE0
23#define APIC_REG_SPURIOUS_INTR_VEC 0xF0
24#define APIC_REG_ERROR_STATUS 0x280
25#define APIC_REG_TIMER_INITIAL_COUNT 0x380
26#define APIC_REG_TIMER_CURRENT_COUNT 0x390
27#define APIC_REG_TIMER_DIVIDE_CONFIG 0x3E0
29#define APIC_REG_LVT_CMCI_INTR 0x2F0
30#define APIC_REG_LVT_TIMER 0x320
31#define APIC_REG_LVT_THERMAL_SENSOR 0x330
32#define APIC_REG_LVT_PERF_MON_CTR 0x340
33#define APIC_REG_LVT_LINT0 0x350
34#define APIC_REG_LVT_LINT1 0x360
35#define APIC_REG_LVT_ERROR 0x370
37#define APIC_IN_SERVICE_REG_BEGIN 0x100
38#define APIC_IN_SERVICE_REG_END 0x170
40#define APIC_TRIGGER_MODE_REG_BEGIN 0x180
41#define APIC_TRIGGER_MODE_REG_END 0x1F0
43#define APIC_TRIGGER_MODE_REG_TMR_BEGIN 0x180
44#define APIC_TRIGGER_MODE_REG_TMR_END 0x1F0
46#define APIC_INTERRUPT_REQUEST_REG_BEGIN 0x200
47#define APIC_INTERRUPT_REQUEST_REG_END 0x270
49#define APIC_INTERRUPT_COMMAND_REG_BEGIN 0x300
50#define APIC_INTERRUPT_COMMAND_REG_END 0x310
52#define IA32_APIC_BASE_MSR 0x1B
98 value |=
SET_BITS(8, 3, delivery_mode);
103 value |=
SET_BITS(18, 2, shorthand);
#define cpu_has_feature(feat)
pmm_region_t * pmm_find_reserved_region(ptr_t needle)
Find a region in the physical memory manager.
#define pmm_reserve_address(paddr)
void lapic_interrupt_full(u8 vec, u8 dest, lapic_delivery_mode_t delivery_mode, lapic_dest_mode_t dest_mode, bool level, bool trigger, lapic_shorthand_t shorthand)
void lapic_interrupt(u8 vec, u8 dest, lapic_delivery_mode_t delivery_mode, lapic_dest_mode_t dest_mode, lapic_shorthand_t shorthand)
#define APIC_INTERRUPT_COMMAND_REG_BEGIN
void lapic_set_timer(u32 initial_count)
void lapic_write32(u32 offset, u32 value)
static void lapic_memory_setup(void)
u32 lapic_read32(u32 offset)
#define APIC_REG_ERROR_STATUS
#define APIC_REG_TIMER_INITIAL_COUNT
void lapic_write64(u32 offset, u64 value)
u64 lapic_read64(u32 offset)
#define APIC_REG_LVT_TIMER
#define APIC_REG_TIMER_DIVIDE_CONFIG
#define APIC_REG_SPURIOUS_INTR_VEC
static void lapic_wait_sent(void)
const acpi_madt_t * x86_acpi_madt
#define SET_BITS(bit, width, value)
#define once()
Returns true for the first call, false for all subsequent calls.
#define mos_panic(fmt,...)
#define pr_dinfo2(feat, fmt,...)