include/linux/cpu.h
Source file repositories/reference/linux-study-clean/include/linux/cpu.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/cpu.h- Extension
.h- Size
- 7694 bytes
- Lines
- 237
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/node.hlinux/compiler.hlinux/cpuhotplug.hlinux/cpuhplock.hlinux/cpu_smt.h
Detected Declarations
struct devicestruct device_nodestruct attribute_groupstruct cpuenum cpu_attack_vectorsenum smt_mitigationsfunction cpu_maps_update_beginfunction arch_cpu_rescan_dead_smt_siblingsfunction suspend_disable_secondary_cpusfunction suspend_enable_secondary_cpusfunction thaw_secondary_cpusfunction suspend_enable_secondary_cpusfunction arch_cpu_finalize_initfunction cpuhp_report_idle_deadfunction cpu_mitigations_offfunction cpu_mitigations_auto_nosmtfunction cpu_attack_vector_mitigated
Annotated Snippet
extern const struct bus_type cpu_subsys;
#ifdef CONFIG_PM_SLEEP_SMP
extern int freeze_secondary_cpus(int primary);
extern void thaw_secondary_cpus(void);
static inline int suspend_disable_secondary_cpus(void)
{
int cpu = 0;
if (IS_ENABLED(CONFIG_PM_SLEEP_SMP_NONZERO_CPU))
cpu = -1;
return freeze_secondary_cpus(cpu);
}
static inline void suspend_enable_secondary_cpus(void)
{
thaw_secondary_cpus();
}
#else /* !CONFIG_PM_SLEEP_SMP */
static inline void thaw_secondary_cpus(void) {}
static inline int suspend_disable_secondary_cpus(void) { return 0; }
static inline void suspend_enable_secondary_cpus(void) { }
#endif /* !CONFIG_PM_SLEEP_SMP */
void __noreturn cpu_startup_entry(enum cpuhp_state state);
void cpu_idle_poll_ctrl(bool enable);
bool cpu_in_idle(unsigned long pc);
void arch_cpu_idle(void);
void arch_cpu_idle_prepare(void);
void arch_cpu_idle_enter(void);
void arch_cpu_idle_exit(void);
void arch_tick_broadcast_enter(void);
void arch_tick_broadcast_exit(void);
void __noreturn arch_cpu_idle_dead(void);
#ifdef CONFIG_ARCH_HAS_CPU_FINALIZE_INIT
void arch_cpu_finalize_init(void);
#else
static inline void arch_cpu_finalize_init(void) { }
#endif
void play_idle_precise(u64 duration_ns, u64 latency_ns);
#ifdef CONFIG_HOTPLUG_CPU
void cpuhp_report_idle_dead(void);
#else
static inline void cpuhp_report_idle_dead(void) { }
#endif /* #ifdef CONFIG_HOTPLUG_CPU */
enum cpu_attack_vectors {
CPU_MITIGATE_USER_KERNEL,
CPU_MITIGATE_USER_USER,
CPU_MITIGATE_GUEST_HOST,
CPU_MITIGATE_GUEST_GUEST,
NR_CPU_ATTACK_VECTORS,
};
enum smt_mitigations {
SMT_MITIGATIONS_OFF,
SMT_MITIGATIONS_AUTO,
SMT_MITIGATIONS_ON,
};
#ifdef CONFIG_CPU_MITIGATIONS
extern bool cpu_mitigations_off(void);
extern bool cpu_mitigations_auto_nosmt(void);
extern bool cpu_attack_vector_mitigated(enum cpu_attack_vectors v);
extern enum smt_mitigations smt_mitigations;
#else
static inline bool cpu_mitigations_off(void)
{
return true;
}
static inline bool cpu_mitigations_auto_nosmt(void)
{
return false;
}
static inline bool cpu_attack_vector_mitigated(enum cpu_attack_vectors v)
{
return false;
}
#define smt_mitigations SMT_MITIGATIONS_OFF
#endif
int arch_prctl_get_branch_landing_pad_state(struct task_struct *t, unsigned long __user *state);
Annotation
- Immediate include surface: `linux/node.h`, `linux/compiler.h`, `linux/cpuhotplug.h`, `linux/cpuhplock.h`, `linux/cpu_smt.h`.
- Detected declarations: `struct device`, `struct device_node`, `struct attribute_group`, `struct cpu`, `enum cpu_attack_vectors`, `enum smt_mitigations`, `function cpu_maps_update_begin`, `function arch_cpu_rescan_dead_smt_siblings`, `function suspend_disable_secondary_cpus`, `function suspend_enable_secondary_cpus`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: pattern 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.