StuBS
|
Information about the (extended) Advanced Programmable Interrupt Controller. More...
Enumerations | |
enum | Device { TIMER = 0 , KEYBOARD = 1 , COM1 = 4 , COM2 = 3 , COM3 = 4 , COM4 = 3 , FLOPPY = 6 , LPT1 = 7 , REALTIMECLOCK = 8 , PS2MOUSE = 12 , IDE1 = 14 , IDE2 = 15 } |
Historic order of interrupt lines (PIC) More... | |
Functions | |
bool | init () |
Executes system detection. | |
uint8_t | getIOAPICSlot (APIC::Device device) |
Returns the pin number the device is connected to. | |
uintptr_t | getIOAPICAddress () |
Queries the physical I/O-APIC address determined during system boot. | |
uint8_t | getIOAPICID () |
Queries of ID of the I/O-APIC determined during system boot. | |
uint8_t | getLogicalAPICID (uint8_t core) |
Returns the logical ID of the Local APIC passed for core. | |
uint8_t | getLAPICID (uint8_t core) |
Get the Local APIC ID of a CPU. | |
Constants | ||
struct { | ||
uint32_t | id | |
uintptr_t | address | |
uint32_t | interrupt_base | |
} | ioapic | |
static uint8_t | slot_map [16] | |
static uint8_t | lapic_id [Core::MAX] | |
static unsigned | lapics = 0 | |
const uint8_t | INVALID_ID = 0xff | |
Invalid APIC ID. | ||
Information about the (extended) Advanced Programmable Interrupt Controller.
enum APIC::Device |
Historic order of interrupt lines (PIC)
Enumerator | |
---|---|
TIMER | Programmable Interrupt Timer (PIT) |
KEYBOARD | Keyboard. |
COM1 | First serial interface. |
COM2 | Second serial interface. |
COM3 | Third serial interface (shared with COM1) |
COM4 | Forth serial interface (shared with COM2) |
FLOPPY | Floppy device. |
LPT1 | Printer. |
REALTIMECLOCK | Real time clock. |
PS2MOUSE | Mouse. |
IDE1 | First hard disk. |
IDE2 | Second hard disk. |
bool APIC::init | ( | ) |
Executes system detection.
Searches and evaluates the APIC entries in the ACPI table. This function recognizes a possibly existing multicore system. After successful detection, the number of available CPUs (which is equal to the number of local APICs) ) can be queried using the method Core::count().
true
if detection of the APIC entries was successful uint8_t APIC::getIOAPICSlot | ( | APIC::Device | device | ) |
Returns the pin number the device
is connected to.
uintptr_t APIC::getIOAPICAddress | ( | ) |
Queries the physical I/O-APIC address determined during system boot.
uint8_t APIC::getIOAPICID | ( | ) |
Queries of ID of the I/O-APIC determined during system boot.
Returns the logical ID of the Local APIC passed for core.
The LAPIC's logical ID is set (by StuBS) during boot such that exactly one bit is set per CPU core. For core 0, bit 0 is set in its ID, while core 1 has bit 1 set, etc.
core | The queried CPU core |
Get the Local APIC ID of a CPU.
core | Query CPU core number |
struct { ... } APIC::ioapic |
|
static |
|
static |
const uint8_t APIC::INVALID_ID = 0xff |
Invalid APIC ID.
The highest address is reserved according to xAPIC specification