PMAP_PINIT(9)

πŸ’– PMAP_PINIT β€” the manual, but make it a group chat πŸ’–

okay bestie, you found it, the kernel developer's manual page for pmap_pinit and pmap_pinit0, and honestly? it's giving "small page, big responsibilities." these two are the little functions that get your pmap structures ready to exist in the world. let's get into it 🫢


✨ NAME ✨

pmap_pinit, pmap_pinit0 β€” initialize pmap structures πŸ’…

like literally that's the whole job. setup girls. no cap.


🌸 SYNOPSIS 🌸

so first you gotta invite the right headers to the party, obviously:

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

and then, the moment you've all been waiting for:

void
pmap_pinit(pmap_t pmap);

void
pmap_pinit0(pmap_t pm);

both of them return void, meaning they give you absolutely nothing back except the satisfaction of a job well done. iconic behaviour tbh. they're not here to report, they're here to do. πŸ’€βœ¨


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so, pmap_pinit() β€” the way that this function just takes the preallocated and zeroed structure pmap and initializes it. and when we say structure pmap, we mean like, one that lives inside a vmspace structure, for example. so like, if you've got a vmspace and it's got a pmap sitting in there all zeroed out and waiting, this is the girl who wakes it up. 🌈

then there's pmap_pinit0(), her sister. she initializes the physical map pm, and pm is associated with process 0 β€” aka the very first process created in the system. the OG. the main character. the founding mother of every process that came after her πŸ‘‘βœ¨

so basically: one of them is for a general pmap chilling in a vmspace, and one of them is specifically for the physical map tied to process 0. different girls, different lanes, both slaying. πŸŽ€


πŸ”₯ IMPLEMENTATION NOTES πŸ”₯

okay this is the part where we have to be a little bit serious for a second, bestie, because there's lore here:

pmap_pinit2() has been deprecated.

she's not coming to the function. she's been retired. and the note says β€” very clearly, no ambiguity, no wiggle room β€” that she should be implemented as a stub until further notice. so if you're out here writing pmap_pinit2(), you write it as a stub. that's it. that's the assignment. don't be out here inventing behaviour for a deprecated function, i am begging πŸ™ˆ


πŸ’œ SEE ALSO πŸ’œ

go read these next, they're the friends of the family:

iykyk. the whole pmap cinematic universe. 🌟


πŸŽ€ 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 came from the Debian crew, dated July 21, 2003, and it's filed under PMAP_PINIT(9) in the kernel developer's manual. old page, still relevant, still cute. mwah πŸ’‹βœ¨πŸŒΈ

πŸ“¦ where this page comes from