![]() |
Max OS 0.3
|
Handles the local APIC for the current core. More...
#include <apic.h>
Public Member Functions | |
| LocalAPIC () | |
| Construct a new Local APIC object and map the APIC base address to the higher half if needed as well as enabling the APIC. | |
| uint32_t | read (uint32_t reg) const |
| read a value from the apic register using the MSR or memory I/O depending on the local apic version | |
| void | write (uint32_t reg, uint32_t value) const |
| write a value to the apic register using the MSR or memory I/O depending on the local apic version | |
| uint32_t | id () const |
| Get the id of the local apic. | |
| void | send_eoi () const |
| Acknowledge that the interrupt has been handled, allowing the PIC to process the next interrupt. | |
| void | send_init (uint8_t apic_id, bool assert) const |
| send the init IPI to another apic | |
| void | send_startup (uint8_t apic_id, uint8_t vector) const |
| send the start up IPI to another apic | |
| LocalAPIC::LocalAPIC | ( | ) |
Construct a new Local APIC object and map the APIC base address to the higher half if needed as well as enabling the APIC.
Definition at line 21 of file apic.cpp.
References ASSERT, MaxOS::system::CPU::cpuid(), MaxOS::Logger::DEBUG(), MaxOS::memory::PhysicalMemoryManager::map(), MaxOS::memory::PRESENT, MaxOS::system::CPU::read_msr(), MaxOS::memory::PhysicalMemoryManager::reserve(), MaxOS::memory::PhysicalMemoryManager::s_current_manager, MaxOS::memory::PhysicalMemoryManager::to_io_region(), MaxOS::Logger::WARNING(), write(), MaxOS::memory::WRITE, and MaxOS::system::CPU::write_msr().
| uint32_t LocalAPIC::id | ( | ) | const |
Get the id of the local apic.
Definition at line 108 of file apic.cpp.
Referenced by id().
| uint32_t LocalAPIC::read | ( | uint32_t | reg | ) | const |
read a value from the apic register using the MSR or memory I/O depending on the local apic version
| reg | The register to read |
Definition at line 76 of file apic.cpp.
References MaxOS::system::CPU::read_msr().
Referenced by id(), send_init(), and send_startup().
| void LocalAPIC::send_eoi | ( | ) | const |
| void LocalAPIC::send_init | ( | uint8_t | apic_id, |
| bool | assert | ||
| ) | const |
send the init IPI to another apic
| apic_id | The id of the apic to send to |
| assert | Is this an assert code (drive / release the signal) |
Definition at line 131 of file apic.cpp.
References read(), write(), and MaxOS::system::CPU::write_msr().
| void LocalAPIC::send_startup | ( | uint8_t | apic_id, |
| uint8_t | vector | ||
| ) | const |
send the start up IPI to another apic
| apic_id | The apic to send it to |
| vector | Where to start executing |
Definition at line 170 of file apic.cpp.
References read(), write(), and MaxOS::system::CPU::write_msr().
| void LocalAPIC::write | ( | uint32_t | reg, |
| uint32_t | value | ||
| ) | const |
write a value to the apic register using the MSR or memory I/O depending on the local apic version
| reg | The register to write to |
| value | The value to write |
Definition at line 91 of file apic.cpp.
References MaxOS::system::CPU::write_msr().
Referenced by LocalAPIC(), send_eoi(), send_init(), send_startup(), and MaxOS::drivers::clock::Clock::setup_apic_clock().