mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
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:
parent
43d570a1e3
commit
85307dd26e
13 changed files with 91 additions and 102 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue