eal: introduce memory management wrappers
authorDmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Mon, 15 Jun 2020 00:43:45 +0000 (03:43 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 15 Jun 2020 17:25:05 +0000 (19:25 +0200)
commitc4b89ecb64eae773337f3b1367dd8b1f09737f2e
tree88e89cda35a4c8e78cd85443f006ec8d42d2ea5d
parent176bb37ca6f344e6765d0ce4b99b88950b618ce1
eal: introduce memory management wrappers

Introduce OS-independent wrappers for memory management operations used
across DPDK and specifically in common code of EAL:

* rte_mem_map()
* rte_mem_unmap()
* rte_mem_page_size()
* rte_mem_lock()

Windows uses different APIs for memory mapping and reservation, while
Unices reserve memory by mapping it. Introduce EAL private functions to
support memory reservation in common code:

* eal_mem_reserve()
* eal_mem_free()
* eal_mem_set_dump()

Wrappers follow POSIX semantics limited to DPDK tasks, but their
signatures deliberately differ from POSIX ones to be more safe and
expressive. New symbols are internal. Being thin wrappers, they require
no special maintenance.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
lib/librte_eal/common/eal_common_fbarray.c
lib/librte_eal/common/eal_common_memory.c
lib/librte_eal/common/eal_private.h
lib/librte_eal/freebsd/Makefile
lib/librte_eal/include/rte_eal_paging.h [new file with mode: 0644]
lib/librte_eal/linux/Makefile
lib/librte_eal/linux/eal_memalloc.c
lib/librte_eal/rte_eal_version.map
lib/librte_eal/unix/eal_unix_memory.c [new file with mode: 0644]
lib/librte_eal/unix/meson.build