5 #ifndef RTE_LCORE_VAR_H 6 #define RTE_LCORE_VAR_H 26 #include <rte_config.h> 37 #define RTE_LCORE_VAR_HANDLE_TYPE(type) \ 52 #define RTE_LCORE_VAR_HANDLE(type, name) \ 53 RTE_LCORE_VAR_HANDLE_TYPE(type) name 60 #define RTE_LCORE_VAR_ALLOC_SIZE_ALIGN(handle, size, align) \ 61 handle = rte_lcore_var_alloc(size, align) 69 #define RTE_LCORE_VAR_ALLOC_SIZE(handle, size) \ 70 RTE_LCORE_VAR_ALLOC_SIZE_ALIGN(handle, size, 0) 78 #define RTE_LCORE_VAR_ALLOC(handle) \ 79 RTE_LCORE_VAR_ALLOC_SIZE_ALIGN(handle, sizeof(*(handle)), \ 80 alignof(typeof(*(handle)))) 88 #define RTE_LCORE_VAR_INIT_SIZE_ALIGN(name, size, align) \ 89 RTE_INIT(rte_lcore_var_init_ ## name) \ 91 RTE_LCORE_VAR_ALLOC_SIZE_ALIGN(name, size, align); \ 100 #define RTE_LCORE_VAR_INIT_SIZE(name, size) \ 101 RTE_LCORE_VAR_INIT_SIZE_ALIGN(name, size, 0) 108 #define RTE_LCORE_VAR_INIT(name) \ 109 RTE_INIT(rte_lcore_var_init_ ## name) \ 111 RTE_LCORE_VAR_ALLOC(name); \ 129 RTE_ASSERT(handle != NULL);
130 return RTE_PTR_ADD(handle, lcore_id * RTE_MAX_LCORE_VAR);
145 #define RTE_LCORE_VAR_LCORE(lcore_id, handle) \ 146 ((typeof(handle))rte_lcore_var_lcore(lcore_id, handle)) 153 #define RTE_LCORE_VAR(handle) \ 154 RTE_LCORE_VAR_LCORE(rte_lcore_id(), handle) 168 #define RTE_LCORE_VAR_FOREACH(lcore_id, value, handle) \ 170 (((value) = RTE_LCORE_VAR_LCORE(0, handle)), 0); \ 171 (lcore_id) < RTE_MAX_LCORE; \ 172 (lcore_id)++, (value) = RTE_LCORE_VAR_LCORE(lcore_id, \ #define RTE_PTR_ADD(ptr, x)
#define __rte_alloc_size(...)
#define __rte_alloc_align(argno)
__rte_experimental void * rte_lcore_var_alloc(size_t size, size_t align) __rte_alloc_size(1) __rte_alloc_align(2)
static void * rte_lcore_var_lcore(unsigned int lcore_id, void *handle)