arch/arm64/kernel/cpu_ops.c
Source file repositories/reference/linux-study-clean/arch/arm64/kernel/cpu_ops.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm64/kernel/cpu_ops.c- Extension
.c- Size
- 2641 bytes
- Lines
- 119
- Domain
- Architecture Layer
- Bucket
- arch/arm64
- Inferred role
- Architecture Layer: implementation source
- Status
- source 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/acpi.hlinux/cache.hlinux/errno.hlinux/of.hlinux/string.hasm/acpi.hasm/cpu_ops.hasm/smp_plat.h
Detected Declarations
function cpu_get_opsfunction cpu_read_enable_methodfunction init_cpu_ops
Annotated Snippet
if (!dn) {
if (!cpu)
pr_err("Failed to find device node for boot cpu\n");
return NULL;
}
enable_method = of_get_property(dn, "enable-method", NULL);
if (!enable_method) {
/*
* The boot CPU may not have an enable method (e.g.
* when spin-table is used for secondaries).
* Don't warn spuriously.
*/
if (cpu != 0)
pr_err("%pOF: missing enable-method property\n",
dn);
}
of_node_put(dn);
} else {
enable_method = acpi_get_enable_method(cpu);
if (!enable_method) {
/*
* In ACPI systems the boot CPU does not require
* checking the enable method since for some
* boot protocol (ie parking protocol) it need not
* be initialized. Don't warn spuriously.
*/
if (cpu != 0)
pr_err("Unsupported ACPI enable-method\n");
}
}
return enable_method;
}
/*
* Read a cpu's enable method and record it in cpu_ops.
*/
int __init init_cpu_ops(int cpu)
{
const char *enable_method = cpu_read_enable_method(cpu);
if (!enable_method)
return -ENODEV;
cpu_ops[cpu] = cpu_get_ops(enable_method);
if (!cpu_ops[cpu]) {
pr_warn("Unsupported enable-method: %s\n", enable_method);
return -EOPNOTSUPP;
}
return 0;
}
const struct cpu_operations *get_cpu_ops(int cpu)
{
return cpu_ops[cpu];
}
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/cache.h`, `linux/errno.h`, `linux/of.h`, `linux/string.h`, `asm/acpi.h`, `asm/cpu_ops.h`, `asm/smp_plat.h`.
- Detected declarations: `function cpu_get_ops`, `function cpu_read_enable_method`, `function init_cpu_ops`.
- Atlas domain: Architecture Layer / arch/arm64.
- Implementation status: source 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.