diff --git a/headers/os/drivers/ACPI.h b/headers/os/drivers/ACPI.h index a208c59cbe..64f48f7b86 100644 --- a/headers/os/drivers/ACPI.h +++ b/headers/os/drivers/ACPI.h @@ -242,6 +242,8 @@ struct acpi_module_info { acpi_data *retBuffer); status_t (*get_possible_resources)(acpi_handle busDeviceHandle, acpi_data *retBuffer); + status_t (*set_current_resources)(acpi_handle busDeviceHandle, + acpi_data *buffer); /* Power state setting */ 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 a8031ed472..4b6186882b 100644 --- a/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c +++ b/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c @@ -625,6 +625,14 @@ get_possible_resources(acpi_handle busDeviceHandle, acpi_data *retBuffer) } +status_t +set_current_resources(acpi_handle busDeviceHandle, acpi_data *buffer) +{ + return AcpiSetCurrentResources(busDeviceHandle, (ACPI_BUFFER*)buffer) + == AE_OK ? B_OK : B_ERROR; +} + + status_t prepare_sleep_state(uint8 state, void (*wakeFunc)(void), size_t size) { @@ -741,6 +749,7 @@ struct acpi_module_info gACPIModule = { get_irq_routing_table, get_current_resources, get_possible_resources, + set_current_resources, prepare_sleep_state, enter_sleep_state, reboot diff --git a/src/add-ons/kernel/bus_managers/acpi/acpi_module.c b/src/add-ons/kernel/bus_managers/acpi/acpi_module.c index 3aad07f8a2..2d86f517a9 100644 --- a/src/add-ons/kernel/bus_managers/acpi/acpi_module.c +++ b/src/add-ons/kernel/bus_managers/acpi/acpi_module.c @@ -216,6 +216,7 @@ static struct acpi_root_info sACPIRootModule = { get_irq_routing_table, get_current_resources, get_possible_resources, + set_current_resources, 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 c68692736a..b8c723d5df 100644 --- a/src/add-ons/kernel/bus_managers/acpi/acpi_priv.h +++ b/src/add-ons/kernel/bus_managers/acpi/acpi_priv.h @@ -125,6 +125,8 @@ typedef struct acpi_root_info { acpi_data *retBuffer); status_t (*get_possible_resources)(acpi_handle busDeviceHandle, acpi_data *retBuffer); + status_t (*set_current_resources)(acpi_handle busDeviceHandle, + acpi_data *buffer); /* Power state setting */ @@ -200,6 +202,8 @@ status_t get_current_resources(acpi_handle busDeviceHandle, acpi_data* returnValue); status_t get_possible_resources(acpi_handle busDeviceHandle, acpi_data* returnValue); +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);