for_each_reserved_mem_range(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… for_each_reserved_mem_range(9) β€” Kernel API Manual πŸŽ€

okay bestie, so we're in the Kernel API Manual today and the star of the show is for_each_reserved_mem_range β€” yes it's a long name, yes it ate, let's get into it ✨


🌸 NAME 🌸

for_each_reserved_mem_range β€” iterate over all reserved memblock areas πŸ’–

Literally what it says on the tin. It loops over the reserved bits. Slay.


✨ SYNOPSIS ✨

for_each_reserved_mem_range (i , p_start , p_end );

That's the whole vibe. Three args, no cap. 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • i β€” a u64 used as the loop variable. it's your counter bestie, it just keeps going 🎒
  • p_start β€” ptr to phys_addr_t for the start address of the range, can be NULL. so like, it points at where the range begins β€” and if you don't care to know, NULL is totally valid, king behavior πŸ‘‘
  • p_end β€” ptr to phys_addr_t for the end address of the range, can be NULL. same deal, it's the end of the range, and again NULL is allowed if you're not nosy πŸ™ˆ

🌈 DESCRIPTION 🌈

Walks over reserved areas of memblock. Available as soon as memblock is initialized.

That's it. That's the whole thing. It's giving "small but mighty" energy β€” you don't need memblock to be fully grown up or anything, the second it's initialized this bad boy is ready to go πŸ”₯

no cap, this is genuinely one of the short ones. enjoy it while it lasts bestie, some of the neighbors in SEE ALSO are long 😭

πŸ”₯ SEE ALSO πŸ”₯

okay so this is the friend group 🫢 β€” the kernel file lives at ./include/linux/memblock.h, and here's everyone else:

the whole for_each_* cinematic universe fr fr πŸ‘‘πŸ’œ


and that's the page diva πŸ’… β€” sourced from ./include/linux, dated October 2026, and yes it's still called for_each_reserved_mem_range(9) because we don't do rebrands here πŸŽ€βœ¨

πŸ“¦ where this page comes from