diff --git a/src/add-ons/kernel/bus_managers/acpi/ACPICAHaiku.cpp b/src/add-ons/kernel/bus_managers/acpi/ACPICAHaiku.cpp index 9041eda596..3adf0725ca 100644 --- a/src/add-ons/kernel/bus_managers/acpi/ACPICAHaiku.cpp +++ b/src/add-ons/kernel/bus_managers/acpi/ACPICAHaiku.cpp @@ -233,13 +233,15 @@ ACPI_PHYSICAL_ADDRESS AcpiOsGetRootPointer() { #ifdef _KERNEL_MODE - ACPI_PHYSICAL_ADDRESS address; - ACPI_STATUS status = AE_OK; DEBUG_FUNCTION(); if (sACPIRoot == 0) { - sACPIRoot = (ACPI_PHYSICAL_ADDRESS)get_boot_item("ACPI_ROOT_POINTER", NULL); + phys_addr_t* acpiRootPointer = (phys_addr_t*)get_boot_item("ACPI_ROOT_POINTER", NULL); + if (acpiRootPointer != NULL) + sACPIRoot = *acpiRootPointer; + if (sACPIRoot == 0) { - status = AcpiFindRootPointer(&address); + ACPI_PHYSICAL_ADDRESS address; + ACPI_STATUS status = AcpiFindRootPointer(&address); if (status == AE_OK) sACPIRoot = address; } diff --git a/src/system/kernel/arch/x86/arch_platform.cpp b/src/system/kernel/arch/x86/arch_platform.cpp index ac15e227df..2656200389 100644 --- a/src/system/kernel/arch/x86/arch_platform.cpp +++ b/src/system/kernel/arch/x86/arch_platform.cpp @@ -14,6 +14,9 @@ #include +static phys_addr_t sACPIRootPointer = 0; + + status_t arch_platform_init(struct kernel_args *args) { @@ -25,8 +28,9 @@ status_t arch_platform_init_post_vm(struct kernel_args *args) { // Now we can add boot items; pass on the ACPI root pointer + sACPIRootPointer = args->arch_args.acpi_root.Get(); add_boot_item("ACPI_ROOT_POINTER", - args->arch_args.acpi_root.Pointer(), sizeof(void*)); + &sACPIRootPointer, sizeof(sACPIRootPointer)); return B_OK; }