1 /***** the library wide include file *****/
\r
2 #include "lfds601_internal.h"
\r
4 /***** pragmas *****/
\r
6 /***** defines *****/
\r
7 #define LFDS601_QUEUE_STATE_UNKNOWN -1
\r
8 #define LFDS601_QUEUE_STATE_EMPTY 0
\r
9 #define LFDS601_QUEUE_STATE_ENQUEUE_OUT_OF_PLACE 1
\r
10 #define LFDS601_QUEUE_STATE_ATTEMPT_DELFDS601_QUEUE 2
\r
12 #define LFDS601_QUEUE_POINTER 0
\r
13 #define LFDS601_QUEUE_COUNTER 1
\r
14 #define LFDS601_QUEUE_PAC_SIZE 2
\r
16 /***** structures *****/
\r
17 #pragma pack( push, LFDS601_ALIGN_DOUBLE_POINTER )
\r
19 struct lfds601_queue_state
\r
21 struct lfds601_queue_element
\r
22 *volatile enqueue[LFDS601_QUEUE_PAC_SIZE],
\r
23 *volatile dequeue[LFDS601_QUEUE_PAC_SIZE];
\r
28 struct lfds601_freelist_state
\r
32 struct lfds601_queue_element
\r
34 // TRD : next in a lfds601_queue requires volatile as it is target of CAS
\r
35 struct lfds601_queue_element
\r
36 *volatile next[LFDS601_QUEUE_PAC_SIZE];
\r
38 struct lfds601_freelist_element
\r
47 /***** externs *****/
\r
49 /***** private prototypes *****/
\r
50 int lfds601_queue_internal_freelist_init_function( void **user_data, void *user_state );
\r
51 void lfds601_queue_internal_freelist_delete_function( void *user_data, void *user_state );
\r
53 void lfds601_queue_internal_new_element_from_freelist( struct lfds601_queue_state *qs, struct lfds601_queue_element *qe[LFDS601_QUEUE_PAC_SIZE], void *user_data );
\r
54 void lfds601_queue_internal_guaranteed_new_element_from_freelist( struct lfds601_queue_state *qs, struct lfds601_queue_element * qe[LFDS601_QUEUE_PAC_SIZE], void *user_data );
\r
55 void lfds601_queue_internal_init_element( struct lfds601_queue_state *qs, struct lfds601_queue_element *qe[LFDS601_QUEUE_PAC_SIZE], struct lfds601_freelist_element *fe, void *user_data );
\r
57 void lfds601_queue_internal_queue( struct lfds601_queue_state *qs, struct lfds601_queue_element *qe[LFDS601_QUEUE_PAC_SIZE] );
\r
59 void lfds601_queue_internal_validate( struct lfds601_queue_state *qs, struct lfds601_validation_info *vi, enum lfds601_data_structure_validity *lfds601_queue_validity, enum lfds601_data_structure_validity *lfds601_freelist_validity );
\r