for_each_physmem_range(9)
πΈ NAME πΈ
okay bestie, meet for_each_physmem_range(9) β she's serving Kernel API Manual energy, and her whole thing is: iterate through physmem areas not included in type. no cap, that's the job π
β¨ SYNOPSIS β¨
for_each_physmem_range (i , type , p_start , p_end );
That's the exact spell, spaces and all β do not "clean it up," bestie, she's built like that π«Ά
π ARGUMENTS π
iβ au64used as the loop variable. She's literally the counter, main character energy β¨typeβ a ptr tomemblock_typewhich excludes from the iteration; can beNULL. So if there's no type to exclude,NULLis valid and she's chill with it πp_startβ a ptr tophys_addr_tfor the start address of the range; can beNULL. Start-address storage? optional, iconic, no notes πΈp_endβ a ptr tophys_addr_tfor the end address of the range; can beNULL. End-address storage? also optional, also slay π
π₯ SEE ALSO π₯
Kernel file ./include/linux/memblock.h is the home base, and here's the whole linked-up friend group:
enum memblock_flags(9)struct memblock_region(9)struct memblock_type(9)struct memblock(9)__for_each_mem_range(9)__for_each_mem_range_rev(9)for_each_mem_range(9)for_each_mem_range_rev(9)for_each_reserved_mem_range(9)for_each_mem_pfn_range(9)for_each_free_mem_range(9)for_each_free_mem_range_reverse(9)memblock_set_current_limit(9)memblock_region_memory_base_pfn(9)memblock_region_memory_end_pfn(9)memblock_region_reserved_base_pfn(9)memblock_region_reserved_end_pfn(9)for_each_mem_region(9)for_each_reserved_mem_region(9)
okay that's the whole vibe check π from the ./include/linux source corner of the Kernel API Manual, dated October 2026 β for_each_physmem_range(9) signing off, mwah π
β¨
π¦ 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