Fixes to Haiku specific code to work with ACPICA 20120711.
This commit is contained in:
parent
6822cda011
commit
a51a5f3e1e
@ -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 */
|
||||
|
@ -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 :
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -305,6 +305,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
|
||||
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user