[haiku-commits] haiku: hrev47855 - src/add-ons/kernel/bus_managers/acpi headers/os/drivers

  • From: fredrik.holmqvist@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 14 Sep 2014 00:01:14 +0200 (CEST)

hrev47855 adds 1 changeset to branch 'master'
old head: e0881f2139195cfcb90251b5595f22e2faa5e5e4
new head: 3594baabf88289684adfb6ba9d5759c3b121593c
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=3594baa+%5Ee0881f2

----------------------------------------------------------------------------

3594baa: Add get_name and fix get_next_object.
  
  TODO: Need to add defines or enum for nameType.

                         [ Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev47855
Commit:      3594baabf88289684adfb6ba9d5759c3b121593c
URL:         http://cgit.haiku-os.org/haiku/commit/?id=3594baa
Author:      Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Date:        Sat Sep 13 21:59:31 2014 UTC

----------------------------------------------------------------------------

4 files changed, 20 insertions(+)
headers/os/drivers/ACPI.h                           |  2 ++
src/add-ons/kernel/bus_managers/acpi/ACPIPrivate.h  |  6 ++++++
src/add-ons/kernel/bus_managers/acpi/BusManager.cpp | 10 ++++++++++
src/add-ons/kernel/bus_managers/acpi/Module.cpp     |  2 ++

----------------------------------------------------------------------------

diff --git a/headers/os/drivers/ACPI.h b/headers/os/drivers/ACPI.h
index 2a50b99..7aad6cb 100644
--- a/headers/os/drivers/ACPI.h
+++ b/headers/os/drivers/ACPI.h
@@ -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 */
 
diff --git a/src/add-ons/kernel/bus_managers/acpi/ACPIPrivate.h 
b/src/add-ons/kernel/bus_managers/acpi/ACPIPrivate.h
index 6a4c7bb..f0071c6 100644
--- a/src/add-ons/kernel/bus_managers/acpi/ACPIPrivate.h
+++ b/src/add-ons/kernel/bus_managers/acpi/ACPIPrivate.h
@@ -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);
diff --git a/src/add-ons/kernel/bus_managers/acpi/BusManager.cpp 
b/src/add-ons/kernel/bus_managers/acpi/BusManager.cpp
index 5dcf9fc..79a4828 100644
--- a/src/add-ons/kernel/bus_managers/acpi/BusManager.cpp
+++ b/src/add-ons/kernel/bus_managers/acpi/BusManager.cpp
@@ -311,6 +311,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)
 {
        return AcpiAcquireGlobalLock(timeout, (UINT32*)handle) == AE_OK
@@ -818,6 +827,7 @@ struct acpi_module_info gACPIModule = {
        },
 
        get_handle,
+       get_name,
        acquire_global_lock,
        release_global_lock,
        install_notify_handler,
diff --git a/src/add-ons/kernel/bus_managers/acpi/Module.cpp 
b/src/add-ons/kernel/bus_managers/acpi/Module.cpp
index 244311b..82f6c7a 100644
--- a/src/add-ons/kernel/bus_managers/acpi/Module.cpp
+++ b/src/add-ons/kernel/bus_managers/acpi/Module.cpp
@@ -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,


Other related posts:

  • » [haiku-commits] haiku: hrev47855 - src/add-ons/kernel/bus_managers/acpi headers/os/drivers - fredrik . holmqvist