for_each_mem_range_rev(9)
π for_each_mem_range_rev(9) π
okay so bestie, welcome to the Kernel API Manual β¨ β this one's a lil macro from the memblock cinematic universe and honestly it's giving reverse main character energy. no cap.
πΈ NAME πΈ
for_each_mem_range_rev β reverse iterate through memblock areas from type_a and not included in type_b. Or just type_a if type_b is NULL. π¦
β¨ SYNOPSIS β¨
for_each_mem_range_rev (i , p_start , p_end );
like, that's it. that's the whole vibe. π
π«Ά ARGUMENTS π«Ά
iβ au64used as the loop variable. it's the little counter bestie that keeps the party going π₯p_startβ ptr tophys_addr_tfor the start address of the range. can beNULL, so don't stress if you don't have one πp_endβ ptr tophys_addr_tfor the end address of the range. also can beNULL, we're flexible like that π
π SEE ALSO π
Kernel file ./include/linux/memblock.h β and oml the whole friend group showed up, we love a supportive cast π:
enum memblock_flags(9)struct memblock_region(9)struct memblock_type(9)struct memblock(9)for_each_physmem_range(9)__for_each_mem_range(9)__for_each_mem_range_rev(9)for_each_mem_range(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)
ok and before you go β this page lives in ./include/linux, dated October 2026, from the Kernel API Manual set (yes we're time-travelling a lil bit, slay π). go read the memblock header fr fr, ily, bye bestie ππ§π
π¦ 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