105#define LAPIC_REG_ICR1_ID_OFFSET 24
169#define IOAPIC_REG_REDIRECTION(pin, high) (0x10 + (pin) * 2 + (high))
176#define APIC_TIMER_TICKS_FIXED_POINT_OFFSET 32
interrupt_t
CPU vector identifiers.
#define PACKED
GCC packed attribute.
lapic_flags_t
Local APIC Flags.
ioapic_delivery_mode_t
IO APIC Delivery Modes.
ioapic_register_t
IO APIC Registers.
apic_timer_mode_t
APIC Timer Modes.
lapic_msr_flags_t
Local APIC MSR Flags.
void ioapic_write(ioapic_t *ioapic, ioapic_register_t reg, uint32_t value)
Write to an IOAPIC register.
uint64_t apic_timer_ticks_per_ns(void)
Apic timer ticks per nanosecond.
ioapic_polarity_t
IO APIC Polarity Modes.
void lapic_cpu_init(void)
Initialize the local apic for the current cpu.
void lapic_eoi(void)
Send an End Of Interrupt (EOI) signal to the local apic.
void ioapic_set_redirect(interrupt_t vector, ioapic_gsi_t gsi, ioapic_delivery_mode_t deliveryMode, ioapic_polarity_t polarity, ioapic_trigger_mode_t triggerMode, cpu_t *cpu, bool enable)
Set an IOAPIC redirection entry.
void apic_timer_one_shot(interrupt_t vector, uint32_t ticks)
Configure the apic timer in one-shot mode.
apic_timer_divider_t
APIC Timer Divider Values.
void lapic_send_init(lapic_id_t id)
Send an INIT IPI to a local apic.
uint32_t ioapic_gsi_t
IO APIC Global System Interrupt type.
ioapic_mmio_register_t
IO APIC Memory Mapped Registers.
void lapic_send_sipi(lapic_id_t id, void *entryPoint)
Send a Startup IPI to a local apic.
ioapic_version_t ioapic_get_version(ioapic_t *ioapic)
Get the IOAPIC version.
lapic_icr_flags_t
Local APIC ICR Flags.
lapic_id_t lapic_self_id(void)
Get the lapic id of the current cpu.
uint32_t ioapic_read(ioapic_t *ioapic, ioapic_register_t reg)
Read from an IOAPIC register.
ioapic_trigger_mode_t
IO APIC Trigger Modes.
ioapic_destination_mode_t
IO APIC Destination Modes.
uint8_t lapic_id_t
Local APIC ID type.
void lapic_send_ipi(lapic_id_t id, interrupt_t vector)
Send an Inter-Processor Interrupt (IPI) to a local apic.
ioapic_t * ioapic_from_gsi(ioapic_gsi_t gsi)
Get the IOAPIC id responsible for a given GSI.
lapic_register_t
Local APIC Registers.
uint32_t lapic_read(lapic_register_t reg)
Read from a local apic register.
lapic_icr_delivery_mode_t
Local APIC ICR Delivery Modes.
void lapic_write(lapic_register_t reg, uint32_t value)
Write to a local apic register.
@ IOAPIC_DELIVERY_EXTERNAL
@ IOAPIC_DELIVERY_LOW_PRIO
@ APIC_TIMER_MASKED
Timer is masked (disabled)
@ LAPIC_ICR_CLEAR_INIT_LEVEL
@ IOAPIC_DESTINATION_PHYSICAL
@ IOAPIC_DESTINATION_LOGICAL
@ LAPIC_REG_TASK_PRIORITY
@ LAPIC_REG_TIMER_CURRENT_COUNT
@ LAPIC_REG_TIMER_INITIAL_COUNT
@ LAPIC_REG_TIMER_DIVIDER
@ LAPIC_REG_PROCESSOR_PRIORITY
@ LAPIC_REG_ARBITRATION_PRIORITY
@ LAPIC_ICR_LOWEST_PRIORITY
IO APIC Version Structure.
IO APIC Redirection Entry Structure.