VM_MAP_CREATE(9)

πŸ’– VM_MAP_CREATE πŸ’–

okay so bestie, we're in the Kernel Developer's Manual section 9 today, and the page is called vm_map_create. it's giving "let's build a map from scratch" energy and honestly? iconic. πŸ—ΊοΈβœ¨


✨ NAME ✨

vm_map_create β€” create a new vm_map structure πŸŽ€


🌸 SYNOPSIS 🌸

#include <sys/param.h>
#include <vm/vm.h>
#include <vm/vm_map.h>

vm_map_t
vm_map_create(pmap_t pmap, vm_offset_t min, vm_offset_t max);

πŸ’… DESCRIPTION πŸ’…

so like, vm_map_create() does exactly what it says on the tin, no cap. it creates and returns a brand new, empty map structure. πŸ¦‹

and this lil baby map? it comes associated with the physical map pmap, and it's got upper and lower address bounds that you hand it yourself β€” max for the top and min for the bottom, respectively. 🫢

lowkey important: max is the upper bound, min is the lower bound. don't mix them up bestie, that's not the vibe. πŸ™ˆ

🧚 IMPLEMENTATION NOTES 🧚

the kernel's zone allocator is what's doing the heavy lifting here to allocate the map. main character allocator behaviour fr fr. πŸ‘‘


⭐ RETURN VALUES ⭐

  • if it works? slay. you get a pointer to the newly allocated map. πŸ’–
  • if it doesn't? 😭 you get NULL. that's it. that's the whole tragedy.

🌈 SEE ALSO 🌈

go read those too, iykyk πŸ“šβœ¨


πŸ‘‘ AUTHORS πŸ‘‘

this manual page was written by Bruce M Simpson <bms@spc.org>. thank you for your service king πŸ«‘πŸ’œ


and that's the whole page bestie!! πŸŽ€ this one shipped out from Debian back on July 19, 2003 β€” yeah, it's vintage, but it ate and left no crumbs. πŸ’…βœ¨ bye pookie, go make some maps πŸ¦‹πŸ’–

πŸ“¦ where this page comes from