.TH "rte_eal_paging.h" 3 "Version 25.11.0" "DPDK" \" -*- nroff -*-
.ad l
.nh
.SH NAME
rte_eal_paging.h
.SH SYNOPSIS
.br
.PP
\fR#include <stdint\&.h>\fP
.br
\fR#include <rte_compat\&.h>\fP
.br

.SS "Enumerations"

.in +1c
.ti -1c
.RI "enum \fBrte_mem_prot\fP { \fBRTE_PROT_READ\fP = 1 << 0, \fBRTE_PROT_WRITE\fP = 1 << 1, \fBRTE_PROT_EXECUTE\fP = 1 << 2 }"
.br
.ti -1c
.RI "enum \fBrte_map_flags\fP { \fBRTE_MAP_SHARED\fP = 1 << 0, \fBRTE_MAP_ANONYMOUS\fP = 1 << 1, \fBRTE_MAP_PRIVATE\fP = 1 << 2, \fBRTE_MAP_FORCE_ADDRESS\fP = 1 << 3, \fBRTE_MAP_FORCE_ADDRESS_NOREPLACE\fP = 1 << 4 }"
.br
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "__rte_internal void * \fBrte_mem_map\fP (void *requested_addr, size_t size, int prot, int flags, int fd, uint64_t offset)"
.br
.ti -1c
.RI "__rte_internal int \fBrte_mem_unmap\fP (void *virt, size_t size)"
.br
.ti -1c
.RI "__rte_internal size_t \fBrte_mem_page_size\fP (void)"
.br
.ti -1c
.RI "__rte_internal int \fBrte_mem_lock\fP (const void *virt, size_t size)"
.br
.in -1c
.SH "Enumeration Type Documentation"
.PP 
.SS "enum \fBrte_mem_prot\fP"
Memory protection flags\&. 
.PP
\fBEnumerator\fP
.in +1c
.TP
\f(BIRTE_PROT_READ \fP
Read access\&. 
.TP
\f(BIRTE_PROT_WRITE \fP
Write access\&. 
.TP
\f(BIRTE_PROT_EXECUTE \fP
Code execution\&. 
.PP
Definition at line \fB20\fP of file \fBrte_eal_paging\&.h\fP\&.
.SS "enum \fBrte_map_flags\fP"
Additional flags for memory mapping\&. 
.PP
\fBEnumerator\fP
.in +1c
.TP
\f(BIRTE_MAP_SHARED \fP
Changes to the mapped memory are visible to other processes\&. 
.TP
\f(BIRTE_MAP_ANONYMOUS \fP
Mapping is not backed by a regular file\&. 
.TP
\f(BIRTE_MAP_PRIVATE \fP
Copy-on-write mapping, changes are invisible to other processes\&. 
.TP
\f(BIRTE_MAP_FORCE_ADDRESS \fP
Force mapping to the requested address\&. This flag should be used with caution, because to fulfill the request implementation may remove all other mappings in the requested region\&. However, it is not required to do so, thus mapping with this flag may fail\&. 
.TP
\f(BIRTE_MAP_FORCE_ADDRESS_NOREPLACE \fP
Force mapping to the requested address, but fail if a preexisting mapping collides with the request\&. 
.PP
Definition at line \fB27\fP of file \fBrte_eal_paging\&.h\fP\&.
.SH "Function Documentation"
.PP 
.SS "__rte_internal void * rte_mem_map (void * requested_addr, size_t size, int prot, int flags, int fd, uint64_t offset)"
Map a portion of an opened file or the page file into memory\&.

.PP
This function is similar to POSIX mmap(3) with common MAP_ANONYMOUS extension, except for the return value\&.

.PP
\fBParameters\fP
.RS 4
\fIrequested_addr\fP Desired virtual address for mapping\&. Can be NULL to let OS choose\&. 
.br
\fIsize\fP Size of the mapping in bytes\&. 
.br
\fIprot\fP Protection flags, a combination of \fBrte_mem_prot\fP values\&. 
.br
\fIflags\fP Additional mapping flags, a combination of \fBrte_map_flags\fP\&. 
.br
\fIfd\fP Mapped file descriptor\&. Can be negative for anonymous mapping\&. 
.br
\fIoffset\fP Offset of the mapped region in fd\&. Must be 0 for anonymous mappings\&. 
.RE
.PP
\fBReturns\fP
.RS 4
Mapped address or NULL on failure and rte_errno is set to OS error\&. 
.RE
.PP

.SS "__rte_internal int rte_mem_unmap (void * virt, size_t size)"
OS-independent implementation of POSIX munmap(3)\&. 
.SS "__rte_internal size_t rte_mem_page_size (void )"
Get system page size\&. This function never fails\&.

.PP
\fBReturns\fP
.RS 4
Page size in bytes\&. 
.RE
.PP

.SS "__rte_internal int rte_mem_lock (const void * virt, size_t size)"
Lock in physical memory all pages crossed by the address region\&.

.PP
\fBParameters\fP
.RS 4
\fIvirt\fP Base virtual address of the region\&. 
.br
\fIsize\fP Size of the region\&. 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success, negative on error\&.
.RE
.PP
\fBSee also\fP
.RS 4
\fBrte_mem_page_size()\fP to retrieve the page size\&. 

.PP
\fBrte_mem_lock_page()\fP to lock an entire single page\&. 
.RE
.PP

.SH "Author"
.PP 
Generated automatically by Doxygen for DPDK from the source code\&.
