CPU_XCALL(9)
π CPU_XCALL(9) β Kernel Developer's Manual, bestie β¨
β¨ NAME β¨
cpu_xcall_set, cpu_xcall, cpu_xcall_sync, XCALL_INITIALIZER β CPU crosscall API π
π¦ SYNOPSIS π¦
#include <sys/xcall.h>
void
cpu_xcall_set(struct xcall *xc, void (*func)(void *), void *arg);
void
cpu_xcall(struct cpu_info *ci, struct xcall *xc);
void
cpu_xcall_sync(struct cpu_info *ci, void (*func)(void *), void *arg,
const char *wmesg);
XCALL_INITIALIZER(void (*func)(void *), void *arg);
π DESCRIPTION π
okay so the CPU crosscall API supports the dispatch of function execution to a specific CPU in the kernel. That's the whole plot, and it slays. β¨ The functions are run in a software interrupt context at IPL_SOFTCLOCK.
Here's the function-by-function tea:
cpu_xcall_set()β prepares thexcallstructurexcto call the functionfuncwith argumentargvia future calls tocpu_xcall(). It's giving "set it up now, fire it later" energy. πcpu_xcall()β dispatches a call to a function with an argument represented byxcon the CPU specified by thecicpu_infostructure. The samexcmay be scheduled for execution on multiple CPUs concurrently. No cap. π₯cpu_xcall_sync()β dispatches a call to the functionfuncwith argumentargon the CPU specified by thecicpu_infostructure, and waits for that function to complete. It may sleep waiting for the call tofuncto complete withwmesgas the wait message. π΄XCALL_INITIALIZER()β initialises axcallstructure to call the functionfuncwith argumentargvia future calls tocpu_xcall(). Iconic initializer behaviour, honestly. π
π CONTEXT π
cpu_xcall_set()andcpu_xcall()can be called from process context or from interrupt context.cpu_xcall_sync()can be called from process context.
So yes bestie, context matters β that's the vibe check. π«Ά
π SEE ALSO π
π HISTORY π
The cpu_xcall_set functions first appeared in OpenBSD 7.8. π
π AUTHORS π
The cpu_xcall_set functions were written by David Gwynne <dlg@openbsd.org>. π«Ά
This page is from Debian, dated July 13, 2025, and it's titled CPU_XCALL(9) β mwah πβ¨
π¦ where this page comes from
- nixpkgs unstable: cvs-export
- Copyright (c) 2025 David Gwynne <dlg@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms