DEFINE_IDTENTRY(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ DEFINE_IDTENTRY ✨

okay so real talk, we're in the Kernel API Manual today bestie, and this one is a macro that literally emits code for simple IDT entry points πŸ‘‘


🌸 NAME 🌸

DEFINE_IDTENTRY β€” emit code for simple IDT entry points. that's it. that's the whole vibe. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

DEFINE_IDTENTRY (func );

copy it exactly, spacing and all, no cap πŸ’…


πŸ’– ARGUMENTS πŸ’–

  • func β€” the function name of the entry point. that's your main character, name it good 🫢

πŸ”₯ DESCRIPTION πŸ”₯

so func gets called from the ASM entry code, and here's the important part: it's called with interrupts disabled. like, off off. πŸ™ˆ

the macro is written so that it acts as a function definition β€” which means you don't close it out yourself, you just append the body with a pair of curly brackets. { }. iconic behavior honestly ✨

irqentry_enter contains common code that has to be invoked before arbitrary code in the body. and irqentry_exit contains common code that has to run before returning to the low level assembly code. so like… the macro wraps your little body in the good stuff automatically, you don't have to think about it 🧚


⭐ SEE ALSO ⭐

first up, the kernel file, right here: ./arch/x86/include/asm/idtentry.h πŸ“

and then the whole friend group, all of them, in order, fr fr:

(yes, DECLARE_IDTENTRY_DF(9) and DEFINE_IDTENTRY_DF(9) show up twice at the end. that's exactly how the page lists them and i'm not gonna gaslight you about it πŸ’€)


bestie reminder: interrupts are disabled when func runs, and the irqentry_enter / irqentry_exit bits are non-negotiable β€” that's the whole point of the macro doing the wrapping for you πŸ’œ

and that's the page!! πŸŽ€ this lil beauty lives in ./arch/x86/include/asm, dated October 2026, and it's page DEFINE_IDTENTRY(9) of the Kernel API Manual. mwah, go write some entry points πŸ’…πŸŒˆπŸ’–

πŸ“¦ where this page comes from