kexec_walk_resources(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– kexec_walk_resources(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual ✨ this little cutie is called kexec_walk_resources, and it's giving "let's take a stroll through memory" energy πŸšΆβ™€οΈπŸ’¨


🌸 NAME 🌸

kexec_walk_resources β€” call func(data) on free memory regions 🫢


✨ SYNOPSIS ✨

int kexec_walk_resources (struct kexec_buf *kbuf , int (*func)(struct
resource *, void *) );

like, that's the whole vibe. two args, one function pointer, no cap πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • kbuf β€” the context info for the search 🧚 and also like… it gets passed to func too, so it's doing double duty, main character energy fr
  • func β€” the function you call for each memory region πŸ’– every single one, bestie

⭐ RETURN ⭐

so here's the tea β˜• the memory walk stops the moment func returns a non-zero value β€” and that value is what gets returned to you, periodt βœ‹

but if all the free regions get visited and func never returns non-zero? then you get zero back 🌈 easy.


πŸ¦‹ SEE ALSO πŸ¦‹

go read those too, iykyk πŸ‘‘


lowkey important: if func goes non-zero, the walk is done β€” no finishing the tour, no "one more region", it's over bestie πŸ’€

and that's the whole page, mwah πŸ’‹ this one lives under ./kernel, dated October 2026, and it's literally kexec_walk_resources(9) β€” slay, go forth and walk those resources πŸŒΈπŸŽ€πŸ’œ

πŸ“¦ where this page comes from