![]() |
Max OS 0.3
|
Handles the IO APIC in the system (one per system) More...
#include <apic.h>
Public Member Functions | |
| IOAPIC (AdvancedConfigurationAndPowerInterface *acpi) | |
| Construct a new IO APIC object. Maps the IO APIC registers and reads the MADT to get information about the IO APICs and interrupt source overrides. | |
| uint32_t | read (uint32_t reg) const |
| read a value from a IO Apic register | |
| void | write (uint32_t reg, uint32_t value) const |
| write a value to an IO Apic register | |
| void | set_redirect (interrupt_redirect_t *redirect) |
| Redirect a system interrupt to a different IRQ. | |
| void | set_redirect_mask (uint8_t index, bool mask) |
| Enables/Disables an interrupt redirect by masking it. | |
| MADTEntry * | get_madt_item (MADT_TYPE type, uint8_t index) |
| Get an item in the MADT. | |
|
explicit |
Construct a new IO APIC object. Maps the IO APIC registers and reads the MADT to get information about the IO APICs and interrupt source overrides.
| acpi | The ACPI interface to get the MADT from |
Definition at line 198 of file apic.cpp.
References MaxOS::hardwarecommunication::Override::bus, MaxOS::Logger::DEBUG(), MaxOS::hardwarecommunication::AdvancedConfigurationAndPowerInterface::find(), MaxOS::hardwarecommunication::Override::flags, get_madt_item(), MaxOS::hardwarecommunication::Override::global_system_interrupt, MaxOS::hardwarecommunication::MADTEntry::length, MaxOS::memory::PhysicalMemoryManager::map(), MaxOS::memory::PRESENT, read(), MaxOS::memory::PhysicalMemoryManager::s_current_manager, MaxOS::hardwarecommunication::Override::source, MaxOS::memory::PhysicalMemoryManager::to_io_region(), MaxOS::hardwarecommunication::MADTEntry::type, and MaxOS::memory::WRITE.
Get an item in the MADT.
| type | The type of item |
| index | The index of the item |
Definition at line 261 of file apic.cpp.
References MaxOS::hardwarecommunication::MADT::header, MaxOS::hardwarecommunication::ACPISDTHeader::length, and MaxOS::hardwarecommunication::MADTEntry::length.
Referenced by MaxOS::system::CPU::find_cores(), and IOAPIC().
| uint32_t IOAPIC::read | ( | uint32_t | reg | ) | const |
read a value from a IO Apic register
| reg | The register to read from |
Definition at line 297 of file apic.cpp.
Referenced by IOAPIC().
| void IOAPIC::set_redirect | ( | interrupt_redirect_t * | redirect | ) |
Redirect a system interrupt to a different IRQ.
| redirect | The redirection entry |
Definition at line 365 of file apic.cpp.
References MaxOS::hardwarecommunication::InterruptRedirect::destination, MaxOS::hardwarecommunication::InterruptRedirect::flags, MaxOS::hardwarecommunication::Override::flags, MaxOS::hardwarecommunication::InterruptRedirect::index, MaxOS::hardwarecommunication::InterruptRedirect::interrupt, MaxOS::hardwarecommunication::InterruptRedirect::mask, MaxOS::hardwarecommunication::RedirectionEntry::raw, and MaxOS::hardwarecommunication::InterruptRedirect::type.
Referenced by MaxOS::hardwarecommunication::InterruptHandler::InterruptHandler().
| void IOAPIC::set_redirect_mask | ( | uint8_t | index, |
| bool | mask | ||
| ) |
Enables/Disables an interrupt redirect by masking it.
| index | The index of the redirect mask |
| mask | True = masked = disabled, False = unmasked = enabled |
Definition at line 399 of file apic.cpp.
| void IOAPIC::write | ( | uint32_t | reg, |
| uint32_t | value | ||
| ) | const |
write a value to an IO Apic register
| reg | The register to write to |
| value | The value to set the register to |
Definition at line 312 of file apic.cpp.