get_max_nr_ranges(9)
โจ get_max_nr_ranges(9) โจ
okay bestie, welcome to the Kernel API Manual ๐ this one's a lil function page and it's honestly so chill โ we're just doing math about memory, no cap ๐งฎโจ
๐ธ NAME ๐ธ
get_max_nr_ranges โ get the max no. of ranges a crash_mem structure could hold, given the size allocated for it ๐ซถ
like. you gave it some bytes. it tells you how many ranges fit in those bytes. that's the whole vibe. iconic honestly ๐
๐ฆ SYNOPSIS ๐ฆ
unsigned int get_max_nr_ranges (size_t size );
that's it. one argument. one unsigned int coming back at you. minimal, clean, main character energy โญ
๐ ARGUMENTS ๐
sizeโ the allocation size of thecrash_memstructure ๐ like, how much room did you set aside for it? that's the number this parameter wants. give it the size, get back the count. slay.
๐ DESCRIPTION ๐
it returns the maximum no. of ranges โจ that's literally the entire job description and honestly? respect. it knows what it is and it does not pretend otherwise ๐
you hand it the size allocated for the crash_mem structure, it hands you back the max number of ranges that structure could hold. done. no drama, no side quests, no extra params. periodt ๐ฅ
๐ SEE ALSO ๐
okay so this is the part where we shout out the whole friend group ๐ซถ the kernel file lives at ./arch/powerpc/kexec/ranges.c and here's every single one of its besties, no gatekeeping:
get_mem_rngs_size(9)__add_mem_range(9)__merge_memory_ranges(9)sort_memory_ranges(9)realloc_mem_ranges(9)add_mem_range(9)add_tce_mem_ranges(9)add_initrd_mem_range(9)add_htab_mem_range(9)add_kernel_mem_range(9)add_rtas_mem_range(9)add_opal_mem_range(9)add_reserved_mem_ranges(9)get_reserved_memory_ranges(9)get_exclude_memory_ranges(9)get_usable_memory_ranges(9)get_crash_memory_ranges(9)
that's the whole squad, go read them too iykyk ๐โจ
ngl there's nothing dangerous here, bestie โ it's a pure "give me a number, i'll give you a number" situation. no gotchas, no undefined behaviour, we're safe ๐๐ซถ
and that's a wrap on this page ๐ brought to you by the source at ./arch/powerpc/kexec, dated October 2026, from the Kernel API Manual โ see you in the next manpage, 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