Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/acpica/acpi_cpu.c
Show First 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | |||||
static device_t acpi_cpu_add_child(device_t dev, u_int order, const char *name, | static device_t acpi_cpu_add_child(device_t dev, u_int order, const char *name, | ||||
int unit); | int unit); | ||||
static int acpi_cpu_read_ivar(device_t dev, device_t child, int index, | static int acpi_cpu_read_ivar(device_t dev, device_t child, int index, | ||||
uintptr_t *result); | uintptr_t *result); | ||||
static int acpi_cpu_shutdown(device_t dev); | static int acpi_cpu_shutdown(device_t dev); | ||||
static void acpi_cpu_cx_probe(struct acpi_cpu_softc *sc); | static void acpi_cpu_cx_probe(struct acpi_cpu_softc *sc); | ||||
static void acpi_cpu_generic_cx_probe(struct acpi_cpu_softc *sc); | static void acpi_cpu_generic_cx_probe(struct acpi_cpu_softc *sc); | ||||
static int acpi_cpu_cx_cst(struct acpi_cpu_softc *sc); | static int acpi_cpu_cx_cst(struct acpi_cpu_softc *sc); | ||||
static void acpi_cpu_startup(void *arg); | static void acpi_cpu_startup(void); | ||||
static void acpi_cpu_startup_cx(struct acpi_cpu_softc *sc); | static void acpi_cpu_startup_cx(struct acpi_cpu_softc *sc); | ||||
static void acpi_cpu_cx_list(struct acpi_cpu_softc *sc); | static void acpi_cpu_cx_list(struct acpi_cpu_softc *sc); | ||||
#if defined(__i386__) || defined(__amd64__) | #if defined(__i386__) || defined(__amd64__) | ||||
static void acpi_cpu_idle(sbintime_t sbt); | static void acpi_cpu_idle(sbintime_t sbt); | ||||
#endif | #endif | ||||
static void acpi_cpu_notify(ACPI_HANDLE h, UINT32 notify, void *context); | static void acpi_cpu_notify(ACPI_HANDLE h, UINT32 notify, void *context); | ||||
static void acpi_cpu_quirks(void); | static void acpi_cpu_quirks(void); | ||||
static void acpi_cpu_quirks_piix4(void); | static void acpi_cpu_quirks_piix4(void); | ||||
▲ Show 20 Lines • Show All 158 Lines • ▼ Show 20 Lines | acpi_cpu_attach(device_t dev) | ||||
cpu_cx_generic = FALSE; | cpu_cx_generic = FALSE; | ||||
/* Install hw.acpi.cpu sysctl tree */ | /* Install hw.acpi.cpu sysctl tree */ | ||||
acpi_sc = acpi_device_get_parent_softc(dev); | acpi_sc = acpi_device_get_parent_softc(dev); | ||||
sysctl_ctx_init(&cpu_sysctl_ctx); | sysctl_ctx_init(&cpu_sysctl_ctx); | ||||
cpu_sysctl_tree = SYSCTL_ADD_NODE(&cpu_sysctl_ctx, | cpu_sysctl_tree = SYSCTL_ADD_NODE(&cpu_sysctl_ctx, | ||||
SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), OID_AUTO, "cpu", | SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), OID_AUTO, "cpu", | ||||
CTLFLAG_RD, 0, "node for CPU children"); | CTLFLAG_RD, 0, "node for CPU children"); | ||||
/* Queue post cpu-probing task handler */ | |||||
AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_cpu_startup, NULL); | |||||
} | } | ||||
/* | /* | ||||
* Before calling any CPU methods, collect child driver feature hints | * Before calling any CPU methods, collect child driver feature hints | ||||
* and notify ACPI of them. We support unified SMP power control | * and notify ACPI of them. We support unified SMP power control | ||||
* so advertise this ourselves. Note this is not the same as independent | * so advertise this ourselves. Note this is not the same as independent | ||||
* SMP control where each CPU can have different settings. | * SMP control where each CPU can have different settings. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | acpi_cpu_postattach(void *unused __unused) | ||||
printf("devclass_get_devices(acpi_cpu_devclass) failed\n"); | printf("devclass_get_devices(acpi_cpu_devclass) failed\n"); | ||||
return; | return; | ||||
} | } | ||||
for (i = 0; i < n; i++) | for (i = 0; i < n; i++) | ||||
bus_generic_probe(devices[i]); | bus_generic_probe(devices[i]); | ||||
for (i = 0; i < n; i++) | for (i = 0; i < n; i++) | ||||
bus_generic_attach(devices[i]); | bus_generic_attach(devices[i]); | ||||
free(devices, M_TEMP); | free(devices, M_TEMP); | ||||
/* Run startup after all cpu is attached */ | |||||
acpi_cpu_startup(); | |||||
} | } | ||||
SYSINIT(acpi_cpu, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE, | SYSINIT(acpi_cpu, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE, | ||||
acpi_cpu_postattach, NULL); | acpi_cpu_postattach, NULL); | ||||
static void | static void | ||||
disable_idle(struct acpi_cpu_softc *sc) | disable_idle(struct acpi_cpu_softc *sc) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 484 Lines • ▼ Show 20 Lines | cx_ptr->trans_lat = 0; | ||||
return (0); | return (0); | ||||
} | } | ||||
/* | /* | ||||
* Call this *after* all CPUs have been attached. | * Call this *after* all CPUs have been attached. | ||||
*/ | */ | ||||
static void | static void | ||||
acpi_cpu_startup(void *arg) | acpi_cpu_startup(void) | ||||
{ | { | ||||
struct acpi_cpu_softc *sc; | struct acpi_cpu_softc *sc; | ||||
int i; | int i; | ||||
/* Get set of CPU devices */ | /* Get set of CPU devices */ | ||||
devclass_get_devices(acpi_cpu_devclass, &cpu_devices, &cpu_ndevices); | devclass_get_devices(acpi_cpu_devclass, &cpu_devices, &cpu_ndevices); | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 576 Lines • Show Last 20 Lines |