Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145003920
D6022.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D6022.diff
View Options
Index: head/sys/dev/acpica/acpi.c
===================================================================
--- head/sys/dev/acpica/acpi.c
+++ head/sys/dev/acpica/acpi.c
@@ -2480,6 +2480,29 @@
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.
*/
Index: head/sys/dev/acpica/acpi_cpu.c
===================================================================
--- head/sys/dev/acpica/acpi_cpu.c
+++ head/sys/dev/acpica/acpi_cpu.c
@@ -296,7 +296,7 @@
acpi_cpu_attach(device_t dev)
{
ACPI_BUFFER buf;
- ACPI_OBJECT arg[4], *obj;
+ ACPI_OBJECT arg[1], *obj;
ACPI_OBJECT_LIST arglist;
struct pcpu *pcpu_data;
struct acpi_cpu_softc *sc;
@@ -391,21 +391,9 @@
* Intel Processor Vendor-Specific ACPI Interface Specification.
*/
if (sc->cpu_features) {
- arglist.Pointer = arg;
- arglist.Count = 4;
- arg[0].Type = ACPI_TYPE_BUFFER;
- arg[0].Buffer.Length = sizeof(cpu_oscuuid);
- arg[0].Buffer.Pointer = cpu_oscuuid; /* UUID */
- arg[1].Type = ACPI_TYPE_INTEGER;
- arg[1].Integer.Value = 1; /* revision */
- arg[2].Type = ACPI_TYPE_INTEGER;
- arg[2].Integer.Value = 1; /* count */
- arg[3].Type = ACPI_TYPE_BUFFER;
- arg[3].Buffer.Length = sizeof(cap_set); /* Capabilities buffer */
- arg[3].Buffer.Pointer = (uint8_t *)cap_set;
- cap_set[0] = 0; /* status */
cap_set[1] = sc->cpu_features;
- status = AcpiEvaluateObject(sc->cpu_handle, "_OSC", &arglist, NULL);
+ status = acpi_EvaluateOSC(sc->cpu_handle, cpu_oscuuid, 1, 2, cap_set,
+ false);
if (ACPI_SUCCESS(status)) {
if (cap_set[0] != 0)
device_printf(dev, "_OSC returned status %#x\n", cap_set[0]);
Index: head/sys/dev/acpica/acpivar.h
===================================================================
--- head/sys/dev/acpica/acpivar.h
+++ head/sys/dev/acpica/acpivar.h
@@ -335,6 +335,8 @@
ACPI_RESOURCE **resp);
ACPI_STATUS acpi_AppendBufferResource(ACPI_BUFFER *buf,
ACPI_RESOURCE *res);
+ACPI_STATUS acpi_EvaluateOSC(ACPI_HANDLE handle, uint8_t *uuid,
+ int revision, int count, uint32_t *caps, bool query);
ACPI_STATUS acpi_OverrideInterruptLevel(UINT32 InterruptNumber);
ACPI_STATUS acpi_SetIntrModel(int model);
int acpi_ReqSleepState(struct acpi_softc *sc, int state);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 15, 11:01 PM (15 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28759102
Default Alt Text
D6022.diff (2 KB)
Attached To
Mode
D6022: Add a wrapper for evaluating _OSC methods.
Attached
Detach File
Event Timeline
Log In to Comment