arch_exit_to...mode_prepare(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 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 currents pt_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 β€” cached TIF flags, 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):

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