mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:57:35 +00:00
Kernel/ACPI: Return Optional container after table search
This is a better pattern than returning a PhysicalAddress with a zero value, so the code is more understandable now.
This commit is contained in:
parent
43b17f27a3
commit
bde3c7301e
7 changed files with 26 additions and 25 deletions
|
@ -265,12 +265,12 @@ UNMAP_AFTER_INIT bool APIC::init_bsp()
|
|||
return false;
|
||||
}
|
||||
auto madt_address = ACPI::StaticParsing::find_table(rsdp.value(), "APIC");
|
||||
if (madt_address.is_null()) {
|
||||
if (!madt_address.has_value()) {
|
||||
dbgln("APIC: MADT table not found");
|
||||
return false;
|
||||
}
|
||||
|
||||
auto madt = Memory::map_typed<ACPI::Structures::MADT>(madt_address);
|
||||
auto madt = Memory::map_typed<ACPI::Structures::MADT>(madt_address.value());
|
||||
size_t entry_index = 0;
|
||||
size_t entries_length = madt->h.length - sizeof(ACPI::Structures::MADT);
|
||||
auto* madt_entry = madt->entries;
|
||||
|
|
|
@ -115,7 +115,7 @@ UNMAP_AFTER_INIT PhysicalAddress InterruptManagement::search_for_madt()
|
|||
auto rsdp = ACPI::StaticParsing::find_rsdp();
|
||||
if (!rsdp.has_value())
|
||||
return {};
|
||||
return ACPI::StaticParsing::find_table(rsdp.value(), "APIC");
|
||||
return ACPI::StaticParsing::find_table(rsdp.value(), "APIC").value();
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT InterruptManagement::InterruptManagement()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue