Bug #557 » acpi-test.diff
| acpi_cpu.c 20 Feb 2007 21:56:45 -0000 | ||
|---|---|---|
|
/* Get our Processor object. */
|
||
|
buf.Pointer = NULL;
|
||
|
buf.Length = ACPI_ALLOCATE_BUFFER;
|
||
|
kprintf("HERE: %s:%d\n", __func__, __LINE__);
|
||
|
status = AcpiEvaluateObject(handle, NULL, NULL, &buf);
|
||
|
if (ACPI_FAILURE(status)) {
|
||
|
device_printf(dev, "probe failed to get Processor obj - %s\n",
|
||
| ... | ... | |
|
AcpiOsFree(obj);
|
||
|
return (ENXIO);
|
||
|
}
|
||
|
kprintf("HERE: %s:%d\n", __func__, __LINE__);
|
||
|
/*
|
||
|
* Find the processor associated with our unit. We could use the
|
||
| ... | ... | |
|
if (acpi_pcpu_get_id(device_get_unit(dev), &acpi_id, &cpu_id) != 0)
|
||
|
return (ENXIO);
|
||
|
kprintf("HERE: %s:%d\n", __func__, __LINE__);
|
||
|
/*
|
||
|
* Check if we already probed this processor. We scan the bus twice
|
||
|
* so it's possible we've already seen this one.
|
||
| ... | ... | |
|
buf.Pointer = NULL;
|
||
|
buf.Length = ACPI_ALLOCATE_BUFFER;
|
||
|
status = AcpiEvaluateObject(handle, "_CST", NULL, &buf);
|
||
|
kprintf("HERE: %s:%d\n", __func__, __LINE__);
|
||
|
if (ACPI_SUCCESS(status)) {
|
||
|
obj = (ACPI_OBJECT *)buf.Pointer;
|
||
|
if (ACPI_PKG_VALID(obj, 2))
|
||
| ... | ... | |
|
sc->cpu_handle = acpi_get_handle(dev);
|
||
|
cpu_softc[acpi_get_magic(dev)] = sc;
|
||
|
kprintf("HERE: %s:%d\n", __func__, __LINE__);
|
||
|
buf.Pointer = NULL;
|
||
|
buf.Length = ACPI_ALLOCATE_BUFFER;
|
||
|
status = AcpiEvaluateObject(sc->cpu_handle, NULL, NULL, &buf);
|
||
| ... | ... | |
|
SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree),
|
||
|
OID_AUTO, "cpu", CTLFLAG_RD, 0, "");
|
||
|
kprintf("HERE: %s:%d\n", __func__, __LINE__);
|
||
|
/* If this is the first device probed, check for quirks. */
|
||
|
if (device_get_unit(dev) == 0)
|
||
|
acpi_cpu_quirks(sc);
|
||
| ... | ... | |
|
* Probe for throttling and Cx state support.
|
||
|
* If none of these is present, free up unused resources.
|
||
|
*/
|
||
|
kprintf("HERE: %s:%d\n", __func__, __LINE__);
|
||
|
thr_ret = acpi_cpu_throttle_probe(sc);
|
||
|
kprintf("HERE: %s:%d\n", __func__, __LINE__);
|
||
|
cx_ret = acpi_cpu_cx_probe(sc);
|
||
|
if (thr_ret == 0 || cx_ret == 0) {
|
||
|
kprintf("HERE: %s:%d\n", __func__, __LINE__);
|
||
|
status = AcpiInstallNotifyHandler(sc->cpu_handle, ACPI_DEVICE_NOTIFY,
|
||
|
acpi_cpu_notify, sc);
|
||
|
kprintf("HERE: %s:%d\n", __func__, __LINE__);
|
||
|
if (device_get_unit(dev) == 0)
|
||
|
AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_cpu_startup, NULL);
|
||
|
} else {
|
||