DPDK  20.08.0
rte_eal_paging.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2020 Dmitry Kozlyuk
3  */
4 
5 #include <stdint.h>
6 #ifndef RTE_EXEC_ENV_WINDOWS
7 #include <sys/mman.h>
8 #endif
9 
10 #include <rte_compat.h>
11 
21  RTE_PROT_READ = 1 << 0,
22  RTE_PROT_WRITE = 1 << 1,
23  RTE_PROT_EXECUTE = 1 << 2
24 };
25 
28 #ifdef RTE_EXEC_ENV_WINDOWS
29 
30  RTE_MAP_SHARED = 1 << 0,
32  RTE_MAP_ANONYMOUS = 1 << 1,
34  RTE_MAP_PRIVATE = 1 << 2,
41  RTE_MAP_FORCE_ADDRESS = 1 << 3
42 #else /* map mmap flags because they are exposed in pci_map_resource() API */
43  RTE_MAP_SHARED = MAP_SHARED,
44  RTE_MAP_ANONYMOUS = MAP_ANONYMOUS,
45  RTE_MAP_PRIVATE = MAP_PRIVATE,
46  RTE_MAP_FORCE_ADDRESS = MAP_FIXED,
47 #endif
48 };
49 
71 __rte_internal
72 void *
73 rte_mem_map(void *requested_addr, size_t size, int prot, int flags,
74  int fd, size_t offset);
75 
79 __rte_internal
80 int
81 rte_mem_unmap(void *virt, size_t size);
82 
89 __rte_internal
90 size_t
91 rte_mem_page_size(void);
92 
106 __rte_internal
107 int
108 rte_mem_lock(const void *virt, size_t size);
__rte_internal int rte_mem_unmap(void *virt, size_t size)
__rte_internal void * rte_mem_map(void *requested_addr, size_t size, int prot, int flags, int fd, size_t offset)
__rte_internal size_t rte_mem_page_size(void)
__rte_internal int rte_mem_lock(const void *virt, size_t size)
rte_map_flags
rte_mem_prot