- revert r34170 because it crash on some maschines

- fix warning
- add get_irq_routing_table to the acpi busmanager (don't forget to link the kernel after an update)



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34201 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Clemens Zeidler 2009-11-23 21:20:32 +00:00
parent 452edf50c3
commit f0d4507749
3 changed files with 31 additions and 6 deletions

View File

@ -22,6 +22,7 @@
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
#include "acpi_priv.h"
//#define TRACE_ACPI_BUS
@ -111,6 +112,12 @@ acpi_std_ops(int32 op,...)
return ENOSYS;
}
if (gDPC->new_dpc_queue(&gDPCHandle, "acpi_task",
B_NORMAL_PRIORITY) != B_OK) {
ERROR("failed to create os execution queue\n");
return B_ERROR;
}
AcpiGbl_EnableInterpreterSlack = true;
// AcpiGbl_CreateOSIMethod = true;
@ -506,7 +513,8 @@ get_object_typed(const char* path, acpi_object_type** _returnValue,
status_t
ns_handle_to_pathname(acpi_handle targetHandle, acpi_data *buffer)
{
status_t status = AcpiNsHandleToPathname(targetHandle, buffer);
status_t status = AcpiNsHandleToPathname(targetHandle,
(ACPI_BUFFER*)buffer);
return status == AE_OK ? B_OK : B_ERROR;
}
@ -545,6 +553,19 @@ evaluate_method(acpi_handle handle, const char* method,
}
status_t
get_irq_routing_table(acpi_handle busDeviceHandle, acpi_data *retBuffer)
{
ACPI_STATUS status;
status = AcpiGetIrqRoutingTable(busDeviceHandle, (ACPI_BUFFER*)retBuffer);
if (status == AE_BUFFER_OVERFLOW)
dprintf("evaluate_method: the passed buffer is too small!\n");
return status == AE_OK ? B_OK : B_ERROR;
}
static status_t
prepare_sleep_state(uint8 state, void (*wakeFunc)(void), size_t size)
{
@ -651,6 +672,7 @@ struct acpi_module_info gACPIModule = {
ns_handle_to_pathname,
evaluate_object,
evaluate_method,
get_irq_routing_table,
prepare_sleep_state,
enter_sleep_state,
reboot

View File

@ -111,6 +111,12 @@ typedef struct acpi_root_info {
acpi_object_type *returnValue, size_t bufferLength);
status_t (*evaluate_method)(acpi_handle handle, const char *method,
acpi_objects *args, acpi_data *returnValue);
/* Resource info */
status_t (*get_irq_routing_table)(acpi_handle busDeviceHandle,
acpi_data *retBuffer);
} acpi_root_info;
@ -170,6 +176,8 @@ status_t evaluate_object(const char* object, acpi_object_type *returnValue,
status_t evaluate_method(acpi_handle handle, const char *method,
acpi_objects *args, acpi_data *returnValue);
status_t get_irq_routing_table(acpi_handle busDeviceHandle,
acpi_data *retBuffer);
__END_DECLS
#endif /* __ACPI_PRIV_H__ */

View File

@ -774,11 +774,6 @@ AcpiOsExecute(ACPI_EXECUTE_TYPE type, ACPI_OSD_EXEC_CALLBACK function,
break;
}
*/
if (!gDPCHandle && gDPC->new_dpc_queue(&gDPCHandle, "acpi_task",
B_NORMAL_PRIORITY) != B_OK) {
DEBUG_FUNCTION_F("failed to create os execution queue\n");
return AE_ERROR;
}
if (gDPC->queue_dpc(gDPCHandle, function, context) != B_OK) {
DEBUG_FUNCTION_F("Serious failure in AcpiOsExecute! function: %p",