diff options
author | jhb <jhb@FreeBSD.org> | 2016-04-20 20:55:58 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2016-04-20 20:55:58 +0000 |
commit | 11a5d8cc2127f8b70265561192e9e9691bf2f6ca (patch) | |
tree | 1935298b1cf4577c1f63960b13d9e14294411ba8 /sys/dev/acpica/acpi.c | |
parent | 499f728f9200eaa479527b7af379aabb3d5bf86d (diff) | |
download | FreeBSD-src-11a5d8cc2127f8b70265561192e9e9691bf2f6ca.zip FreeBSD-src-11a5d8cc2127f8b70265561192e9e9691bf2f6ca.tar.gz |
Add a wrapper for evaluating _OSC methods.
This wrapper does not translate errors in the first word to ACPI
error status returns. Use this wrapper in the acpi_cpu(4) driver in
place of the existing _OSC code. While here, fix a bug where the wrong
count of words was passed when invoking _OSC.
Reviewed by: jkim
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D6022
Diffstat (limited to 'sys/dev/acpica/acpi.c')
-rw-r--r-- | sys/dev/acpica/acpi.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 32a07dd..8539f2f 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -2480,6 +2480,29 @@ acpi_AppendBufferResource(ACPI_BUFFER *buf, ACPI_RESOURCE *res) return (AE_OK); } +ACPI_STATUS +acpi_EvaluateOSC(ACPI_HANDLE handle, uint8_t *uuid, int revision, int count, + uint32_t *caps, bool query) +{ + ACPI_OBJECT arg[4]; + ACPI_OBJECT_LIST arglist; + + arglist.Pointer = arg; + arglist.Count = 4; + arg[0].Type = ACPI_TYPE_BUFFER; + arg[0].Buffer.Length = ACPI_UUID_LENGTH; + arg[0].Buffer.Pointer = uuid; + arg[1].Type = ACPI_TYPE_INTEGER; + arg[1].Integer.Value = revision; + arg[2].Type = ACPI_TYPE_INTEGER; + arg[2].Integer.Value = count; + arg[3].Type = ACPI_TYPE_BUFFER; + arg[3].Buffer.Length = count * sizeof(uint32_t); + arg[3].Buffer.Pointer = (uint8_t *)caps; + caps[0] = query ? 1 : 0; + return (AcpiEvaluateObject(handle, "_OSC", &arglist, NULL)); +} + /* * Set interrupt model. */ |