Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144606954
D26602.1775718822.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D26602.1775718822.diff
View Options
Index: head/sys/dev/acpica/acpi.c
===================================================================
--- head/sys/dev/acpica/acpi.c
+++ head/sys/dev/acpica/acpi.c
@@ -2632,8 +2632,8 @@
return (AE_OK);
}
-UINT8
-acpi_DSMQuery(ACPI_HANDLE h, uint8_t *uuid, int revision)
+UINT64
+acpi_DSMQuery(ACPI_HANDLE h, const uint8_t *uuid, int revision)
{
/*
* ACPI spec 9.1.1 defines this.
@@ -2645,7 +2645,8 @@
*/
ACPI_BUFFER buf;
ACPI_OBJECT *obj;
- UINT8 ret = 0;
+ UINT64 ret = 0;
+ int i;
if (!ACPI_SUCCESS(acpi_EvaluateDSM(h, uuid, revision, 0, NULL, &buf))) {
ACPI_INFO(("Failed to enumerate DSM functions\n"));
@@ -2663,12 +2664,13 @@
*/
switch (obj->Type) {
case ACPI_TYPE_BUFFER:
- ret = *(uint8_t *)obj->Buffer.Pointer;
+ for (i = 0; i < MIN(obj->Buffer.Length, sizeof(ret)); i++)
+ ret |= (((uint64_t)obj->Buffer.Pointer[i]) << (i * 8));
break;
case ACPI_TYPE_INTEGER:
ACPI_BIOS_WARNING((AE_INFO,
"Possibly buggy BIOS with ACPI_TYPE_INTEGER for function enumeration\n"));
- ret = obj->Integer.Value & 0xFF;
+ ret = obj->Integer.Value;
break;
default:
ACPI_WARNING((AE_INFO, "Unexpected return type %u\n", obj->Type));
@@ -2684,9 +2686,18 @@
* check the type of the returned object.
*/
ACPI_STATUS
-acpi_EvaluateDSM(ACPI_HANDLE handle, uint8_t *uuid, int revision,
- uint64_t function, union acpi_object *package, ACPI_BUFFER *out_buf)
+acpi_EvaluateDSM(ACPI_HANDLE handle, const uint8_t *uuid, int revision,
+ UINT64 function, ACPI_OBJECT *package, ACPI_BUFFER *out_buf)
{
+ return (acpi_EvaluateDSMTyped(handle, uuid, revision, function,
+ package, out_buf, ACPI_TYPE_ANY));
+}
+
+ACPI_STATUS
+acpi_EvaluateDSMTyped(ACPI_HANDLE handle, const uint8_t *uuid, int revision,
+ UINT64 function, ACPI_OBJECT *package, ACPI_BUFFER *out_buf,
+ ACPI_OBJECT_TYPE type)
+{
ACPI_OBJECT arg[4];
ACPI_OBJECT_LIST arglist;
ACPI_BUFFER buf;
@@ -2697,7 +2708,7 @@
arg[0].Type = ACPI_TYPE_BUFFER;
arg[0].Buffer.Length = ACPI_UUID_LENGTH;
- arg[0].Buffer.Pointer = uuid;
+ arg[0].Buffer.Pointer = __DECONST(uint8_t *, uuid);
arg[1].Type = ACPI_TYPE_INTEGER;
arg[1].Integer.Value = revision;
arg[2].Type = ACPI_TYPE_INTEGER;
@@ -2714,7 +2725,7 @@
arglist.Count = 4;
buf.Pointer = NULL;
buf.Length = ACPI_ALLOCATE_BUFFER;
- status = AcpiEvaluateObject(handle, "_DSM", &arglist, &buf);
+ status = AcpiEvaluateObjectTyped(handle, "_DSM", &arglist, &buf, type);
if (ACPI_FAILURE(status))
return (status);
Index: head/sys/dev/acpica/acpivar.h
===================================================================
--- head/sys/dev/acpica/acpivar.h
+++ head/sys/dev/acpica/acpivar.h
@@ -349,10 +349,15 @@
ACPI_RESOURCE **resp);
ACPI_STATUS acpi_AppendBufferResource(ACPI_BUFFER *buf,
ACPI_RESOURCE *res);
-UINT8 acpi_DSMQuery(ACPI_HANDLE h, uint8_t *uuid, int revision);
-ACPI_STATUS acpi_EvaluateDSM(ACPI_HANDLE handle, uint8_t *uuid,
- int revision, uint64_t function, union acpi_object *package,
+UINT64 acpi_DSMQuery(ACPI_HANDLE h, const uint8_t *uuid,
+ int revision);
+ACPI_STATUS acpi_EvaluateDSM(ACPI_HANDLE handle, const uint8_t *uuid,
+ int revision, UINT64 function, ACPI_OBJECT *package,
ACPI_BUFFER *out_buf);
+ACPI_STATUS acpi_EvaluateDSMTyped(ACPI_HANDLE handle,
+ const uint8_t *uuid, int revision, UINT64 function,
+ ACPI_OBJECT *package, ACPI_BUFFER *out_buf,
+ ACPI_OBJECT_TYPE type);
ACPI_STATUS acpi_EvaluateOSC(ACPI_HANDLE handle, uint8_t *uuid,
int revision, int count, uint32_t *caps_in,
uint32_t *caps_out, bool query);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 9, 7:13 AM (14 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28307302
Default Alt Text
D26602.1775718822.diff (3 KB)
Attached To
Mode
D26602: acpi: Tweak _DSM method evaluation helpers.
Attached
Detach File
Event Timeline
Log In to Comment