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))
107 while (__sync_lock_test_and_set (&h->
lock, 1))
138 return ((
void *) oldheap);
147 #define foreach_ssvm_api_error \ 148 _(NO_NAME, "No shared segment name", -100) \ 149 _(NO_SIZE, "Size not set (master)", -101) \ 150 _(CREATE_FAILURE, "Create failed", -102) \ 151 _(SET_SIZE, "Set size failed", -103) \ 152 _(MMAP, "mmap failed", -104) \ 153 _(SLAVE_TIMEOUT, "Slave map timeout", -105) 157 #define _(n,s,c) SSVM_API_ERROR_##n = c, 162 #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_unlock_non_recursive(ssvm_shared_header_t *h)
static void ssvm_lock(ssvm_shared_header_t *h, u32 my_pid, u32 tag)
static void ssvm_lock_non_recursive(ssvm_shared_header_t *h, u32 tag)
CLIB vectors are ubiquitous dynamically resized arrays with by user defined "headers".