kernel/x86: use proper phys_addr_t field for storing ACPI root pointer
Change-Id: I475b7b3f9bd0711ecd037043e86559ab691a82a7 Reviewed-on: https://review.haiku-os.org/c/haiku/+/4881 Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org> Reviewed-by: Adrien Destugues <pulkomandy@gmail.com> Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com> Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
This commit is contained in:
parent
bfd5d56283
commit
a7b50febfa
@ -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;
|
||||
}
|
||||
|
@ -14,6 +14,9 @@
|
||||
#include <boot/stage2.h>
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user