Google is committed to advancing racial equity for Black communities. See how.

zx_vmar_op_range

NAME

Perform an operation on VMOs mapped into this VMAR.

SYNOPSIS

#include <zircon/syscalls.h>

zx_status_t zx_vmar_op_range(zx_handle_t handle,
                             uint32_t op,
                             zx_vaddr_t address,
                             size_t size,
                             void* buffer,
                             size_t buffer_size);

DESCRIPTION

zx_vmar_op_range() performs operation op on VMOs mapped in the range address to address+size.

address and size must fall entirely within this VMAR, and must meet the alignment requirements specified for the corresponding VMO op (if there is one) by zx_vmo_op_range().

buffer and buffer_size are currently unused, and must be empty.

The supported operations are:

ZX_VMAR_OP_COMMIT - Requires the ZX_RIGHT_WRITE right, and applies only to writable mappings. The operation's semantics are otherwise as described by zx_vmo_op_range() ZX_VMO_OP_COMMIT.

ZX_VMO_OP_DECOMMIT - Deprecated. Use ZX_VMAR_OP_DECOMMIT instead.

ZX_VMAR_OP_DECOMMIT - Requires the ZX_RIGHT_WRITE right, and applies only to writable mappings. The operation's semantics are otherwise as described by zx_vmo_op_range() ZX_VMO_OP_DECOMMIT.

ZX_VMAR_OP_MAP_RANGE - Populates entries in the CPU page tables (or architectural equivalent) for committed pages in the given range. Entries for uncommitted pages in the range are not populated. Fails if entries already exist for any page in the range (this may change in the future).

ZX_VMAR_OP_DONT_NEED - Hints that pages in the specified range are not needed anymore and should be considered for memory reclamation. Intended to be used on mappings for VMOs created with zx_pager_create_vmo(); trivially succeeds for mappings for other VMO types.

Please refer to zx_vmo_op_range() ZX_VMO_OP_DONT_NEED for more details.

ZX_VMAR_OP_ALWAYS_NEED - Hints that pages in the specified range are important and should be protected from memory reclamation. Intended to be used on mappings for VMOs created with zx_pager_create_vmo(); trivially succeeds for mappings for other VMO types.

Please refer to zx_vmo_op_range() ZX_VMO_OP_ALWAYS_NEED for more details.

RIGHTS

If op is ZX_VMO_OP_DECOMMIT, affected mappings must be writable.

RETURN VALUE

zx_vmar_op_range() returns ZX_OK on success. In the event of failure, a negative error value is returned.

ERRORS

ZX_ERR_ACCESS_DENIED handle, or one of the affected VMO mappings, does not have sufficient rights to perform the operation.

ZX_ERR_BAD_HANDLE handle is not a valid handle.

ZX_ERR_BAD_STATE handle is not a live VMAR, or the range specified by address and size spans unmapped regions.

ZX_ERR_INVALID_ARGS buffer is non-null, or buffer_size is non-zero, op is not a valid operation, size is zero, or address was not page-aligned.

ZX_ERR_NOT_SUPPORTED op was not ZX_VMO_OP_DECOMMIT, or one or more mapped VMOs do not support the requested op.

ZX_ERR_OUT_OF_RANGE The range specified by address and size is not wholly within the VM address range specified by handle.

ZX_ERR_WRONG_TYPE handle is not a VMAR handle.

SEE ALSO