arch/x86/kernel/acpi/cppc.c
Source file repositories/reference/linux-study-clean/arch/x86/kernel/acpi/cppc.c
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/kernel/acpi/cppc.c- Extension
.c- Size
- 7272 bytes
- Lines
- 299
- Domain
- Architecture Layer
- Bucket
- arch/x86
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitfield.hacpi/cppc_acpi.hasm/msr.hasm/processor.hasm/topology.h
Detected Declarations
enum amd_pref_corefunction cpc_supported_by_cpufunction cpc_ffh_supportedfunction cpc_read_ffhfunction cpc_write_ffhfunction amd_set_max_freq_ratiofunction init_freq_invariance_cppcfunction acpi_processor_init_invariance_cppcfunction amd_get_highest_perffunction amd_detect_prefcorefunction for_each_online_cpufunction amd_get_boost_ratio_numeratorexport amd_get_highest_perfexport amd_detect_prefcoreexport amd_get_boost_ratio_numerator
Annotated Snippet
switch (boot_cpu_data.x86_model) {
case 0x70 ... 0x7f:
*numerator = CPPC_HIGHEST_PERF_PERFORMANCE;
return 0;
default:
break;
}
}
/* detect if running on heterogeneous design */
if (cpu_feature_enabled(X86_FEATURE_AMD_HTR_CORES)) {
switch (core_type) {
case TOPO_CPU_TYPE_UNKNOWN:
pr_warn("Undefined core type found for cpu %d\n", cpu);
break;
case TOPO_CPU_TYPE_PERFORMANCE:
/* use the max scale for performance cores */
*numerator = CPPC_HIGHEST_PERF_PERFORMANCE;
return 0;
case TOPO_CPU_TYPE_EFFICIENCY:
/* use the highest perf value for efficiency cores */
ret = amd_get_highest_perf(cpu, &tmp);
if (ret)
return ret;
*numerator = tmp;
return 0;
}
}
*numerator = CPPC_HIGHEST_PERF_PREFCORE;
return 0;
}
EXPORT_SYMBOL_GPL(amd_get_boost_ratio_numerator);
Annotation
- Immediate include surface: `linux/bitfield.h`, `acpi/cppc_acpi.h`, `asm/msr.h`, `asm/processor.h`, `asm/topology.h`.
- Detected declarations: `enum amd_pref_core`, `function cpc_supported_by_cpu`, `function cpc_ffh_supported`, `function cpc_read_ffh`, `function cpc_write_ffh`, `function amd_set_max_freq_ratio`, `function init_freq_invariance_cppc`, `function acpi_processor_init_invariance_cppc`, `function amd_get_highest_perf`, `function amd_detect_prefcore`.
- Atlas domain: Architecture Layer / arch/x86.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.