X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/ae23ad2227bd97df4b464937b1dd54a0f3702148..0e1309c02f0703c050df09b71346dab60fc6df87:/lunaix-os/hal/acpi/acpi.c diff --git a/lunaix-os/hal/acpi/acpi.c b/lunaix-os/hal/acpi/acpi.c index 5713f9a..55c27ae 100644 --- a/lunaix-os/hal/acpi/acpi.c +++ b/lunaix-os/hal/acpi/acpi.c @@ -1,12 +1,12 @@ #include -#include +#include #include #include #include -#include "parser/madt_parser.h" +#include "parser/parser.h" static acpi_context* ctx = NULL; @@ -26,11 +26,9 @@ acpi_init(multiboot_info_t* mb_info) assert_msg(rsdp, "Fail to locate ACPI_RSDP"); assert_msg(acpi_rsdp_validate(rsdp), "Invalid ACPI_RSDP (checksum failed)"); - kprintf(KINFO "RSDP found at %p, RSDT: %p\n", rsdp, rsdp->rsdt); - acpi_rsdt_t* rsdt = rsdp->rsdt; - ctx = lxcalloc(1, sizeof(acpi_context)); + ctx = vzalloc(sizeof(acpi_context)); assert_msg(ctx, "Fail to create ACPI context"); strncpy(ctx->oem_id, rsdt->header.oem_id, 6); @@ -47,22 +45,15 @@ acpi_init(multiboot_info_t* mb_info) // FADT just a plain structure, no need to parse. ctx->fadt = *(acpi_fadt_t*)sdthdr; break; + case ACPI_MCFG_SIG: + mcfg_parse(sdthdr, ctx); + break; default: break; } } - kprintf(KINFO "OEM: %s\n", ctx->oem_id); - kprintf(KINFO "IOAPIC address: %p\n", ctx->madt.ioapic->ioapic_addr); - kprintf(KINFO "APIC address: %p\n", ctx->madt.apic_addr); - - for (size_t i = 0; i < 24; i++) { - acpi_intso_t* intso = ctx->madt.irq_exception[i]; - if (!intso) - continue; - - kprintf(KINFO "IRQ #%u -> GSI #%u\n", intso->source, intso->gsi); - } + kprintf(KINFO "ACPI: %s\n", ctx->oem_id); } acpi_context*