STRUCT CPU_OPERATIONS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct cpu_operations(9) πŸ’…

okay so this is the Kernel API Manual page for struct cpu_operations(9), and we're literally about to make CPU hotplug callbacks make sense. bestie, no cap 🫢


✨ NAME ✨

struct cpu_operations β€” callback operations for hotplugging CPUs. πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

here's the struct exactly as it shows up β€” yes, even those semicolons after #ifdef and #endif, they're literally in there πŸ‘€

struct cpu_operations {
    int (*cpu_start)(unsigned int cpu, struct task_struct *tidle);
  #ifdef CONFIG_HOTPLUG_CPU;
    void (*cpu_stop)(void);
    bool (*cpu_is_stopped)(unsigned int cpu);
  #endif;
 };

πŸ‘― Members πŸ‘―

  • cpu_start β€” boots a cpu into the kernel. iconic behavior, honestly πŸ”₯
  • cpu_stop β€” makes a cpu leave the kernel. must not fail β€” like, it is not allowed to fail, periodt πŸ’… and it's called from the cpu being stopped.
  • cpu_is_stopped β€” ensures a cpu has left the kernel. called from another cpu. vibe check complete πŸ¦‹

🌈 SEE ALSO 🌈

  • Kernel file ./arch/riscv/include/asm/cpu_ops.h β€” go read the kernel file bestie, iykyk πŸ“–

this page is from ./arch/riscv/include/asm and it's dated October 2026. mwah πŸ’‹ stay slaying those cpu ops ✨🫢

πŸ“¦ where this page comes from