Add get_name and fix get_next_object.

TODO: Need to add defines or enum for nameType.
This commit is contained in:
Fredrik Holmqvist
2014-09-14 00:01:10 +02:00
parent e0881f2139
commit 3594baabf8
4 changed files with 20 additions and 0 deletions
+2
View File
@@ -180,6 +180,8 @@ struct acpi_module_info {
status_t (*get_handle)(acpi_handle parent, const char *pathname,
acpi_handle *retHandle);
status_t (*get_name)(acpi_handle handle, uint32 nameType,
char* returnedName, size_t bufferLength);
/* Global Lock */
@@ -50,6 +50,8 @@ typedef struct acpi_root_info {
status_t (*get_handle)(acpi_handle parent, const char *pathname,
acpi_handle *retHandle);
status_t (*get_name)(acpi_handle handle, uint32 nameType,
char* returnedName, size_t bufferLength);
/* Global Lock */
@@ -105,6 +107,8 @@ typedef struct acpi_root_info {
status_t (*get_next_entry)(uint32 objectType, const char *base,
char *result, size_t length, void **_counter);
status_t (*get_next_object)(uint32 objectType, acpi_handle parent,
acpi_handle* currentChild);
status_t (*get_device)(const char *hid, uint32 index, char *result,
size_t resultLength);
@@ -165,6 +169,8 @@ extern acpi_device_module_info gACPIDeviceModule;
status_t get_handle(acpi_handle parent, const char* pathname,
acpi_handle* retHandle);
status_t get_name(acpi_handle handle, uint32 nameType,
char* returnedName, size_t bufferLength);
status_t acquire_global_lock(uint16 timeout, uint32* handle);
status_t release_global_lock(uint32 handle);
@@ -310,6 +310,15 @@ get_handle(acpi_handle parent, const char *pathname, acpi_handle *retHandle)
}
status_t
get_name(acpi_handle handle, uint32 nameType, char* returnedName,
size_t bufferLength)
{
ACPI_BUFFER buffer = {bufferLength, (void*)returnedName};
return AcpiGetName(handle, nameType, &buffer) == AE_OK ? B_OK : B_ERROR;
}
status_t
acquire_global_lock(uint16 timeout, uint32 *handle)
{
@@ -818,6 +827,7 @@ struct acpi_module_info gACPIModule = {
},
get_handle,
get_name,
acquire_global_lock,
release_global_lock,
install_notify_handler,
@@ -229,6 +229,7 @@ static struct acpi_root_info sACPIRootModule = {
},
get_handle,
get_name,
acquire_global_lock,
release_global_lock,
install_notify_handler,
@@ -250,6 +251,7 @@ static struct acpi_root_info sACPIRootModule = {
install_fixed_event_handler,
remove_fixed_event_handler,
get_next_entry,
get_next_object,
get_device,
get_device_hid,
get_object_type,