summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>2001-07-07 10:20:17 +0000
committermsmith <msmith@FreeBSD.org>2001-07-07 10:20:17 +0000
commita9dfae497adb601087b346f63456c2b1f750b3a4 (patch)
treef0ff40d0b4c8a31f44b05449aad545d46e4f338b /sys/dev
parent6f330cc07941e844b925345043ef3ac7c44595c7 (diff)
downloadFreeBSD-src-a9dfae497adb601087b346f63456c2b1f750b3a4.zip
FreeBSD-src-a9dfae497adb601087b346f63456c2b1f750b3a4.tar.gz
Add acpi_GetTableIntoBuffer, to aid in fetching tables.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpica/acpi.c27
-rw-r--r--sys/dev/acpica/acpivar.h1
2 files changed, 25 insertions, 3 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index 0744d22..7edb687 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -574,14 +574,14 @@ acpi_release_resource(device_t bus, device_t child, int type, int rid, struct re
/*
* Scan relevant portions of the ACPI namespace and attach child devices.
*
- * Note that we only expect to find devices in the \_TZ_, \_SI_ and \_SB_ scopes,
- * and \_TZ_ becomes obsolete in the ACPI 2.0 spec.
+ * Note that we only expect to find devices in the \_PR_, \_TZ_, \_SI_ and \_SB_ scopes,
+ * and \_PR_ and \_TZ_ become obsolete in the ACPI 2.0 spec.
*/
static void
acpi_probe_children(device_t bus)
{
ACPI_HANDLE parent;
- static char *scopes[] = {"\\_TZ_", "\\_SI", "\\_SB_", NULL};
+ static char *scopes[] = {"\\_PR_", "\\_TZ_", "\\_SI", "\\_SB_", NULL};
int i;
FUNCTION_TRACE(__func__);
@@ -840,6 +840,27 @@ acpi_GetIntoBuffer(ACPI_HANDLE handle, ACPI_STATUS (*func)(ACPI_HANDLE, ACPI_BUF
}
/*
+ * Perform the tedious double-get procedure required for fetching a table into
+ * an ACPI_BUFFER that has not been initialised.
+ */
+ACPI_STATUS
+acpi_GetTableIntoBuffer(ACPI_TABLE_TYPE table, UINT32 instance, ACPI_BUFFER *buf)
+{
+ ACPI_STATUS status;
+
+ ACPI_ASSERTLOCK;
+
+ buf->Length = 0;
+ buf->Pointer = NULL;
+
+ if ((status = AcpiGetTable(table, instance, buf)) != AE_BUFFER_OVERFLOW)
+ return(status);
+ if ((buf->Pointer = AcpiOsCallocate(buf->Length)) == NULL)
+ return(AE_NO_MEMORY);
+ return(AcpiGetTable(table, instance, buf));
+}
+
+/*
* Perform the tedious double-evaluate procedure for evaluating something into
* an ACPI_BUFFER that has not been initialised. Note that this evaluates
* twice, so avoid applying this to things that may have side-effects.
diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h
index c2bf1af..a8bc37b 100644
--- a/sys/dev/acpica/acpivar.h
+++ b/sys/dev/acpica/acpivar.h
@@ -191,6 +191,7 @@ extern ACPI_BUFFER *acpi_AllocBuffer(int size);
extern ACPI_STATUS acpi_GetIntoBuffer(ACPI_HANDLE handle,
ACPI_STATUS (*func)(ACPI_HANDLE, ACPI_BUFFER *),
ACPI_BUFFER *buf);
+extern ACPI_STATUS acpi_GetTableIntoBuffer(ACPI_TABLE_TYPE table, UINT32 instance, ACPI_BUFFER *buf);
extern ACPI_STATUS acpi_EvaluateIntoBuffer(ACPI_HANDLE object, ACPI_STRING pathname,
ACPI_OBJECT_LIST *params, ACPI_BUFFER *buf);
extern ACPI_STATUS acpi_EvaluateInteger(ACPI_HANDLE handle, char *path, int *number);
OpenPOWER on IntegriCloud