for_each_insn_prefix(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ for_each_insn_prefix(9) ✨

okay so bestie, this page is from the Kernel API Manual, and it's literally all about for_each_insn_prefix β€” the move for iterating over prefixes in an instruction. πŸ’…

🌸 NAME 🌸

for_each_insn_prefix - - Iterate prefixes in the instruction

πŸŽ€ SYNOPSIS πŸŽ€

for_each_insn_prefix (insn , prefix );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • insn β€” a pointer to struct insn. yes bestie, that kind of pointer. 🫢
  • prefix β€” the prefix byte. iconic. ✨

πŸ’– DESCRIPTION πŸ’–

So what it does is iterate prefix bytes of the given insn. Each prefix byte is stored in prefix, and the index is stored in idx β€” and ngl, note that this idx is just a cursor, so do not change it. 😭

⚠️ okay important vibe check: since prefixes.nbytes can be bigger than 4 if some prefixes are repeated, it cannot be used for looping over the prefixes. no cap. πŸ’€

🌈 SEE ALSO 🌈

  • Kernel file ./tools/arch/x86/include/asm/insn.h

πŸ’Œ mwah, this cutie comes from source/version ./tools/arch/x86/include/asm, dated October 2026 β€” slay, bye bestie! πŸŽ€πŸ‘‘

πŸ“¦ where this page comes from