arch_exit_to...mode_prepare(9)
πΈ arch_exit_to_user_mode_prepare β Kernel API Manual β¨
okay so bestie, this is a <pink>Kernel API Manual</pink> page and it's honestly such a specific little vibe: it's the architecture-specific prep step for heading back out to user mode π«Ά lowkey one of those functions that's a no-op until your arch decides it has opinions.
π NAME π
arch_exit_to_user_mode_prepare β architecture specific preparation for exit to user mode. that's it, that's the whole job description, and she does it flawlessly π
β¨ SYNOPSIS β¨
void arch_exit_to_user_mode_prepare (struct pt_regs *regs , unsigned long ti_work );
π ARGUMENTS π
regsβ pointer to currentspt_regs. (yes, "currents" β that's literally what the page says, don't come for me, it's the kernel's own wording π) it's the register snapshot of the task that's about to bounce back to userspace π«ti_workβ cachedTIFflags, and the important bit: they were gathered with interrupts disabled. so this is a pre-chewed little snack of thread-info flags, no re-reading needed π₯
π DESCRIPTION π
so here's the tea β β this gets invoked from exit_to_user_mode_prepare with interrupts disabled, and it runs as the last function before return. main character energy fr, she's literally the final thing that happens before you go back to user mode π
and the plot twist? it defaults to NOOP. as in, does nothing. as in, no cap, the generic version is just vibes and a graceful exit π¦ arch code can override it with something real, but the baseline is a very polite nothing.
π¨ keep the interrupt-disabled context in mind, bestie β that's not a suggestion, that's the whole setting of this scene π
π¦ SEE ALSO π¦
the kernel file that's carrying this whole situation:
./include/linux/irq-entry-common.h
and the full friend group π«Ά (iykyk):
arch_enter_from_user_mode(9)arch_in_rcu_eqs(9)enter_from_user_mode(9)arch_exit_to_user_mode_work(9)arch_exit_to_user_mode(9)arch_do_signal_or_restart(9)__exit_to_user_mode_prepare(9)syscall_exit_to_user_mode_prepare(9)irqentry_exit_to_user_mode_prepare(9)exit_to_user_mode(9)irqentry_enter_from_user_mode(9)irqentry_exit_to_user_mode(9)struct irqentry_state(9)irqentry_enter_from_kernel_mode(9)irqentry_exit_to_kernel_mode_preempt(9)irqentry_exit_to_kernel_mode_after_preempt(9)irqentry_exit_to_kernel_mode(9)irqentry_enter(9)irqentry_exit(9)irqentry_nmi_enter(9)irqentry_nmi_exit(9)
like, that's the entire entry/exit cinematic universe and she's in all their group chats π
and that's the page, bestie π this little manual page lives under the source path ./include/linux, stamped October 2026, and it's filed under the section arch_exit_to...mode_prepare(9) β slay, go read the source, 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