The file pmap.c handles the machine-dependent interface to the MMU. The machine-independent virtual memory (VM) code, which is in the directory /usr/src/vm, keeps a record of the current mapping for each process. Whenever the mapping changes, the VM code calls routines in pmap to update the MMU state to reflect changes in the kernel data structures. The most common operation in pmap is to add a page to an existing mapping, but sometimes a map must be copied for a fork() or erased and regenerated for an exec(). Much of pmap for a new port can be based directly on pmaps of other ports to machines with similar CPUs and MMUs.