# Pinned Memory Token

## NAME

pinned_memory_token - Representation of a device DMA grant

## SYNOPSIS

Pinned Memory Tokens (PMTs) represent an outstanding access grant to a device
for performing DMA.

## DESCRIPTION

PMTs are obtained by [pinning memory with a BTI object](https://fuchsia.dev/reference/syscalls/bti_pin).
It is valid for the device associated with the BTI to access the memory represented
by the PMT for as long as the PMT object is around. When the PMT object is
destroyed, either via [`zx_handle_close()`](https://fuchsia.dev/reference/syscalls/handle_close), [`zx_pmt_unpin()`](https://fuchsia.dev/reference/syscalls/pmt_unpin), or process
termination, access to the represented memory becomes illegal (this is
enforced by hardware on systems with the capability to do so, such as IOMMUs).

If a PMT object is destroyed by means other than [`zx_pmt_unpin()`](https://fuchsia.dev/reference/syscalls/pmt_unpin), the
underlying memory is *quarantined* . See
[bus_transaction_initiator](https://fuchsia.dev/fuchsia-src/reference/kernel_objects/bus_transaction_initiator) for more details.

## SEE ALSO

- [bus_transaction_initiator](https://fuchsia.dev/fuchsia-src/reference/kernel_objects/bus_transaction_initiator) - Bus Transaction Initiators

## SYSCALLS

- [`zx_bti_pin()`](https://fuchsia.dev/reference/syscalls/bti_pin) - pin memory and grant access to it to the BTI
- [`zx_pmt_unpin()`](https://fuchsia.dev/reference/syscalls/pmt_unpin) - revoke access and unpin memory

[](https://issues.fuchsia.dev/issues/new?component=1439230&template=1881640&description=Issue+on:+https://fuchsia.dev/docs/reference/kernel_objects/pinned_memory_token.md "Report a bug or suggest improvements on this page") [](https://cs.opensource.google/fuchsia/fuchsia/+/main:docs/reference/kernel_objects/pinned_memory_token.md "View the source code of this page") [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/reference/kernel_objects/pinned_memory_token.md&cloneRepo=fuchsia/fuchsia:refs/heads/main&fullPath=fuchsia/docs/reference/kernel_objects/pinned_memory_token.md "Edit the source code of this page")