mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 22:55:23 +00:00
Kernel: Add typed_map<T>(PhysicalAddress) and use it in ACPI parsing
There was a frequently occurring pattern of "map this physical address into kernel VM, then read from it, then unmap it again". This new typed_map() encapsulates that logic by giving you back a typed pointer to the kind of structure you're interested in accessing. It returns a TypedMapping<T> that can be used mostly like a pointer. When destroyed, the TypedMapping object will unmap the memory. :^)
This commit is contained in:
@@ -127,7 +127,7 @@ RefPtr<IRQController> InterruptManagement::get_responsible_irq_controller(u8 int
|
||||
PhysicalAddress InterruptManagement::search_for_madt()
|
||||
{
|
||||
dbg() << "Early access to ACPI tables for interrupt setup";
|
||||
auto rsdp = ACPI::StaticParsing::search_rsdp();
|
||||
auto rsdp = ACPI::StaticParsing::find_rsdp();
|
||||
if (rsdp.is_null())
|
||||
return {};
|
||||
return ACPI::StaticParsing::search_table(rsdp, "APIC");
|
||||
|
||||
Reference in New Issue
Block a user