From cfb281bd72200c9b36ca986450a33c521baaf4e9 Mon Sep 17 00:00:00 2001 From: Fredrik Holmqvist Date: Sat, 26 Jun 2010 09:59:36 +0000 Subject: [PATCH] ACPI Module info for prepare_sleep_state, enter_sleep_state, reboot didn't look to be right. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37260 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/bus_managers/acpi/acpi_busman.c | 6 +- .../kernel/bus_managers/acpi/acpi_module.c | 4 ++ .../kernel/bus_managers/acpi/acpi_priv.h | 65 ++++++++++++------- 3 files changed, 47 insertions(+), 28 deletions(-) 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 c03ef0a8ff..f6baa4eb7a 100644 --- a/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c +++ b/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c @@ -566,7 +566,7 @@ get_irq_routing_table(acpi_handle busDeviceHandle, acpi_data *retBuffer) } -static status_t +status_t prepare_sleep_state(uint8 state, void (*wakeFunc)(void), size_t size) { ACPI_STATUS acpiStatus; @@ -605,7 +605,7 @@ prepare_sleep_state(uint8 state, void (*wakeFunc)(void), size_t size) } -static status_t +status_t enter_sleep_state(uint8 state) { ACPI_STATUS status; @@ -624,7 +624,7 @@ enter_sleep_state(uint8 state) } -static status_t +status_t reboot(void) { ACPI_STATUS status; 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 a55c86283e..bc3bb947e2 100644 --- a/src/add-ons/kernel/bus_managers/acpi/acpi_module.c +++ b/src/add-ons/kernel/bus_managers/acpi/acpi_module.c @@ -217,6 +217,10 @@ static struct acpi_root_info sACPIRootModule = { 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 0d78405e95..00cada3553 100644 --- a/src/add-ons/kernel/bus_managers/acpi/acpi_priv.h +++ b/src/add-ons/kernel/bus_managers/acpi/acpi_priv.h @@ -43,11 +43,12 @@ typedef struct acpi_device_cookie { typedef struct acpi_root_info { driver_module_info info; - status_t (*get_handle)(acpi_handle parent, char* pathname, - acpi_handle* retHandle); + status_t (*get_handle)(acpi_handle parent, char *pathname, + acpi_handle *retHandle); /* Global Lock */ - status_t (*acquire_global_lock)(uint16 timeout, uint32* handle); + + status_t (*acquire_global_lock)(uint16 timeout, uint32 *handle); status_t (*release_global_lock)(uint32 handle); /* Notify Handler */ @@ -65,60 +66,69 @@ typedef struct acpi_root_info { status_t (*set_gpe)(acpi_handle handle, uint32 gpeNumber, uint8 action); status_t (*install_gpe_handler)(acpi_handle handle, uint32 gpeNumber, - uint32 type, acpi_event_handler handler, void* data); + uint32 type, acpi_event_handler handler, void *data); status_t (*remove_gpe_handler)(acpi_handle handle, uint32 gpeNumber, acpi_event_handler address); /* Address Space Handler */ status_t (*install_address_space_handler)(acpi_handle handle, - uint32 spaceID, acpi_adr_space_handler handler, - acpi_adr_space_setup setup, void* data); + uint32 spaceId, + acpi_adr_space_handler handler, + acpi_adr_space_setup setup, void *data); status_t (*remove_address_space_handler)(acpi_handle handle, - uint32 spaceID, acpi_adr_space_handler handler); + uint32 spaceId, + acpi_adr_space_handler handler); /* Fixed Event Management */ void (*enable_fixed_event)(uint32 event); void (*disable_fixed_event)(uint32 event); - uint32 (*fixed_event_status)(uint32 event); + uint32 (*fixed_event_status) (uint32 event); /* Returns 1 if event set, 0 otherwise */ - void (*reset_fixed_event)(uint32 event); + void (*reset_fixed_event) (uint32 event); status_t (*install_fixed_event_handler)(uint32 event, - interrupt_handler* handler, void* data); + interrupt_handler *handler, void *data); status_t (*remove_fixed_event_handler)(uint32 event, - interrupt_handler* handler); + interrupt_handler *handler); /* Namespace Access */ - status_t (*get_next_entry)(uint32 object_type, const char* base, - char* result, size_t len, void** counter); - status_t (*get_device)(const char* hid, uint32 index, char* result, + status_t (*get_next_entry)(uint32 objectType, const char *base, + char *result, size_t length, void **_counter); + status_t (*get_device)(const char *hid, uint32 index, char *result, size_t resultLength); - status_t (*get_device_hid)(const char* path, char* hid, + status_t (*get_device_hid)(const char *path, char *hid, size_t hidLength); - uint32 (*get_object_type)(const char* path); - status_t (*get_object)(const char* path, - acpi_object_type** _returnValue); - status_t (*get_object_typed)(const char* path, - acpi_object_type** _returnValue, uint32 objectType); + uint32 (*get_object_type)(const char *path); + status_t (*get_object)(const char *path, + acpi_object_type **_returnValue); + status_t (*get_object_typed)(const char *path, + acpi_object_type **_returnValue, uint32 objectType); status_t (*ns_handle_to_pathname)(acpi_handle targetHandle, - acpi_data* buffer); + acpi_data *buffer); /* Control method execution and data acquisition */ status_t (*evaluate_object)(const char* object, - acpi_object_type* returnValue, size_t bufferLength); - status_t (*evaluate_method)(acpi_handle handle, const char* method, - acpi_objects* args, acpi_data* returnValue); + 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* returnValue); + acpi_data *retBuffer); + + /* Power state setting */ + + status_t (*prepare_sleep_state)(uint8 state, void (*wakeFunc)(void), + size_t size); + status_t (*enter_sleep_state)(uint8 state); + status_t (*reboot)(void); } acpi_root_info; @@ -183,6 +193,11 @@ status_t evaluate_method(acpi_handle handle, const char* method, status_t get_irq_routing_table(acpi_handle busDeviceHandle, acpi_data* returnValue); + +status_t prepare_sleep_state(uint8 state, void (*wakeFunc)(void), size_t size); +status_t enter_sleep_state(uint8 state); + +status_t reboot(void); __END_DECLS