15 #ifndef __included_ssvm_fifo_segment_h__ 16 #define __included_ssvm_fifo_segment_h__ 30 #define FIFO_SEGMENT_MIN_FIFO_SIZE 4096 31 #define FIFO_SEGMENT_MAX_FIFO_SIZE (2 << 30) 32 #define FIFO_SEGMENT_ALLOC_CHUNK_SIZE 32 34 #define FIFO_SEGMENT_F_IS_PREALLOCATED (1 << 0) 35 #define FIFO_SEGMENT_F_WILL_DELETE (1 << 1) 71 #define svm_fifo_segment_flags(_seg) _seg->h->flags 82 return fifo_segment->
h->
fifos != 0;
88 return fifo_segment->
h->
fifos;
107 u32 data_size_in_bytes,
113 u32 timeout_in_seconds);
118 fifo_segment,
u32 fifo_size_in_bytes);
svm_fifo_segment_freelist_t
svm_fifo_segment_private_t * svm_fifo_segment_segments_pool(svm_fifo_segment_main_t *sm)
Retrieve svm segments pool.
int svm_fifo_segment_create(svm_fifo_segment_main_t *sm, svm_fifo_segment_create_args_t *a)
Create an svm fifo segment and initialize as master.
struct _svm_fifo svm_fifo_t
enum ssvm_segment_type_ ssvm_segment_type_t
format_function_t format_svm_fifo_segment
ssvm_segment_type_t segment_type
svm_fifo_t * svm_fifo_segment_alloc_fifo(svm_fifo_segment_private_t *s, u32 data_size_in_bytes, svm_fifo_segment_freelist_t index)
Allocate fifo in svm segment.
static svm_fifo_t * svm_fifo_segment_get_fifo_list(svm_fifo_segment_private_t *fifo_segment)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
svm_fifo_segment_header_t * h
void svm_fifo_segment_main_init(svm_fifo_segment_main_t *sm, u64 baseva, u32 timeout_in_seconds)
format_function_t format_svm_fifo_segment_type
static u8 svm_fifo_segment_has_fifos(svm_fifo_segment_private_t *fifo_segment)
void svm_fifo_segment_free_fifo(svm_fifo_segment_private_t *s, svm_fifo_t *f, svm_fifo_segment_freelist_t index)
static svm_fifo_segment_private_t * svm_fifo_segment_get_segment(svm_fifo_segment_main_t *sm, u32 segment_index)
u32 * new_segment_indices
int svm_fifo_segment_init(svm_fifo_segment_private_t *s)
Initialize svm fifo segment shared header.
u32 svm_fifo_segment_num_free_fifos(svm_fifo_segment_private_t *fifo_segment, u32 fifo_size_in_bytes)
int svm_fifo_segment_create_process_private(svm_fifo_segment_main_t *sm, svm_fifo_segment_create_args_t *)
Create an svm fifo segment in process-private memory.
svm_fifo_segment_private_t * segments
pool of segments
void svm_fifo_segment_info(svm_fifo_segment_private_t *seg, char **address, size_t *size)
void svm_fifo_segment_preallocate_fifo_pairs(svm_fifo_segment_private_t *s, u32 rx_fifo_size, u32 tx_fifo_size, u32 *n_fifo_pairs)
Pre-allocates fifo pairs in fifo segment.
u32 svm_fifo_segment_num_fifos(svm_fifo_segment_private_t *fifo_segment)
Get number of active fifos.
u32 svm_fifo_segment_index(svm_fifo_segment_main_t *sm, svm_fifo_segment_private_t *s)
int svm_fifo_segment_attach(svm_fifo_segment_main_t *sm, svm_fifo_segment_create_args_t *a)
Attach as slave to an svm fifo segment.
void svm_fifo_segment_delete(svm_fifo_segment_main_t *sm, svm_fifo_segment_private_t *s)