Kernel: Don't use references or pointers to physical addresses

Now the ACPI & PCI code is more safer, because we don't use raw pointers
or references to objects or data that are located in the physical
address space, so an accidental dereference cannot happen easily.
Instead, we use the PhysicalAddress class to represent those addresses.
This commit is contained in:
Liav A 2020-02-24 00:59:00 +02:00 committed by Andreas Kling
commit 85307dd26e
Notes: sideshowbarker 2024-07-19 09:05:27 +09:00
13 changed files with 91 additions and 102 deletions

View file

@ -146,7 +146,7 @@ extern "C" [[noreturn]] void init()
VirtualConsole::switch_to(0);
// Sample test to see if the ACPI parser is working...
kprintf("ACPI: HPET table @ P 0x%x\n", ACPIParser::the().find_table("HPET"));
kprintf("ACPI: HPET table @ P 0x%x\n", ACPIParser::the().find_table("HPET").get());
setup_pci();
@ -463,12 +463,12 @@ void setup_pci()
static void setup_interrupt_management()
{
auto* madt = (ACPI_RAW::MADT*)ACPIParser::the().find_table("APIC");
if (!madt) {
auto madt = ACPIParser::the().find_table("APIC");
if (madt.is_null()) {
InterruptManagement::initialize();
return;
}
AdvancedInterruptManagement::initialize(*madt);
AdvancedInterruptManagement::initialize(madt);
}
void setup_interrupts()