15 #ifndef __included_memfd_h__ 16 #define __included_memfd_h__ 20 #include <sys/types.h> 23 #include <netinet/in.h> 44 #define MMAP_PAGESIZE (clib_mem_get_page_size()) 47 #define MEMFD_N_OPAQUE 7 99 while (__sync_lock_test_and_set (&h->
lock, 1))
110 while (__sync_lock_test_and_set (&h->
lock, 1))
141 return ((
void *) oldheap);
150 #define foreach_memfd_api_error \ 151 _(NO_NAME, "No shared segment name", -100) \ 152 _(NO_SIZE, "Size not set (master)", -101) \ 153 _(CREATE_FAILURE, "Create failed", -102) \ 154 _(SET_SIZE, "Set size failed", -103) \ 155 _(MMAP, "mmap failed", -104) \ 156 _(SLAVE_TIMEOUT, "Slave map timeout", -105) 160 #define _(n,s,c) MEMFD_API_ERROR_##n = c, 165 #define MEMFD_API_ERROR_NO_NAME (-10) 174 #ifndef F_LINUX_SPECIFIC_BASE 175 #define F_LINUX_SPECIFIC_BASE 1024 177 #define MFD_ALLOW_SEALING 0x0002U 178 #define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) 179 #define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10) 181 #define F_SEAL_SEAL 0x0001 182 #define F_SEAL_SHRINK 0x0002 183 #define F_SEAL_GROW 0x0004 184 #define F_SEAL_WRITE 0x0008
Fixed length block allocator.
#define foreach_memfd_api_error
u32 per_interface_next_index
static void memfd_unlock(memfd_shared_header_t *h)
int memfd_slave_init(memfd_private_t *memfd)
static void memfd_unlock_non_recursive(memfd_shared_header_t *h)
memfd_shared_header_t * sh
static void * clib_mem_set_heap(void *heap)
int memfd_master_init(memfd_private_t *memfd, u32 master_index)
void memfd_delete(memfd_private_t *memfd)
static void * memfd_push_heap(memfd_shared_header_t *sh)
static void memfd_lock(memfd_shared_header_t *h, u32 my_pid, u32 tag)
Bitmaps built as vectors of machine words.
#define CLIB_MEMORY_BARRIER()
static void memfd_pop_heap(void *oldheap)
CLIB vectors are ubiquitous dynamically resized arrays with by user defined "headers".
static void memfd_lock_non_recursive(memfd_shared_header_t *h, u32 tag)