15 #ifndef __included_ssvm_h__ 16 #define __included_ssvm_h__ 20 #include <sys/types.h> 23 #include <netinet/in.h> 42 #define MMAP_PAGESIZE (clib_mem_get_page_size()) 45 #define SSVM_N_OPAQUE 7 96 while (__sync_lock_test_and_set (&h->
lock, 1))
121 return ((
void *) oldheap);
130 #define foreach_ssvm_api_error \ 131 _(NO_NAME, "No shared segment name", -100) \ 132 _(NO_SIZE, "Size not set (master)", -101) \ 133 _(CREATE_FAILURE, "Create failed", -102) \ 134 _(SET_SIZE, "Set size failed", -103) \ 135 _(MMAP, "mmap failed", -104) \ 136 _(SLAVE_TIMEOUT, "Slave map timeout", -105) 140 #define _(n,s,c) SSVM_API_ERROR_##n = c, 145 #define SSVM_API_ERROR_NO_NAME (-10)
int ssvm_master_init(ssvm_private_t *ssvm, u32 master_index)
Fixed length block allocator.
int ssvm_slave_init(ssvm_private_t *ssvm, int timeout_in_seconds)
ssvm_shared_header_t * sh
static void * ssvm_push_heap(ssvm_shared_header_t *sh)
static void ssvm_pop_heap(void *oldheap)
#define foreach_ssvm_api_error
static void ssvm_unlock(ssvm_shared_header_t *h)
u32 per_interface_next_index
static void * clib_mem_set_heap(void *heap)
Bitmaps built as vectors of machine words.
void ssvm_delete(ssvm_private_t *ssvm)
#define CLIB_MEMORY_BARRIER()
static void ssvm_lock(ssvm_shared_header_t *h, u32 my_pid, u32 tag)
CLIB vectors are ubiquitous dynamically resized arrays with by user defined "headers".