Private definitions for nmad core. More...

Go to the source code of this file.
Data Structures | |
| struct | nm_lazy_initializer_s |
| struct | nm_core_dispatching_event_s |
| an event ready for dispatch (matching already done) More... | |
| struct | nm_in_chunk_s |
| an incoming chunk of data More... | |
| struct | nm_chunk_injector_s |
| a chunk to be injected into nmad core More... | |
| struct | nm_unexpected_s |
| a chunk of unexpected message to be stored More... | |
Macros | |
| #define | NM_ALIGN_FRONTIER sizeof(NM_ALIGN_TYPE) |
| #define | nm_aligned(x) nm_aligned_n((x), NM_ALIGN_FRONTIER) |
| #define | nm_offset_of(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) |
| #define | nm_container_of(ptr, type, member) |
| #define | NM_IS_THREADED ((nm_core_get_thread_level(nm_core_get_singleton()) >= NM_THREAD_SERIALIZED) ? 1 : 0) |
| #define | NM_ALLOCATOR_TYPE(ENAME, TYPE) PUK_ALLOCATOR_TYPE_EXT(ENAME, TYPE, !NM_IS_THREADED) |
| #define | NM_TRK_SMALL ((nm_trk_id_t)0) |
| #define | NM_TRK_LARGE ((nm_trk_id_t)1) |
| #define | NM_TRK_NONE ((nm_trk_id_t)-1) |
| #define | NM_MAX_TRACKS 2 |
| #define | NM_SEQ_FIRST ((nm_seq_t)1) |
| First sequence number. | |
| #define | nm_profile_add(COUNTER, VALUE) do {} while(0) |
| #define | nm_profile_inc(COUNTER) nm_profile_add(COUNTER, 1) |
| #define | NM_LAZY_INITIALIZER_INIT { .init_done = 0, .initializing = 0 } |
| #define | NM_LAZY_INITIALIZER(ENAME, CTOR, DTOR) |
| factorize process for lazy initialization. | |
Functions | |
| static nm_len_t | nm_aligned_n (nm_len_t v, nm_len_t a) |
| static void * | nm_aligned_ptr (const void *p, nm_len_t a) |
| get a pointer aligned to given alignment a | |
| PUK_LIST_CREATE_FUNCS (nm_req) | |
| PUK_LIST_CREATE_FUNCS (nm_req_chunk) | |
| PUK_ALLOCATOR_TYPE_EXT (nm_req_chunk, struct nm_req_chunk_s, !((nm_core_get_thread_level(nm_core_get_singleton()) >=NM_THREAD_SERIALIZED) ? 1 :0)) | |
| allocator for request chunks | |
| PUK_LFQUEUE_TYPE (nm_pkt_wrap, struct nm_pkt_wrap_s *, NULL, 512) | |
| LF queue type for completed pw. | |
| static nm_seq_t | nm_seq_next (nm_seq_t seq) |
| Compute next sequence number. | |
| static int | nm_seq_compare (nm_seq_t current, nm_seq_t seq1, nm_seq_t seq2) |
| compare to seq numbers, assuming they are in the future returns -1 if seq1 is before seq2, 0 if equal, 1 if seq1 after seq2 | |
| static int | nm_seq_fuzzy_compare (nm_seq_t seq1, nm_seq_t seq2) |
| compare to seq numbers taking into account looping at overflow, assuming they are less than halftrip of overflow returns -1 if seq1 < seq2, 0 if equal, 1 if seq1 > seq2 | |
| PUK_VECT_TYPE (nm_core_monitor, struct nm_core_monitor_s *) | |
| PUK_LIST_TYPE (nm_core_pending_event, struct nm_core_event_s event;struct nm_core_monitor_s *p_core_monitor;) | |
| a pending event, not dispatched immediately because it was received out of order | |
| PUK_LFQUEUE_TYPE (nm_core_dispatching_event, struct nm_core_dispatching_event_s *, NULL, 1024) | |
| PUK_ALLOCATOR_TYPE_EXT (nm_core_dispatching_event, struct nm_core_dispatching_event_s, !((nm_core_get_thread_level(nm_core_get_singleton()) >=NM_THREAD_SERIALIZED) ? 1 :0)) | |
| PUK_LIST_DECLARE_TYPE2 (nm_unexpected_wildcard, struct nm_unexpected_s) | |
| PUK_LIST_DECLARE_TYPE2 (nm_unexpected_gtag, struct nm_unexpected_s) | |
| PUK_LIST_DECLARE_TYPE2 (nm_unexpected_gate, struct nm_unexpected_s) | |
| PUK_LIST_DECLARE_TYPE2 (nm_unexpected_tag, struct nm_unexpected_s) | |
| PUK_LIST_CREATE_FUNCS (nm_unexpected_wildcard) | |
| PUK_LIST_CREATE_FUNCS (nm_unexpected_gtag) | |
| PUK_LIST_CREATE_FUNCS (nm_unexpected_gate) | |
| PUK_LIST_CREATE_FUNCS (nm_unexpected_tag) | |
Detailed Description
Private definitions for nmad core.
This file is not installed and not part of the public API.
Definition in file nm_core_types.h.
Macro Definition Documentation
◆ NM_ALIGN_FRONTIER
| #define NM_ALIGN_FRONTIER sizeof(NM_ALIGN_TYPE) |
Definition at line 28 of file nm_core_types.h.
◆ nm_aligned
| #define nm_aligned | ( | x | ) | nm_aligned_n((x), NM_ALIGN_FRONTIER) |
Definition at line 29 of file nm_core_types.h.
◆ NM_ALLOCATOR_TYPE
| #define NM_ALLOCATOR_TYPE | ( | ENAME, | |
| TYPE | |||
| ) | PUK_ALLOCATOR_TYPE_EXT(ENAME, TYPE, !NM_IS_THREADED) |
Definition at line 58 of file nm_core_types.h.
◆ nm_container_of
| #define nm_container_of | ( | ptr, | |
| type, | |||
| member | |||
| ) |
Definition at line 44 of file nm_core_types.h.
◆ NM_IS_THREADED
| #define NM_IS_THREADED ((nm_core_get_thread_level(nm_core_get_singleton()) >= NM_THREAD_SERIALIZED) ? 1 : 0) |
Definition at line 53 of file nm_core_types.h.
◆ NM_LAZY_INITIALIZER
| #define NM_LAZY_INITIALIZER | ( | ENAME, | |
| CTOR, | |||
| DTOR | |||
| ) |
factorize process for lazy initialization.
- ENAME base name of variable to define
- CTOR function called as constructor when init is needede
- DTOR function called as destructor at application end.
Definition at line 163 of file nm_core_types.h.
◆ NM_LAZY_INITIALIZER_INIT
| #define NM_LAZY_INITIALIZER_INIT { .init_done = 0, .initializing = 0 } |
Definition at line 156 of file nm_core_types.h.
◆ NM_MAX_TRACKS
| #define NM_MAX_TRACKS 2 |
Definition at line 83 of file nm_core_types.h.
◆ nm_offset_of
| #define nm_offset_of | ( | TYPE, | |
| MEMBER | |||
| ) | ((size_t) &((TYPE *)0)->MEMBER) |
Definition at line 43 of file nm_core_types.h.
◆ nm_profile_add
| #define nm_profile_add | ( | COUNTER, | |
| VALUE | |||
| ) | do {} while(0) |
Definition at line 143 of file nm_core_types.h.
◆ nm_profile_inc
| #define nm_profile_inc | ( | COUNTER | ) | nm_profile_add(COUNTER, 1) |
Definition at line 146 of file nm_core_types.h.
◆ NM_SEQ_FIRST
| #define NM_SEQ_FIRST ((nm_seq_t)1) |
First sequence number.
Definition at line 88 of file nm_core_types.h.
◆ NM_TRK_LARGE
| #define NM_TRK_LARGE ((nm_trk_id_t)1) |
Definition at line 79 of file nm_core_types.h.
◆ NM_TRK_NONE
| #define NM_TRK_NONE ((nm_trk_id_t)-1) |
Definition at line 80 of file nm_core_types.h.
◆ NM_TRK_SMALL
| #define NM_TRK_SMALL ((nm_trk_id_t)0) |
Definition at line 78 of file nm_core_types.h.
Function Documentation
◆ nm_aligned_n()
Definition at line 31 of file nm_core_types.h.
◆ nm_aligned_ptr()
|
inlinestatic |
get a pointer aligned to given alignment a
Definition at line 38 of file nm_core_types.h.
◆ nm_seq_compare()
compare to seq numbers, assuming they are in the future returns -1 if seq1 is before seq2, 0 if equal, 1 if seq1 after seq2
Definition at line 102 of file nm_core_types.h.
References assert().

◆ nm_seq_fuzzy_compare()
compare to seq numbers taking into account looping at overflow, assuming they are less than halftrip of overflow returns -1 if seq1 < seq2, 0 if equal, 1 if seq1 > seq2
Definition at line 119 of file nm_core_types.h.
References NM_FATAL, and NM_SEQ_MAX.
◆ nm_seq_next()
Compute next sequence number.
Definition at line 91 of file nm_core_types.h.
References assert(), NM_SEQ_NONE, and seq.

◆ PUK_ALLOCATOR_TYPE_EXT() [1/2]
| PUK_ALLOCATOR_TYPE_EXT | ( | nm_core_dispatching_event | , |
| struct nm_core_dispatching_event_s | , | ||
| ! | (nm_core_get_thread_level(nm_core_get_singleton()) >=NM_THREAD_SERIALIZED) ? 1 :0 | ||
| ) |
◆ PUK_ALLOCATOR_TYPE_EXT() [2/2]
| PUK_ALLOCATOR_TYPE_EXT | ( | nm_req_chunk | , |
| struct nm_req_chunk_s | , | ||
| ! | (nm_core_get_thread_level(nm_core_get_singleton()) >=NM_THREAD_SERIALIZED) ? 1 :0 | ||
| ) |
allocator for request chunks
◆ PUK_LFQUEUE_TYPE() [1/2]
| PUK_LFQUEUE_TYPE | ( | nm_core_dispatching_event | , |
| struct nm_core_dispatching_event_s * | , | ||
| NULL | , | ||
| 1024 | |||
| ) |
◆ PUK_LFQUEUE_TYPE() [2/2]
| PUK_LFQUEUE_TYPE | ( | nm_pkt_wrap | , |
| struct nm_pkt_wrap_s * | , | ||
| NULL | , | ||
| 512 | |||
| ) |
LF queue type for completed pw.
◆ PUK_LIST_CREATE_FUNCS() [1/6]
| PUK_LIST_CREATE_FUNCS | ( | nm_req | ) |
◆ PUK_LIST_CREATE_FUNCS() [2/6]
| PUK_LIST_CREATE_FUNCS | ( | nm_req_chunk | ) |
◆ PUK_LIST_CREATE_FUNCS() [3/6]
| PUK_LIST_CREATE_FUNCS | ( | nm_unexpected_gate | ) |
◆ PUK_LIST_CREATE_FUNCS() [4/6]
| PUK_LIST_CREATE_FUNCS | ( | nm_unexpected_gtag | ) |
◆ PUK_LIST_CREATE_FUNCS() [5/6]
| PUK_LIST_CREATE_FUNCS | ( | nm_unexpected_tag | ) |
◆ PUK_LIST_CREATE_FUNCS() [6/6]
| PUK_LIST_CREATE_FUNCS | ( | nm_unexpected_wildcard | ) |
◆ PUK_LIST_DECLARE_TYPE2() [1/4]
| PUK_LIST_DECLARE_TYPE2 | ( | nm_unexpected_gate | , |
| struct nm_unexpected_s | |||
| ) |
◆ PUK_LIST_DECLARE_TYPE2() [2/4]
| PUK_LIST_DECLARE_TYPE2 | ( | nm_unexpected_gtag | , |
| struct nm_unexpected_s | |||
| ) |
◆ PUK_LIST_DECLARE_TYPE2() [3/4]
| PUK_LIST_DECLARE_TYPE2 | ( | nm_unexpected_tag | , |
| struct nm_unexpected_s | |||
| ) |
◆ PUK_LIST_DECLARE_TYPE2() [4/4]
| PUK_LIST_DECLARE_TYPE2 | ( | nm_unexpected_wildcard | , |
| struct nm_unexpected_s | |||
| ) |
◆ PUK_LIST_TYPE()
| PUK_LIST_TYPE | ( | nm_core_pending_event | , |
| struct nm_core_event_s event;struct nm_core_monitor_s *p_core_monitor; | |||
| ) |
a pending event, not dispatched immediately because it was received out of order
◆ PUK_VECT_TYPE()
| PUK_VECT_TYPE | ( | nm_core_monitor | , |
| struct nm_core_monitor_s * | |||
| ) |