I/O APIC
include/acpi/ioapic.h View source View on GitHubStructs
Section titled “Structs”ioapic_info
Section titled “ioapic_info”struct ioapic_info {
uint8_t id;
uint32_t gsi_base;
uint32_t *mmio_base;
}; Unions
Section titled “Unions”ioapic_redirection_entry
Section titled “ioapic_redirection_entry”union ioapic_redirection_entry {
uint64_t raw;
struct {
uint8_t vector;
uint8_t delivery_mode : 3;
uint8_t dest_mode : 1;
uint8_t delivery_status : 1;
uint8_t polarity : 1;
uint8_t remote_irr : 1;
uint8_t trigger_mode : 1;
uint8_t mask : 1;
uint64_t reserved : 39;
uint8_t dest_apic_id;
};
}; Functions
Section titled “Functions”ioapic_init
Section titled “ioapic_init”void ioapic_init(void); ioapic_write
Section titled “ioapic_write”void ioapic_write(uint8_t reg, uint32_t val); ioapic_read
Section titled “ioapic_read”uint32_t ioapic_read(uint8_t reg); ioapic_set_redirection_entry
Section titled “ioapic_set_redirection_entry”void ioapic_set_redirection_entry(int irq, uint64_t entry); ioapic_get_redirection_entry
Section titled “ioapic_get_redirection_entry”uint64_t ioapic_get_redirection_entry(int irq); ioapic_route_irq
Section titled “ioapic_route_irq”void ioapic_route_irq(irq_t irq, uint8_t vector, uint8_t dest_apic_id, bool masked); ioapic_mask_irq
Section titled “ioapic_mask_irq”void ioapic_mask_irq(irq_t irq); ioapic_unmask_irq
Section titled “ioapic_unmask_irq”void ioapic_unmask_irq(irq_t irq); ioapic_get_chip
Section titled “ioapic_get_chip”struct irq_chip * ioapic_get_chip(void); ioapic_isa_to_gsi
Section titled “ioapic_isa_to_gsi”uint32_t ioapic_isa_to_gsi(uint8_t isa_irq); ioapic_route_isa_irq
Section titled “ioapic_route_isa_irq”void ioapic_route_isa_irq(uint8_t isa_irq, uint8_t vector, uint8_t dest_apic_id, bool masked); ioapic_route_isa_nmi
Section titled “ioapic_route_isa_nmi”void ioapic_route_isa_nmi(uint8_t isa_irq, uint8_t dest_apic_id); Macros
Section titled “Macros”IOAPIC_REGSEL_INDEX
Section titled “IOAPIC_REGSEL_INDEX”#define IOAPIC_REGSEL_INDEX 0 /* IOREGSEL index */ IOAPIC_IOWIN_INDEX
Section titled “IOAPIC_IOWIN_INDEX”#define IOAPIC_IOWIN_INDEX 4 /* IOWIN index */ IOAPIC_MMIO_SIZE
Section titled “IOAPIC_MMIO_SIZE”#define IOAPIC_MMIO_SIZE 0x20 /* 32 bytes */ IOAPIC_REG_ID
Section titled “IOAPIC_REG_ID”#define IOAPIC_REG_ID 0x00 IOAPIC_REG_VER
Section titled “IOAPIC_REG_VER”#define IOAPIC_REG_VER 0x01 IOAPIC_REG_ARB
Section titled “IOAPIC_REG_ARB”#define IOAPIC_REG_ARB 0x02 IOAPIC_REG_REDTBL_BASE
Section titled “IOAPIC_REG_REDTBL_BASE”#define IOAPIC_REG_REDTBL_BASE 0x10 IOAPIC_REDTBL_REG_LOW
Section titled “IOAPIC_REDTBL_REG_LOW”#define IOAPIC_REDTBL_REG_LOW(pin) \
((uint8_t) (IOAPIC_REG_REDTBL_BASE + (pin) * 2)) IOAPIC_REDTBL_REG_HIGH
Section titled “IOAPIC_REDTBL_REG_HIGH”#define IOAPIC_REDTBL_REG_HIGH(pin) \
((uint8_t) (IOAPIC_REG_REDTBL_BASE + (pin) * 2 + 1)) IOAPIC_DELIVERY_FIXED
Section titled “IOAPIC_DELIVERY_FIXED”#define IOAPIC_DELIVERY_FIXED 0 IOAPIC_DELIVERY_LOWEST
Section titled “IOAPIC_DELIVERY_LOWEST”#define IOAPIC_DELIVERY_LOWEST 1 IOAPIC_DELIVERY_SMI
Section titled “IOAPIC_DELIVERY_SMI”#define IOAPIC_DELIVERY_SMI 2 IOAPIC_DELIVERY_NMI
Section titled “IOAPIC_DELIVERY_NMI”#define IOAPIC_DELIVERY_NMI 4 IOAPIC_DELIVERY_INIT
Section titled “IOAPIC_DELIVERY_INIT”#define IOAPIC_DELIVERY_INIT 5 IOAPIC_DELIVERY_EXTINT
Section titled “IOAPIC_DELIVERY_EXTINT”#define IOAPIC_DELIVERY_EXTINT 7 IOAPIC_DEST_PHYSICAL
Section titled “IOAPIC_DEST_PHYSICAL”#define IOAPIC_DEST_PHYSICAL 0 IOAPIC_DEST_LOGICAL
Section titled “IOAPIC_DEST_LOGICAL”#define IOAPIC_DEST_LOGICAL 1 IOAPIC_POLARITY_ACTIVE_HIGH
Section titled “IOAPIC_POLARITY_ACTIVE_HIGH”#define IOAPIC_POLARITY_ACTIVE_HIGH 0 IOAPIC_POLARITY_ACTIVE_LOW
Section titled “IOAPIC_POLARITY_ACTIVE_LOW”#define IOAPIC_POLARITY_ACTIVE_LOW 1 IOAPIC_TRIGGER_EDGE
Section titled “IOAPIC_TRIGGER_EDGE”#define IOAPIC_TRIGGER_EDGE 0 IOAPIC_TRIGGER_LEVEL
Section titled “IOAPIC_TRIGGER_LEVEL”#define IOAPIC_TRIGGER_LEVEL 1 IOAPIC_MASK_UNMASKED
Section titled “IOAPIC_MASK_UNMASKED”#define IOAPIC_MASK_UNMASKED 0 IOAPIC_MASK_MASKED
Section titled “IOAPIC_MASK_MASKED”#define IOAPIC_MASK_MASKED 1 IOAPIC_REDTBL_MASK
Section titled “IOAPIC_REDTBL_MASK”#define IOAPIC_REDTBL_MASK (1u << 16) IOAPIC_ISO_POLARITY_MASK
Section titled “IOAPIC_ISO_POLARITY_MASK”#define IOAPIC_ISO_POLARITY_MASK 0x03 IOAPIC_ISO_POLARITY_ACTIVE_LOW
Section titled “IOAPIC_ISO_POLARITY_ACTIVE_LOW”#define IOAPIC_ISO_POLARITY_ACTIVE_LOW 0x03 IOAPIC_ISO_TRIGGER_MASK
Section titled “IOAPIC_ISO_TRIGGER_MASK”#define IOAPIC_ISO_TRIGGER_MASK 0x0C IOAPIC_ISO_TRIGGER_LEVEL
Section titled “IOAPIC_ISO_TRIGGER_LEVEL”#define IOAPIC_ISO_TRIGGER_LEVEL 0x0C