Add function to walk through children.
Without losing my sanity that is. ACPI API refactoring will happen some day.
This commit is contained in:
@@ -236,6 +236,8 @@ struct acpi_module_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);
|
||||
|
||||
|
||||
@@ -202,6 +202,8 @@ status_t remove_fixed_event_handler(uint32 event, acpi_event_handler handler);
|
||||
|
||||
status_t get_next_entry(uint32 object_type, const char* base, char* result,
|
||||
size_t length, void** _counter);
|
||||
status_t get_next_object(uint32 object_type, acpi_handle parent,
|
||||
acpi_handle* currentChild);
|
||||
status_t get_device(const char* hid, uint32 index, char* result,
|
||||
size_t resultLength);
|
||||
|
||||
|
||||
@@ -505,6 +505,16 @@ get_next_entry(uint32 objectType, const char *base, char *result,
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
get_next_object(uint32 objectType, acpi_handle parent,
|
||||
acpi_handle* currentChild)
|
||||
{
|
||||
acpi_handle child = *currentChild;
|
||||
return AcpiGetNextObject(objectType, parent, child, currentChild) == AE_OK ?
|
||||
B_OK : B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
get_device(const char* hid, uint32 index, char* result, size_t resultLength)
|
||||
{
|
||||
@@ -829,6 +839,7 @@ struct acpi_module_info gACPIModule = {
|
||||
install_fixed_event_handler,
|
||||
remove_fixed_event_handler,
|
||||
get_next_entry,
|
||||
get_next_object,
|
||||
get_device,
|
||||
get_device_hid,
|
||||
get_object_type,
|
||||
|
||||
Reference in New Issue
Block a user