STRUCT X86_PLATFORM_OPS(9)
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 inx86_early_init_platform_quirksby only using the currentx86_hardware_subarchsemantics. 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms