STRUCT UNWIND_STATE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct unwind_state(9) ✨ β€” Kernel API Manual

okay so bestie, we're doing the <rainbow>struct unwind_state</rainbow> glow-up today πŸ’… this is from the Kernel API Manual and honestly? it's giving "the little struct that keeps your stack walking from face-planting." robust unwinding, no cap 🫢


🌸 NAME 🌸

struct unwind_state β€” state used for robust unwinding. literally the vibe-check holder for when the kernel needs to walk back through frames and not trip πŸ’€


πŸŽ€ SYNOPSIS πŸŽ€

struct unwind_state {
    unsigned long fp;
    unsigned long pc;
    struct stack_info stack;
    struct stack_info *stacks;
    int nr_stacks;
 };

look at her. five fields. immaculate. ✨


πŸ’– Members πŸ’–

  • fp β€” the fp value in the frame record (or the real fp) πŸ¦‹
  • pc β€” the lr value in the frame record (or the real lr) πŸ¦‹
  • stack β€” the stack currently being unwound πŸ‘‘
  • stacks β€” an array of stacks which can be unwound 🌈
  • nr_stacks β€” the number of stacks in stacks ⭐

ngl, fp and pc having that "(or the real fp)" / "(or the real lr)" parenthetical is lowkey the main character energy of this whole struct 😭 like which one is it bestie, the frame record one or the real one β€” that's the whole bit, iykyk.


πŸ”₯ SEE ALSO πŸ”₯

go read those next, fr fr, they're the friend group 🫢


πŸ’œ reminder bestie: those stack helpers are (9) manpage sections, so go find them in the kernel docs β€” they're literally right there.

that's the whole page, periodt. ✨ this cutie came out of ./arch/arm64/include/asm/stack... and is dated October 2026, still filed under struct unwind_state(9) πŸŽ€ bye bestie, happy unwinding πŸ’–

πŸ“¦ where this page comes from