STRUCT X86_PLATFORM_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

struct x86_platform_ops(9) πŸ’…

Okay bestie, welcome to the Kernel API Manual ✨ β€” this page is literally about struct x86_platform_ops, and its whole thing is platform specific runtime functions. No cap, that's the NAME vibe. 🫢

🌸 NAME 🌸

struct x86_platform_ops β€” platform specific runtime functions. That's it, that's the tea: platform-specific runtime function slots, and they're kinda the main character energy of this struct. πŸ‘‘

πŸŽ€ SYNOPSIS πŸŽ€

Here's the struct itself, copied exactly because we do not mess with code, ever:

       struct x86_platform_ops {
           unsigned long (*calibrate_cpu)(void);
           unsigned long (*calibrate_tsc)(void);
           void (*get_wallclock)(struct timespec64 *ts);
           int (*set_wallclock)(const struct timespec64 *ts);
           void (*iommu_shutdown)(void);
           bool (*is_untracked_pat_range)(u64 start, u64 end);
           void (*nmi_init)(void);
           unsigned char (*get_nmi_reason)(void);
           void (*save_sched_clock_state)(void);
           void (*restore_sched_clock_state)(void);
           void (*apic_post_init)(void);
           struct x86_legacy_features legacy;
           void (*set_legacy_features)(void);
           void (*realmode_reserve)(void);
           void (*realmode_init)(void);
           struct x86_hyper_runtime hyper;
           struct x86_guest guest;
        };

πŸ‘‘ Members πŸ‘‘

These are all the struct members, in order, with their official job descriptions β€” translated into bestie-speak but keeping every fact. πŸ’œ

  • calibrate_cpu β€” calibrate CPU. Slay, that's the job.
  • calibrate_tsc β€” calibrate TSC, if different from CPU. Iykyk.
  • get_wallclock β€” get time from HW clock like RTC etc. Clock tea, secured. πŸ•°οΈ
  • set_wallclock β€” set time back to HW clock. Giving it back, periodt.
  • iommu_shutdown β€” set by an IOMMU driver for shutdown if necessary. Lowkey only when needed.
  • is_untracked_pat_range β€” exclude from PAT logic. Signature tea: bool (*is_untracked_pat_range)(u64 start, u64 end);
  • nmi_init β€” enable NMI on cpus. Plural cpus, exactly like that. ✨
  • get_nmi_reason β€” get the reason an NMI was received. Detective moment.
  • save_sched_clock_state β€” save state for sched_clock on suspend. Nap-time backup. 😴
  • restore_sched_clock_state β€” restore state for sched_clock on resume. Wake-up glow-up. πŸŒ…
  • apic_post_init β€” adjust apic if needed. Only if needed, bestie.
  • legacy β€” legacy features. Type: struct x86_legacy_features. The lore is stored here. πŸŽ€
  • set_legacy_features β€” override legacy features.
🚨 Big warning, bestie: use of this callback is highly discouraged. You should only need this if your hardware platform requires further custom fine tuning far beyond what may be possible in x86_early_init_platform_quirks by only using the current x86_hardware_subarch semantics. So yeah β€” not a casual vibe, it's the β€œyour hardware is literally special like that” situation. ⚠️
  • realmode_reserve β€” reserve memory for realmode trampoline. Reserving, not decorating.
  • realmode_init β€” initialize realmode trampoline. Init it, periodt.
  • hyper β€” x86 hypervisor specific runtime callbacks. Type: struct x86_hyper_runtime. Hypervisor gossip. πŸ’œ
  • guest β€” guest incarnations callbacks. Type: struct x86_guest. Guest-era main character energy. πŸ¦‹

🌈 SEE ALSO 🌈

The kernel file is ./arch/x86/include/asm/x86_init.h β€” and the whole SEE ALSO friend group is:

  • struct x86_init_mpparse(9)
  • struct x86_init_resources(9)
  • struct x86_init_irqs(9)
  • struct x86_init_oem(9)
  • struct x86_init_paging(9)
  • struct x86_init_timers(9)
  • struct x86_init_iommu(9)
  • struct x86_init_pci(9)
  • struct x86_hyper_init(9)
  • struct x86_init_acpi(9)
  • struct x86_guest(9)
  • struct x86_init_ops(9)
  • struct x86_cpuinit_ops(9)
  • struct x86_legacy_devices(9)
  • enum x86_legacy_i8042_state(9)
  • struct x86_legacy_features(9)
  • struct x86_hyper_runtime(9)

That's the page, bestie πŸ’– Footer tea: source ./arch/x86/include/asm, date October 2026, and the page title struct x86_platform_ops(9). Mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from