---
name: "pmap_extract"
section: "9"
platform: "linux"
package: "freebsd-manpages"
version: "6.0-5"
release: "Debian 4.0 (Etch)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/pmap_extract"
---

# pmap\_extract(9)

map a virtual address to a physical page

## NAME

**pmap\_extract**, **pmap\_extract\_and\_hold** – map a virtual address to a physical page

## SYNOPSIS

**#include \<sys/param.h\>**

**#include \<vm/vm.h\>**

**#include \<vm/pmap.h\>**

*vm\_paddr\_t*\

**pmap\_extract**(*pmap\_t pmap*, *vm\_offset\_t va*);

*vm\_paddr\_t*\

**pmap\_extract\_and\_hold**(*pmap\_t pmap*, *vm\_offset\_t va*, *vm\_prot\_t prot*);

## DESCRIPTION

The **pmap\_extract**() function maps a virtual address to a physical page. In certain situations, callers may use **pmap\_extract\_and\_hold**() instead, to ensure that the returned page is held.

The **pmap\_extract\_and\_hold**() function maps a virtual address to a physical page, and atomically holds the returned page for use by the caller, only if the mapping permits the given page protection.

## IMPLEMENTATION NOTES

Currently, the page protection requested by the caller is not verified.

In the **pmap\_extract\_and\_hold**() function, the *Giant* lock is held for the duration of the call to ensure that only a single caller is present.

## RETURN VALUES

The **pmap\_extract**() function will return the physical page address associated with the virtual address *va* inside the physical map *pmap*. If the mapping does not exist, or if the *pmap* parameter is NULL, then NULL will be returned.

The **pmap\_extract\_and\_hold**() function will return the physical page address associated with the virtual address *va* inside the physical map *pmap*. If the mapping does not exist, the result is a no-op, and NULL will be returned.

## SEE ALSO

[mutex(9)](/mutex/9.md), [pmap(9)](/pmap/9.md)

## AUTHORS

The **pmap\_extract\_and\_hold**() function was implemented by Alan L. Cox ⟨alc@imimic.com⟩. This manual page was written by Bruce M Simpson ⟨bms@spc.org⟩.
