IOAPIC: Difference between revisions

m
no edit summary
[unchecked revision][unchecked revision]
mNo edit summary
mNo edit summary
 
(4 intermediate revisions by 4 users not shown)
Line 1:
{{DISPLAYTITLE:I/O APIC}}
 
The Intel I/O Advanced Programmable Interrupt Controller is used to distribute external interrupts in a more advanced manner than that of the standard [[8259 PIC]]. With the I/O APIC, interrupts can be distributed to physical or logical (clusters of) processors and can be prioritized. Each I/O APIC typically handles 24 external interrupts.
 
Line 5 ⟶ 7:
 
== Programming the I/O APIC ==
Each I/O APIC has a set of 2 or 3 (depending on version) 32-bit registers and up to many 64-bit registers (one per IRQ). The 64-bit registers have actually to be accessed as two 32-bit reads/writes. All registers are memory indexed. It means that you actually have only two 32-bit registers in memory, called IOREGSEL and IOREGWIN. You put the register index in IOREGSEL, and then you can read/write in IOREGWIN. The first three registers contain general information about this I/O APIC, while the remaining registers contain the specific configuration for each IRQ.
 
=== IOAPICID ===
Line 64 ⟶ 66:
The register IOREGSEL is an MMIO register select register that is used to access all the other I/O APIC registers. The IOWIN register is the 'data' register. Once the IOREGSEL register has been set, the IOWIN register can be used to write or read the register in the IOREGSEL. The actual position in memory of the two registers is specified in the ACPI MADT Table and/or in the MP table. The IOREGSEL is at the address specified, and IOREGWIN is at the same address + 0x10.
 
<sourcesyntaxhighlight lang="cpp">
 
#define IOAPICID 0x00
Line 247 ⟶ 249:
}
};
</syntaxhighlight>
</source>
'apic_base' is the memory base address for a selected IOAPIC, these can be found by enumerating them from the MP or ACPI Tables.