lookup_prev_stack_frame(9)
π lookup_prev_stack_frame(9) π
okay so bestie, welcome to the lookup_prev_stack_frame(9) page from the Kernel API Manual β this is the microblaze stack-unwinding lore and ngl it's kind of iconic once you get it. it's literally a little detective that goes "who called you, bestie? π" and hands you back the previous function's frame. let's get into it π«Ά
β¨ NAME β¨
lookup_prev_stack_frame β find the stack frame of the previous function. that's it, that's the vibe β¨
π SYNOPSIS π
int lookup_prev_stack_frame (unsigned long fp , unsigned long pc ,
unsigned long leaf_return , unsigned long *pprev_fp , unsigned long
*pprev_pc );
copy it exactly like that, no cap π§
πΈ ARGUMENTS πΈ
fpβ the frame (stack) pointer for the current function πpcβ the program counter, chillin' inside the current functionleaf_returnβ ther15value within the current function. and here's the tea: if the current function is a leaf, this is the caller's return address πpprev_fpβ on exit, this gets set to the frame (stack) pointer for the previous function π¦pprev_pcβ on exit, this gets set to the current function's caller's return address β
π₯ DESCRIPTION π₯
okay so the return value is giving very simple, very demure:
0on success β slay π-EINVALif the previous frame cannot be found β like, it's just not there bestie, and that's a-EINVALπ
that's the whole description, no extra plot twists, periodt.
π SEE ALSO π
go check these out, iykyk π
- Kernel file
./arch/microblaze/kernel/unwind.c get_frame_size(9)find_frame_creation(9)unwind_trap(9)microblaze_unwind_inner(9)microblaze_unwind(9)
and that's the whole page, bestie πβ¨
this little masterpiece lives in ./arch/microblaze/kernel and the date on it is October 2026 β so yeah, mark your calendar and stan the unwinder ππ
π¦
π¦ 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