drivers/cpufreq/amd-pstate.c
Source file repositories/reference/linux-study-clean/drivers/cpufreq/amd-pstate.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/cpufreq/amd-pstate.c- Extension
.c- Size
- 63161 bytes
- Lines
- 2355
- Domain
- Driver Families
- Bucket
- drivers/cpufreq
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitfield.hlinux/kernel.hlinux/module.hlinux/init.hlinux/smp.hlinux/sched.hlinux/cpufreq.hlinux/compiler.hlinux/dmi.hlinux/slab.hlinux/acpi.hlinux/io.hlinux/delay.hlinux/uaccess.hlinux/power_supply.hlinux/static_call.hlinux/topology.hacpi/processor.hacpi/cppc_acpi.hasm/msr.hasm/processor.hasm/cpufeature.hasm/cpu_device_id.hamd-pstate.hamd-pstate-trace.h
Detected Declarations
struct quirk_entrystruct freq_attr_visibilityenum energy_perf_value_indexfunction freq_to_perffunction perf_to_freqfunction dmi_matched_7k62_bios_bugfunction get_mode_idx_from_strfunction msr_get_eppfunction amd_pstate_get_eppfunction shmem_get_eppfunction msr_update_perffunction amd_pstate_update_perffunction msr_set_eppfunction amd_pstate_set_eppfunction amd_pstate_set_floor_perffunction amd_pstate_init_floor_perffunction shmem_set_eppfunction msr_cppc_enablefunction shmem_cppc_enablefunction amd_pstate_cppc_enablefunction msr_init_perffunction shmem_init_perffunction amd_pstate_init_perffunction shmem_update_perffunction amd_pstate_samplefunction amd_pstate_updatefunction amd_pstate_verifyfunction amd_pstate_update_min_max_limitfunction amd_pstate_update_freqfunction amd_pstate_targetfunction amd_pstate_fast_switchfunction amd_pstate_adjust_perffunction amd_pstate_cpu_boost_updatefunction amd_pstate_set_boostfunction amd_pstate_init_boost_supportfunction amd_perf_ctl_resetfunction amd_pstate_init_prefcorefunction IS_ENABLEDfunction amd_pstate_update_limitsfunction amd_pstate_get_transition_delay_usfunction amd_pstate_get_transition_latencyfunction amd_pstate_init_freqfunction amd_pstate_cpu_initfunction amd_pstate_cpu_exitfunction amd_pstate_get_balanced_eppfunction amd_pstate_power_supply_notifierfunction amd_pstate_profile_probefunction amd_pstate_profile_get
Annotated Snippet
device_initcall(amd_pstate_init);
static int __init amd_pstate_param(char *str)
{
size_t size;
int mode_idx;
if (!str)
return -EINVAL;
size = strlen(str);
mode_idx = get_mode_idx_from_str(str, size);
return amd_pstate_set_driver(mode_idx);
}
static int __init amd_prefcore_param(char *str)
{
if (!strcmp(str, "disable"))
amd_pstate_prefcore = false;
return 0;
}
static int __init amd_dynamic_epp_param(char *str)
{
if (!strcmp(str, "disable"))
dynamic_epp = false;
if (!strcmp(str, "enable"))
dynamic_epp = true;
return 0;
}
early_param("amd_pstate", amd_pstate_param);
early_param("amd_prefcore", amd_prefcore_param);
early_param("amd_dynamic_epp", amd_dynamic_epp_param);
MODULE_AUTHOR("Huang Rui <ray.huang@amd.com>");
MODULE_DESCRIPTION("AMD Processor P-state Frequency Driver");
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/kernel.h`, `linux/module.h`, `linux/init.h`, `linux/smp.h`, `linux/sched.h`, `linux/cpufreq.h`, `linux/compiler.h`.
- Detected declarations: `struct quirk_entry`, `struct freq_attr_visibility`, `enum energy_perf_value_index`, `function freq_to_perf`, `function perf_to_freq`, `function dmi_matched_7k62_bios_bug`, `function get_mode_idx_from_str`, `function msr_get_epp`, `function amd_pstate_get_epp`, `function shmem_get_epp`.
- Atlas domain: Driver Families / drivers/cpufreq.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.