summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/acpi_package.c
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2004-04-09 06:40:03 +0000
committernjl <njl@FreeBSD.org>2004-04-09 06:40:03 +0000
commitfdef51d350162407b1fd7503b09214a6d4201b40 (patch)
treec67ca9eed3ef6080288b20a150a2891329627e30 /sys/dev/acpica/acpi_package.c
parent34d7e07971263d7e996c84f5971b079f7f476f37 (diff)
downloadFreeBSD-src-fdef51d350162407b1fd7503b09214a6d4201b40.zip
FreeBSD-src-fdef51d350162407b1fd7503b09214a6d4201b40.tar.gz
Add support for packages as the first element of _PRW. This may allow
some machines to enable wake events for more devices although I haven't seen a system yet that uses this form. Also, introduce acpi_GetReference() which retrieves an object reference from various types.
Diffstat (limited to 'sys/dev/acpica/acpi_package.c')
-rw-r--r--sys/dev/acpica/acpi_package.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/sys/dev/acpica/acpi_package.c b/sys/dev/acpica/acpi_package.c
index 0011308..41f7581 100644
--- a/sys/dev/acpica/acpi_package.c
+++ b/sys/dev/acpica/acpi_package.c
@@ -123,3 +123,34 @@ acpi_PkgGas(device_t dev, ACPI_OBJECT *res, int idx, int *rid,
return (0);
}
+
+ACPI_HANDLE
+acpi_GetReference(ACPI_HANDLE scope, ACPI_OBJECT *obj)
+{
+ ACPI_HANDLE h;
+
+ if (obj == NULL)
+ return (NULL);
+
+ switch (obj->Type) {
+ case ACPI_TYPE_LOCAL_REFERENCE:
+ case ACPI_TYPE_ANY:
+ h = obj->Reference.Handle;
+ break;
+ case ACPI_TYPE_STRING:
+ /*
+ * The String object usually contains a fully-qualified path, so
+ * scope can be NULL.
+ *
+ * XXX This may not always be the case.
+ */
+ if (ACPI_FAILURE(AcpiGetHandle(scope, obj->String.Pointer, &h)))
+ h = NULL;
+ break;
+ default:
+ h = NULL;
+ break;
+ }
+
+ return (h);
+}
OpenPOWER on IntegriCloud