__compute_r...epc_for_insn(9)
π
__compute_r...epc_for_insn(9) β like, the Kernel API Manual girlies know β¨
okay so bestie, before we even start: yes, the title is literally abbreviated to __compute_r...epc_for_insn(9) and that's just how the Kernel API Manual rolls it. The full name is __compute_return_epc_for_insn and she is the main character here. No cap. π
πΈ NAME πΈ
__compute_return_epc_for_insn β computes the return address and does emulate branch simulation, if required. That's it, that's the vibe. π¦
β SYNOPSIS β
int __compute_return_epc_for_insn (struct pt_regs *regs , union
mips_instruction insn );
two arguments, one int coming back at you. slay. π
π ARGUMENTS π
regsβ pointer topt_regs. that's the pointer. she points. periodt. π«Άinsnβ the branch instruction to decode. this is the one we're looking at, bestie. π
π₯ RETURN π₯
-EFAULTon error β and heads up, this one forcesSIGILL. like, it does not play. π- on success it returns
0orBRANCH_LIKELY_TAKENas appropriate, after evaluating the branch. iykyk. β¨
π§ DESCRIPTION π§
okay so this is the MIPS R6 Compact branches + forbidden slots situation, and honestly it's giving very specific lore, so let me break it down. π
Compact branches do not throw exceptions because they do not have delay slots. iconic, no notes. π
The forbidden slot instruction ($PC+4) is only executed if the branch was not taken. Otherwise, the forbidden slot is skipped entirely β like, fully ghosted. π
So what that means is: the only possible reason to be here because of a MIPS R6 compact branch instruction is that the forbidden slot has thrown one. π« And in that case, the branch was not taken, so the EPC can be safely set to EPC + 8. boom. math. ate. π
no guessing, no improvising β that's literally the whole reasoning, bestie. π
π SEE ALSO π
- Kernel file
./arch/mips/kernel/branch.cβ go read her, she has the range. π
and that's the page!! π this little icon lives in ./arch/mips/kernel, dated October 2026, and it's part of the Kernel API Manual. 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