add_mem_range(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… add_mem_range(9) β€” the glow-up

okay so bestie, welcome to add_mem_range(9), straight outta the Kernel API Manual ✨ this is the page where a memory range either gets merged into the existing list (if it overlaps, iykyk) or shows up brand new like it just walked into the group chat. it's giving "range management main character energy" πŸŽ€


✨ SYNOPSIS ✨

int add_mem_range (struct crash_mem **mem_ranges , u64 base , u64 size
);

that's the whole vibe. one function, three args, returns an int. slay πŸ’…


🌸 ARGUMENTS 🌸

  • mem_ranges β€” the range list you're adding to. it's a pointer-to-pointer (struct crash_mem **), so yeah, the list itself can get re-pointed under you. respect the double star 🫢
  • base β€” base address of the range you're adding, a u64. literally where the range starts.
  • size β€” size of the memory range you're adding, also a u64. how thicc the range is.

πŸ’– DESCRIPTION πŸ’–

so what actually happens? the page keeps it cute and short:

(Re)allocates memory, if needed. πŸ”

and then:

Returns 0 on success, negative errno on error. βœ… / 😭

that's it, that's the whole description. no cap, some manpages are like three sentences and honestly? iconic. it knows what it is.

⚠️ heads up bestie: "negative errno on error" means you check for < 0, not for -1 specifically. the errno values are whatever the kernel felt like that day πŸ’€

and the real headline up top, in case you missed it: it updates an existing memory range if there's an overlap, and otherwise adds a new memory range. so either way your range is in there. periodt. πŸ‘‘


πŸ¦‹ SEE ALSO πŸ¦‹

the whole friend group 🫢 first the kernel file itself:

  • Kernel file ./arch/powerpc/kexec/ranges.c β€” that's the source, that's where it lives, go say hi

then the extended squad, all (9):

like, that's a whole friend group of range functions and you're invited πŸŽ€


aaaand that's the page!! mwah πŸ’‹ this one ships from ./arch/powerpc/kexec and it's dated October 2026 β€” so yeah, bookmark it, screenshot it, send it to the group chat, and remember: overlap = update, no overlap = add. you got this bestie πŸŒˆβ­πŸ’œ

πŸ“¦ where this page comes from