diff options
| author | Fredrik Holmqvist <fredrik.holmqvist@gmail.com> | 2012-07-12 18:23:25 +0200 |
|---|---|---|
| committer | Fredrik Holmqvist <fredrik.holmqvist@gmail.com> | 2012-07-12 18:32:56 +0200 |
| commit | a51a5f3e1e8dbcf4a92a041fa99e73475d2d5524 (patch) | |
| tree | 7479bf8d0b91fe96a0be537203f8ed1b37659dcb | |
| parent | 6822cda0111dcc02d277ee0d3a21fb5cf33db1ea (diff) | |
Fixes to Haiku specific code to work with ACPICA 20120711.hrev44323
| -rw-r--r-- | headers/os/drivers/ACPI.h | 4 | ||||
| -rw-r--r-- | src/add-ons/kernel/bus_managers/acpi/Jamfile | 11 | ||||
| -rw-r--r-- | src/add-ons/kernel/bus_managers/acpi/acpi_busman.c | 6 | ||||
| -rw-r--r-- | src/add-ons/kernel/bus_managers/acpi/acpi_priv.h | 4 | ||||
| -rw-r--r-- | src/add-ons/kernel/bus_managers/acpi/oshaiku.cpp | 53 | ||||
| -rw-r--r-- | src/system/kernel/arch/x86/arch_cpu.cpp | 2 |
6 files changed, 65 insertions, 15 deletions
diff --git a/headers/os/drivers/ACPI.h b/headers/os/drivers/ACPI.h index 73a6b075a1..d781acb5d5 100644 --- a/headers/os/drivers/ACPI.h +++ b/headers/os/drivers/ACPI.h @@ -31,7 +31,7 @@ typedef void * acpi_handle; #define ACPI_ALL_NOTIFY (ACPI_SYSTEM_NOTIFY | ACPI_DEVICE_NOTIFY) #define ACPI_MAX_NOTIFY_HANDLER_TYPE 0x3 -#define ACPI_MAX_SYS_NOTIFY 0x7f +#define ACPI_MAX_SYS_NOTIFY 0x7F /* Address Space (Operation Region) Types */ @@ -255,7 +255,7 @@ struct acpi_module_info { status_t (*prepare_sleep_state)(uint8 state, void (*wakeFunc)(void), size_t size); - status_t (*enter_sleep_state)(uint8 state); + status_t (*enter_sleep_state)(uint8 state, uint8 flags); status_t (*reboot)(void); /* Table Access */ diff --git a/src/add-ons/kernel/bus_managers/acpi/Jamfile b/src/add-ons/kernel/bus_managers/acpi/Jamfile index eec7fd91f0..8852b64d3e 100644 --- a/src/add-ons/kernel/bus_managers/acpi/Jamfile +++ b/src/add-ons/kernel/bus_managers/acpi/Jamfile @@ -45,7 +45,7 @@ local events_src = evxfgpe.c evxfregn.c ; - + local executer_src = exconfig.c exconvrt.c @@ -75,6 +75,7 @@ local executer_src = local hardware_src = hwacpi.c + hwesleep.c hwgpe.c hwpci.c hwregs.c @@ -82,7 +83,8 @@ local hardware_src = hwtimer.c hwvalid.c hwxface.c -; + hwxfsleep.c + ; local namespace_src = nsaccess.c @@ -129,6 +131,7 @@ local resources_src = rslist.c rsmemory.c rsmisc.c + rsserial.c rsutils.c rsxface.c ; @@ -139,10 +142,12 @@ local tables_src = tbinstal.c tbutils.c tbxface.c + tbxfload.c tbxfroot.c ; local utilities_src = + utaddress.c utalloc.c utcache.c utclib.c @@ -151,6 +156,7 @@ local utilities_src = utdebug.c utdelete.c uteval.c + utexcep.c utglobal.c utids.c utinit.c @@ -165,6 +171,7 @@ local utilities_src = uttrack.c utxface.c utxferror.c + utxfmutex.c ; StaticLibrary libacpi_ca.a : diff --git a/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c b/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c index ce4744bca8..557247ccdc 100644 --- a/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c +++ b/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c @@ -670,13 +670,13 @@ prepare_sleep_state(uint8 state, void (*wakeFunc)(void), size_t size) status_t -enter_sleep_state(uint8 state) +enter_sleep_state(uint8 state, uint8 flags) { ACPI_STATUS status; - TRACE("enter_sleep_state %d\n", state); + TRACE("enter_sleep_state %d with flags %d\n", state, flags); - status = AcpiEnterSleepState(state); + status = AcpiEnterSleepState(state, flags); if (status != AE_OK) return B_ERROR; diff --git a/src/add-ons/kernel/bus_managers/acpi/acpi_priv.h b/src/add-ons/kernel/bus_managers/acpi/acpi_priv.h index ec8b7a7849..5bf47e5271 100644 --- a/src/add-ons/kernel/bus_managers/acpi/acpi_priv.h +++ b/src/add-ons/kernel/bus_managers/acpi/acpi_priv.h @@ -135,7 +135,7 @@ typedef struct acpi_root_info { status_t (*prepare_sleep_state)(uint8 state, void (*wakeFunc)(void), size_t size); - status_t (*enter_sleep_state)(uint8 state); + status_t (*enter_sleep_state)(uint8 state, uint8 flags); status_t (*reboot)(void); /* Table Access */ @@ -218,7 +218,7 @@ status_t set_current_resources(acpi_handle busDeviceHandle, acpi_data* buffer); status_t prepare_sleep_state(uint8 state, void (*wakeFunc)(void), size_t size); -status_t enter_sleep_state(uint8 state); +status_t enter_sleep_state(uint8 state, uint8 flags); status_t reboot(void); diff --git a/src/add-ons/kernel/bus_managers/acpi/oshaiku.cpp b/src/add-ons/kernel/bus_managers/acpi/oshaiku.cpp index ae4424847c..d001e0e2be 100644 --- a/src/add-ons/kernel/bus_managers/acpi/oshaiku.cpp +++ b/src/add-ons/kernel/bus_managers/acpi/oshaiku.cpp @@ -307,6 +307,31 @@ AcpiOsTableOverride(ACPI_TABLE_HEADER *existingTable, /****************************************************************************** * + * FUNCTION: AcpiOsPhysicalTableOverride + * + * PARAMETERS: existingTable - Header of current table (probably firmware) + * newAddress - Where new table address is returned + * (Physical address) + * newTableLength - Where new table length is returned + * + * RETURN: Status, address/length of new table. Null pointer returned + * if no table is available to override. + * + * DESCRIPTION: Returns AE_SUPPORT, function not used in user space. + * + *****************************************************************************/ + +ACPI_STATUS +AcpiOsPhysicalTableOverride(ACPI_TABLE_HEADER *existingTable, + ACPI_PHYSICAL_ADDRESS *newAddress, UINT32 *newTableLength) +{ + DEBUG_FUNCTION(); + return (AE_SUPPORT); +} + + +/****************************************************************************** + * * FUNCTION: AcpiOsRedirectOutput * * PARAMETERS: destination - An open file handle/pointer @@ -363,7 +388,6 @@ void AcpiOsVprintf(const char *fmt, va_list args) { #ifndef _KERNEL_MODE - INT32 count = 0; UINT8 flags; flags = AcpiGbl_DbOutputFlags; @@ -371,7 +395,7 @@ AcpiOsVprintf(const char *fmt, va_list args) // Output is directable to either a file (if open) or the console if (AcpiGbl_DebugFile) { // Output file is open, send the output there - count = vfprintf(AcpiGbl_DebugFile, fmt, args); + vfprintf(AcpiGbl_DebugFile, fmt, args); } else { // No redirection, send output to console (once only!) flags |= ACPI_DB_CONSOLE_OUTPUT; @@ -379,7 +403,7 @@ AcpiOsVprintf(const char *fmt, va_list args) } if (flags & ACPI_DB_CONSOLE_OUTPUT) { - count = vfprintf(AcpiGbl_OutputFile, fmt, args); + vfprintf(AcpiGbl_OutputFile, fmt, args); } #else static char outputBuffer[1024]; @@ -1018,7 +1042,7 @@ AcpiOsWritePort(ACPI_IO_ADDRESS address, UINT32 value, UINT32 width) * *****************************************************************************/ ACPI_STATUS -AcpiOsReadMemory(ACPI_PHYSICAL_ADDRESS address, UINT32 *value, UINT32 width) +AcpiOsReadMemory(ACPI_PHYSICAL_ADDRESS address, UINT64 *value, UINT32 width) { #ifdef _KERNEL_MODE if (vm_memcpy_from_physical(value, (addr_t)address, width / 8, false) @@ -1046,7 +1070,7 @@ AcpiOsReadMemory(ACPI_PHYSICAL_ADDRESS address, UINT32 *value, UINT32 width) * *****************************************************************************/ ACPI_STATUS -AcpiOsWriteMemory(ACPI_PHYSICAL_ADDRESS address, UINT32 value, UINT32 width) +AcpiOsWriteMemory(ACPI_PHYSICAL_ADDRESS address, UINT64 value, UINT32 width) { #ifdef _KERNEL_MODE if (vm_memcpy_to_physical((addr_t)address, &value, width / 8, false) @@ -1301,3 +1325,22 @@ AcpiOsReleaseMutex(ACPI_MUTEX handle) mutex_unlock(handle); } + +/****************************************************************************** + * + * FUNCTION: AcpiOsWaitEventsComplete + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Wait for all asynchronous events to complete. This + * implementation does nothing. + * + *****************************************************************************/ +void +AcpiOsWaitEventsComplete() +{ + //TODO: FreeBSD See description. + return; +} diff --git a/src/system/kernel/arch/x86/arch_cpu.cpp b/src/system/kernel/arch/x86/arch_cpu.cpp index 8d44375dbf..09359b64a4 100644 --- a/src/system/kernel/arch/x86/arch_cpu.cpp +++ b/src/system/kernel/arch/x86/arch_cpu.cpp @@ -144,7 +144,7 @@ acpi_shutdown(bool rebootSystem) status = acpi->prepare_sleep_state(ACPI_POWER_STATE_OFF, NULL, 0); if (status == B_OK) { //cpu_status state = disable_interrupts(); - status = acpi->enter_sleep_state(ACPI_POWER_STATE_OFF); + status = acpi->enter_sleep_state(ACPI_POWER_STATE_OFF, 0); //restore_interrupts(state); } } |
