Project

General

Profile

Bug #557 » acpi-test-4.diff

qhwt+dfly, 03/06/2007 12:42 PM

View differences:

acpi_cpu.c 4 Mar 2007 16:51:20 -0000
DRIVER_MODULE(cpu, acpi, acpi_cpu_driver, acpi_cpu_devclass, 0, 0);
MODULE_DEPEND(cpu, acpi, 1, 1, 1);
static int acpi_cpu_probe_debug_knob = 0;
TUNABLE_INT("debug.acpi.cpu.knob", &acpi_cpu_probe_debug_knob);
#define DEBUG_KNOB(n) \
if (acpi_cpu_probe_debug_knob == (n)) return(ENXIO)
static int
acpi_cpu_probe(device_t dev)
{
int acpi_id, cpu_id, cx_count;
int acpi_id, cpu_id, proc_id, cx_count;
ACPI_BUFFER buf;
ACPI_HANDLE handle;
char msg[32];
......
* ProcId as a key, however, some boxes do not have the same values
* in their Processor object as the ProcId values in the MADT.
*/
acpi_id = obj->Processor.ProcId;
acpi_id = proc_id = obj->Processor.ProcId;
AcpiOsFree(obj);
if (acpi_pcpu_get_id(device_get_unit(dev), &acpi_id, &cpu_id) != 0)
if (acpi_pcpu_get_id(device_get_unit(dev), &acpi_id, &cpu_id) != 0) {
if (bootverbose)
device_printf(dev, "ProcId %d: can't find cpu_id\n", proc_id);
return (ENXIO);
}
if (bootverbose) {
device_printf(dev, "ProcId %d: acpi_id=%d, cpu_id=%d\n", proc_id,
acpi_id, cpu_id);
}
/*
* Check if we already probed this processor. We scan the bus twice
* so it's possible we've already seen this one.
......
* Probe for throttling and Cx state support.
* If none of these is present, free up unused resources.
*/
DEBUG_KNOB(1);
thr_ret = acpi_cpu_throttle_probe(sc);
DEBUG_KNOB(2);
cx_ret = acpi_cpu_cx_probe(sc);
DEBUG_KNOB(3);
if (thr_ret == 0 || cx_ret == 0) {
status = AcpiInstallNotifyHandler(sc->cpu_handle, ACPI_DEVICE_NOTIFY,
acpi_cpu_notify, sc);
DEBUG_KNOB(4);
if (device_get_unit(dev) == 0)
AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_cpu_startup, NULL);
} else {
sysctl_ctx_free(&acpi_cpu_sysctl_ctx);
}
DEBUG_KNOB(5);
return_VALUE (0);
}
#undef DEBUG_KNOB
/*
* Find the nth present CPU and return its pc_cpuid as well as set the
(8-8/8)