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 d2b022ae79..6f3779adfd 100644 --- a/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c +++ b/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c @@ -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 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 c997341501..94e15260da 100644 --- a/src/add-ons/kernel/bus_managers/acpi/acpi_priv.h +++ b/src/add-ons/kernel/bus_managers/acpi/acpi_priv.h @@ -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__ */ diff --git a/src/add-ons/kernel/bus_managers/acpi/oshaiku.c b/src/add-ons/kernel/bus_managers/acpi/oshaiku.c index a6f55660b6..5fe2c3e71d 100644 --- a/src/add-ons/kernel/bus_managers/acpi/oshaiku.c +++ b/src/add-ons/kernel/bus_managers/acpi/oshaiku.c @@ -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",