From e5c95a01ff5b11a5e7d44ff34cad5c6c480318ee Mon Sep 17 00:00:00 2001 From: Fredrik Holmqvist Date: Tue, 28 Mar 2017 21:32:26 +0200 Subject: [PATCH] Use 64 bit addressing for ACPI on 32 bit builds. 32 bit builds with PAE are so much fun. It's like 64 bit without all the extra registers... --- headers/os/drivers/ACPI.h | 4 ++-- src/add-ons/kernel/bus_managers/acpi/ACPICAHaiku.cpp | 9 +++++---- .../bus_managers/acpi/acpica/include/platform/achaiku.h | 5 ----- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/headers/os/drivers/ACPI.h b/headers/os/drivers/ACPI.h index 7aad6cb33b..1efb2a03f1 100644 --- a/headers/os/drivers/ACPI.h +++ b/headers/os/drivers/ACPI.h @@ -15,8 +15,8 @@ typedef union acpi_object_type acpi_object_type; #define B_ACPI_MODULE_NAME "bus_managers/acpi/v1" -typedef addr_t acpi_physical_address; -typedef addr_t acpi_io_address; +typedef phys_addr_t acpi_physical_address; +typedef phys_addr_t acpi_io_address; typedef size_t acpi_size; /* Actually a ptr to a NS Node */ diff --git a/src/add-ons/kernel/bus_managers/acpi/ACPICAHaiku.cpp b/src/add-ons/kernel/bus_managers/acpi/ACPICAHaiku.cpp index 02a717a6dd..120ff1a874 100644 --- a/src/add-ons/kernel/bus_managers/acpi/ACPICAHaiku.cpp +++ b/src/add-ons/kernel/bus_managers/acpi/ACPICAHaiku.cpp @@ -469,8 +469,9 @@ AcpiOsMapMemory(ACPI_PHYSICAL_ADDRESS where, ACPI_SIZE length) { #ifdef _KERNEL_MODE void *there; - area_id area = map_physical_memory("acpi_physical_mem_area", where, length, - B_ANY_KERNEL_ADDRESS, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, &there); + area_id area = map_physical_memory("acpi_physical_mem_area", + (phys_addr_t)where, length, B_ANY_KERNEL_ADDRESS, + B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, &there); DEBUG_FUNCTION_F("addr: 0x%08lx; length: %lu; mapped: %p; area: %ld", (addr_t)where, (size_t)length, there, area); @@ -1050,7 +1051,7 @@ ACPI_STATUS AcpiOsReadMemory(ACPI_PHYSICAL_ADDRESS address, UINT64 *value, UINT32 width) { #ifdef _KERNEL_MODE - if (vm_memcpy_from_physical(value, (addr_t)address, width / 8, false) + if (vm_memcpy_from_physical(value, (phys_addr_t)address, width / 8, false) != B_OK) { return AE_ERROR; } @@ -1078,7 +1079,7 @@ ACPI_STATUS AcpiOsWriteMemory(ACPI_PHYSICAL_ADDRESS address, UINT64 value, UINT32 width) { #ifdef _KERNEL_MODE - if (vm_memcpy_to_physical((addr_t)address, &value, width / 8, false) + if (vm_memcpy_to_physical((phys_addr_t)address, &value, width / 8, false) != B_OK) { return AE_ERROR; } diff --git a/src/add-ons/kernel/bus_managers/acpi/acpica/include/platform/achaiku.h b/src/add-ons/kernel/bus_managers/acpi/acpica/include/platform/achaiku.h index 22cc77dfe3..d9eb971484 100644 --- a/src/add-ons/kernel/bus_managers/acpi/acpica/include/platform/achaiku.h +++ b/src/add-ons/kernel/bus_managers/acpi/acpica/include/platform/achaiku.h @@ -181,11 +181,6 @@ struct mutex; #define ACPI_MACHINE_WIDTH 64 #else #define ACPI_MACHINE_WIDTH 32 -/* TODO: Temporary fix for #12377 - Use 32 bit addresses to match addr_t for now. -*/ -#define ACPI_32BIT_PHYSICAL_ADDRESS - #endif