CPU_XCALL(9)

πŸ“¦ in nixpkgs unstable

πŸ’… 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 the xcall structure xc to call the function func with argument arg via future calls to cpu_xcall(). It's giving "set it up now, fire it later" energy. πŸŽ€
  • cpu_xcall() β€” dispatches a call to a function with an argument represented by xc on the CPU specified by the ci cpu_info structure. The same xc may be scheduled for execution on multiple CPUs concurrently. No cap. πŸ”₯
  • cpu_xcall_sync() β€” dispatches a call to the function func with argument arg on the CPU specified by the ci cpu_info structure, and waits for that function to complete. It may sleep waiting for the call to func to complete with wmesg as the wait message. 😴
  • XCALL_INITIALIZER() β€” initialises a xcall structure to call the function func with argument arg via future calls to cpu_xcall(). Iconic initializer behaviour, honestly. πŸ’…

🌈 CONTEXT 🌈

  • cpu_xcall_set() and cpu_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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms