PMAP(9)
π PMAP(9) β bestie edition π
the kernel developer's manual, but make it cute πΈ
okay so you're reading the pmap page from the Kernel Developer's Manual β welcome to the machine-dependent side of the house, bestie, it's giving β¨hardwareβ¨ and honestly? iconic.
β¨ NAME β¨
pmap β machine-dependent portion of virtual memory subsystem π§ πΎ
π SYNOPSIS π
#include <sys/param.h>
#include <vm/vm.h>
#include <vm/pmap.h>
like, that's it. that's the vibe. include these and go be a kernel dev π
π DESCRIPTION π
okay so. the pmap module is the machine-dependent portion of the FreeBSD VM (Virtual Memory) sub-system. no cap. and here's the tea: every single function documented in this whole pmap saga has to have its own architecture-dependent implementation. like, you can't just copy-paste and call it a day, every architecture does its own thing and that's valid π«Ά
the pmap module is responsible for managing hardware-dependent objects such as page tables, address maps, TLBs, etc. so basically all the stuff the hardware is β¨particularβ¨ about.
machine-dependent code must provide the header file <machine/pmap.h>. must. as in, non-negotiable, periodt. this file contains the definition of the pmap structure:
struct pmap {
/* Contents defined by pmap implementation. */
};
typedef struct pmap *pmap_t;
so yeah, the contents are defined by the pmap implementation β that's your job, bestie, the struct is a β¨blank canvasβ¨ π¨
this header file may also define other data structures used by the pmap implementation. go off, honestly.
the header file <vm/pmap.h> defines a structure for tracking pmap statistics (peep below π). this structure is defined as:
struct pmap_statistics {
long resident_count; /* number of mapped pages */
long wired_count; /* number of wired pages */
};
so like β resident_count is the number of mapped pages, wired_count is the number of wired pages. two longs, two jobs, they ate π₯
the implementation's struct pmap must contain an instance of this structure having the name pm_stats, and it must be updated by the implementation after each relevant pmap operation. like, the pm_stats name? not a suggestion. not a nickname. it's the name. and keeping it updated is the whole point, so don't be out here leaving stale stats, that's π behavior.
π¦ SEE ALSO π¦
the whole friend group, in order, as the original presents them:
pmap_activate(9)pmap_clear_modify(9)pmap_copy(9)pmap_copy_page(9)pmap_enter(9)pmap_extract(9)pmap_extract_and_hold(9)pmap_growkernel(9)pmap_init(9)pmap_init2(9)pmap_is_modified(9)pmap_is_prefaultable(9)pmap_map(9)pmap_mincore(9)pmap_object_init_pt(9)pmap_page_exists_quick(9)pmap_page_init(9)pmap_pinit(9)pmap_pinit0(9)pmap_pinit2(9)pmap_protect(9)pmap_qenter(9)pmap_qremove(9)pmap_quick_enter_page(9)pmap_quick_remove_page(9)pmap_release(9)pmap_remove(9)pmap_remove_all(9)pmap_remove_pages(9)pmap_resident_count(9)pmap_ts_referenced(9)pmap_unwire(9)pmap_wired_count(9)pmap_zero_area(9)pmap_zero_page(9)vm_map(9)
π AUTHORS π
this manual page was written by Bruce M Simpson <bms@spc.org>. king behavior, truly π thank you for your service π«‘π
and that's the page, bestie β¨ go manage some page tables, you're literally the main character of the VM subsystem π π
sign-off: this one came from the Debian edition, dated August 30, 2016 β so yeah, it's got that vintage-but-still-slaying energy π sending love from the PMAP(9) corner of the manual, mwah π
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms