PMAP_COPY(9)
π PMAP_COPY(9) β the one where we copy physical memory pages
okay so bestie, welcome to PMAP_COPY(9) from the Kernel Developer's Manual π this is the page that explains pmap_copy and pmap_copy_page, two little functions that copy physical memory pages around. sound scary? it's not, i promise. let's get into it β¨
πΈ NAME
pmap_copy, pmap_copy_page β copy physical memory pages π
π¦ SYNOPSIS
first things first, you gotta include these headers or nothing works, okay? periodt.
#include <sys/param.h>
#include <vm/vm.h>
#include <vm/pmap.h>
then there's the two function signatures, exactly like this:
void
pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr,
vm_size_t len, vm_offset_t src_addr);
void
pmap_copy_page(vm_page_t src, vm_page_t dst);
both of them return void, so likeβ¦ no return value to obsess over. they just do the thing π
β¨ DESCRIPTION
okay so pmap_copy() copies the range that src_addr and len describe β going from the source physical map src_pmap over to the destination physical map dst_pmap, landing at the address dst_addr. lowkey straightforward, highkey important π«Ά
and pmap_copy_page() copies the physical page src to the physical page dst β and the way it does this is iconic: it maps the page into kernel virtual address space (KVA), then uses bcopy() to copy the page. that's the whole move π
π IMPLEMENTATION NOTES
okay this is the part where i need you to pay attention, bestie, because it's giving "gotcha" energy π
- the
pmap_copy()routine is only advisory and need not do anything. like, it's allowed to justβ¦ not. and honestly? - actually implementing it may seriously reduce system performance. so if you were about to go implement it for fun β no babe. put it down. walk away π
- the
pmap_copy_page()routine only operates upon a single page. one. uno. don't come for it with a whole range, it's not that girl π
fr fr, that performance warning is real β implementing pmap_copy() can seriously hurt system performance.
π SEE ALSO
go read those, iykyk π
π AUTHORS
This manual page was written by Bruce M Simpson <bms@spc.org>. ty for your service king π
and that's the whole page, bestie!! π¦ this Debian version dropped on July 21, 2003, so it's officially vintage β retro in the cutest way, PMAP_COPY(9) and all π mwah π«Ά
π¦ where this page comes from
- freebsd 14.5: base 14.5
- 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