mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-18 10:35:55 +00:00
Add acpi_GetTableIntoBuffer, to aid in fetching tables.
This commit is contained in:
parent
db302f9945
commit
7d3bcec9fb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=79387
@ -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__);
|
||||
@ -839,6 +839,27 @@ acpi_GetIntoBuffer(ACPI_HANDLE handle, ACPI_STATUS (*func)(ACPI_HANDLE, ACPI_BUF
|
||||
return(func(handle, 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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user