Changeset View
Changeset View
Standalone View
Standalone View
sys/x86/cpufreq/hwpstate_amd.c
- This file was moved from sys/x86/cpufreq/hwpstate.c.
Context not available. | |||||
static int hwpstate_goto_pstate(device_t dev, int pstate_id); | static int hwpstate_goto_pstate(device_t dev, int pstate_id); | ||||
static int hwpstate_verbose; | static int hwpstate_verbose; | ||||
SYSCTL_INT(_debug, OID_AUTO, hwpstate_verbose, CTLFLAG_RWTUN, | SYSCTL_INT(_debug, OID_AUTO, hwpstate_amd_verbose, CTLFLAG_RWTUN, | ||||
&hwpstate_verbose, 0, "Debug hwpstate"); | &hwpstate_verbose, 0, "Debug hwpstate"); | ||||
static int hwpstate_verify; | static int hwpstate_verify; | ||||
SYSCTL_INT(_debug, OID_AUTO, hwpstate_verify, CTLFLAG_RWTUN, | SYSCTL_INT(_debug, OID_AUTO, hwpstate_amd_verify, CTLFLAG_RWTUN, | ||||
&hwpstate_verify, 0, "Verify P-state after setting"); | &hwpstate_verify, 0, "Verify P-state after setting"); | ||||
static device_method_t hwpstate_methods[] = { | static device_method_t hwpstate_methods[] = { | ||||
Context not available. | |||||
{0, 0} | {0, 0} | ||||
}; | }; | ||||
static devclass_t hwpstate_devclass; | static devclass_t hwpstate_amd_devclass; | ||||
static driver_t hwpstate_driver = { | static driver_t hwpstate_amd_driver = { | ||||
"hwpstate", | "hwpstate_amd", | ||||
jhb: You don't actually have to rename this driver FWIW. It's fine to have multiple drivers with… | |||||
Not Done Inline ActionsI don't object to naming different things differently. It can reduce confusion in reports / debugging. cem: I don't object to naming different things differently. It can reduce confusion in reports /… | |||||
hwpstate_methods, | hwpstate_methods, | ||||
sizeof(struct hwpstate_softc), | sizeof(struct hwpstate_softc), | ||||
}; | }; | ||||
DRIVER_MODULE(hwpstate, cpu, hwpstate_driver, hwpstate_devclass, 0, 0); | DRIVER_MODULE(hwpstate_amd, cpu, hwpstate_amd_driver, hwpstate_amd_devclass, 0, 0); | ||||
/* | /* | ||||
* Go to Px-state on all cpus considering the limit. | * Go to Px-state on all cpus considering the limit. | ||||
Context not available. | |||||
hwpstate_identify(driver_t *driver, device_t parent) | hwpstate_identify(driver_t *driver, device_t parent) | ||||
{ | { | ||||
if (device_find_child(parent, "hwpstate", -1) != NULL) | if (device_find_child(parent, "hwpstate_amd", -1) != NULL) | ||||
return; | return; | ||||
if (cpu_vendor_id != CPU_VENDOR_AMD || CPUID_TO_FAMILY(cpu_id) < 0x10) | if (cpu_vendor_id != CPU_VENDOR_AMD || CPUID_TO_FAMILY(cpu_id) < 0x10) | ||||
Context not available. | |||||
return; | return; | ||||
} | } | ||||
if (resource_disabled("hwpstate", 0)) | if (resource_disabled("hwpstate_amd", 0)) | ||||
return; | return; | ||||
Done Inline ActionsThis deserves a note in UPDATING. It might be worth just honoring the old name on both Intel and AMD hardware; I don't really see a downside. cem: This deserves a note in UPDATING. It might be worth just honoring the old name on both Intel… | |||||
Not Done Inline ActionsI would probably just leave the name as-is as well FWIW. jhb: I would probably just leave the name as-is as well FWIW. | |||||
if (BUS_ADD_CHILD(parent, 10, "hwpstate", -1) == NULL) | if (BUS_ADD_CHILD(parent, 10, "hwpstate_amd", -1) == NULL) | ||||
device_printf(parent, "hwpstate: add child failed\n"); | device_printf(parent, "hwpstate: add child failed\n"); | ||||
} | } | ||||
Context not available. |
You don't actually have to rename this driver FWIW. It's fine to have multiple drivers with the same name.