DEFINE_IDTENTRY(9)
β¨ 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:
DECLARE_IDTENTRY(9)DECLARE_IDTENTRY_ERRORCODE(9)DEFINE_IDTENTRY_ERRORCODE(9)DECLARE_IDTENTRY_RAW(9)DEFINE_IDTENTRY_RAW(9)DEFINE_FREDENTRY_RAW(9)DECLARE_IDTENTRY_RAW_ERRORCODE(9)DEFINE_IDTENTRY_RAW_ERRORCODE(9)DECLARE_IDTENTRY_IRQ(9)DEFINE_IDTENTRY_IRQ(9)DECLARE_IDTENTRY_SYSVEC(9)DEFINE_IDTENTRY_SYSVEC(9)DEFINE_IDTENTRY_SYSVEC_SIMPLE(9)DECLARE_IDTENTRY_XENCB(9)DECLARE_IDTENTRY_IST(9)DECLARE_IDTENTRY_VC(9)DEFINE_IDTENTRY_IST(9)DEFINE_IDTENTRY_NOIST(9)DECLARE_IDTENTRY_DF(9)DEFINE_IDTENTRY_DF(9)DECLARE_IDTENTRY_DF(9)DEFINE_IDTENTRY_DF(9)
(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 whenfuncruns, and theirqentry_enter/irqentry_exitbits 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
- 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