PMAP_MAP(9)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’– pmap_map(9) β€” Kernel Developer's Manual πŸ’–

okay bestie, welcome to the pmap_map(9) page β€” manual name right there, Kernel Developer's Manual energy, and honestly? it's giving low-level kernel mapping and I'm obsessed. ✨

🌸 NAME 🌸

pmap_map β€” map a physical memory range into kernel virtual address (KVA) space

No cap, that's the whole name section. πŸ’…

πŸ¦‹ SYNOPSIS πŸ¦‹

bestie, copy these includes exactly, fr fr:

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

vm_offset_t
pmap_map(vm_offset_t *virt, vm_paddr_t start, vm_paddr_t end, int prot);

πŸŽ€ DESCRIPTION πŸŽ€

The pmap_map() function maps a range of physical addresses into kernel virtual address (KVA) space, from start to end, with protection bits prot. Highkey the whole point. πŸ’–

The value passed in *virt is treated as a hint for the virtual address of the beginning of the mapping. So it's like a suggestion, not a demand β€” iykyk. 🫢

🌈 IMPLEMENTATION NOTES 🌈

Real talk: the prot argument is currently ignored by machine-dependent implementations. Not me pointing at prot and whispering β€œyou're doing amazing, sweetie” while it's literally ignored πŸ’€.

Architectures which can support a direct mapped physical to virtual region can return the appropriate address within that region, leaving *virt unchanged. Slay for direct-mapped architectures, honestly. πŸ‘‘

⭐ RETURN VALUES ⭐

The pmap_map() function returns the virtual address of the beginning of the mapping, if the mapping was successfully made; *virt will also be updated with the first usable address after the mapped region. That's the main character return value right there. 🌟

If the function is unsuccessful, NULL is returned. Sad girl hours, but at least it's documented. 😭

🧚 SEE ALSO 🧚

  • pmap(9) β€” the one and only bestie referenced here.

πŸ‘‘ AUTHORS πŸ‘‘

This manual page was written by Bruce M Simpson <bms@spc.org>. Shoutout to Bruce, periodt. 🫢


mwah πŸ’‹ β€” this page is from Debian, dated July 21, 2003, and yes, it's the PMAP_MAP(9) manual page signing off. byeeee πŸ¦‹

πŸ“¦ where this page comes from