PMAP(9)
πΈ NAME πΈ
okay so bestie, meet pmap β the machine-dependent portion of the virtual memory subsystem. it's PMAP(9) from the Kernel Developer's Manual, and it's basically the part of the VM system that has to actually talk to your specific CPU. no cap. π
β¨ SYNOPSIS β¨
#include <sys/param.h>
#include <vm/vm.h>
#include <vm/pmap.h>
π¦ DESCRIPTION π¦
so the pmap module is the machine-dependent portion of the FreeBSD VM (Virtual Memory) sub-system. every single function documented in these pages has to have its own architecture-dependent implementation β like, no sharing, no copy-paste shortcuts, each arch does its own thing. periodt. π
the pmap module is responsible for managing hardware-dependent objects such as page tables, address maps, TLBs, etc. yes, all the scary low-level stuff. she's got main character energy fr fr. π₯
machine-dependent code must provide the header file <machine/pmap.h>. this file contains the definition of the pmap structure:
struct pmap {
/* Contents defined by pmap implementation. */
};
typedef struct pmap *pmap_t;
this header file may also define other data structures used by the pmap implementation. so like, it's not a one-struct situation, it can bring friends. π«Ά
the header file <vm/pmap.h> defines a structure for tracking pmap statistics (see below). this structure is defined as:
struct pmap_statistics {
long resident_count; /* number of mapped pages */
long wired_count; /* number of wired pages */
};
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. not optional, bestie β if you forget to keep pm_stats updated, that's a vibe check you will fail. π
lowkey important:resident_countis the number of mapped pages,wired_countis the number of wired pages, and both live inside that one struct instance namedpm_stats.
π SEE ALSO π
the whole friend group, in order, no skips (iykyk):
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_is_modified(9)pmap_is_prefaultable(9)pmap_kextract(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_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>. iconic. π
and that's the whole page, bestie β this one's from Debian, dated January 12, 2024. go forth and manage those hardware-dependent objects. slay. πβ¨π¦
π¦ where this page comes from
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms