PMAP(9) Hyra Kernel Developer’s Manual PMAP(9)

NAME

pmap - hyra machine dependent virtual memory layer

SYNOPSIS

#include <vm/pmap.h>

int pmap_map(struct vm_ctx *, vaddr_t, paddr_t, vm_prot_t);
int pmap_unmap(struct vm_ctx *, vaddr_t);

DESCRIPTION

The machine dependent virtual memory layer contains a standard set of functions that shall be implemented per architecture and left alone outside of vm(9). vm(9) uses pmap routines internally which allows for abstracting away machine dependent details.

The pmap_map() function is used to map a physical address (paddr_t) to a virtual address (vaddr_t). The argument of type vm_prot_t is used to give a mapping certain access rules. These rules are described below:

The PROT_WRITABLE bit tells pmap_map() to allow writes to the page. Writes to pages without this bit will result in an exception, on AMD64 a #PF will occur.

The PROT_EXEC bit tells pmap_map() to allow this page to be executable. On platforms like AMD64, execution of pages without this bit will result in an exception from the instruction fetch, for AMD64, a #PF will occur.

The pmap_unmap() function is used to unmap a virtual address which leaves the address invalid.

AUTHORS

Ian Moffett <ian@osmora.org>

SEE ALSO

vm(9)

Hyra Mar 13 2024 Hyra