for_each_mem_range(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– for_each_mem_range(9) πŸ’–

okay so real quick β€” this is a page from the Kernel API Manual, and honestly? it's a little guy but it does things. stay with me bestie 🫢


✨ NAME ✨

for_each_mem_range β€” iterate through memory areas. that's it, that's the whole vibe. it walks you through the memory regions one at a time like a little tour guide 🧚


🌸 SYNOPSIS 🌸

for_each_mem_range (i , p_start , p_end );

no cap, that's the whole call. short and iconic πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • i β€” a u64 used as the loop variable. yeah. it's the counter, the main character of the loop, the little number that keeps going πŸ”₯
  • p_start β€” a ptr to phys_addr_t for the start address of the range. it can be NULL β€” like, no pressure, it's flexible 🌸
  • p_end β€” a ptr to phys_addr_t for the end address of the range. also can be NULL. both of them are allowed to ghost you, lowkey πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

so the whole friend group lives in the kernel file ./include/linux/memblock.h, and honestly the squad is deep. here's everyone:

the way that list just keeps going 😭 go read them, iykyk ⭐


that's the whole page bestie, short, sweet, and absolutely serving kernel documentation energy πŸ‘‘

sign-off szn: this one's sourced from ./include/linux, dated October 2026, and it's the for_each_mem_range(9) page β€” periodt πŸ’œ

πŸ“¦ where this page comes from