EM-ODP  3.7.0
Event Machine on ODP
em_event_state.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define EVGEN_INIT   ((uint16_t)0x1000)
 
#define EVGEN_MAX   ((uint16_t)UINT16_MAX - 0x1000)
 
#define SEND_CNT_INIT   ((uint16_t)0x8000) /* = 0 + 'offset' */
 
#define REF_CNT_INIT   ((uint16_t)0x8000) /* = 0 + 'offset' */
 
#define REF_CNT_MAX   ((uint16_t)UINT16_MAX - 0x1000)
 

Enumerations

enum  esv_apiop_t {
  EVSTATE__UNDEF = 0, EVSTATE__PREALLOC, EVSTATE__ALLOC, EVSTATE__ALLOC_MULTI,
  EVSTATE__EVENT_CLONE, EVSTATE__EVENT_REF, EVSTATE__FREE, EVSTATE__FREE_MULTI,
  EVSTATE__EVENT_VECTOR_FREE, EVSTATE__INIT, EVSTATE__INIT_MULTI, EVSTATE__INIT_EXTEV,
  EVSTATE__INIT_EXTEV_MULTI, EVSTATE__UPDATE_EXTEV, EVSTATE__SEND, EVSTATE__SEND__FAIL,
  EVSTATE__SEND_EGRP, EVSTATE__SEND_EGRP__FAIL, EVSTATE__SEND_MULTI, EVSTATE__SEND_MULTI__FAIL,
  EVSTATE__SEND_EGRP_MULTI, EVSTATE__SEND_EGRP_MULTI__FAIL, EVSTATE__EO_START_SEND_BUFFERED, EVSTATE__MARK_SEND,
  EVSTATE__UNMARK_SEND, EVSTATE__MARK_FREE, EVSTATE__UNMARK_FREE, EVSTATE__MARK_FREE_MULTI,
  EVSTATE__UNMARK_FREE_MULTI, EVSTATE__DISPATCH, EVSTATE__DISPATCH_MULTI, EVSTATE__DISPATCH_SCHED__FAIL,
  EVSTATE__DISPATCH_LOCAL__FAIL, EVSTATE__DEQUEUE, EVSTATE__DEQUEUE_MULTI, EVSTATE__TMO_SET_ABS,
  EVSTATE__TMO_SET_ABS__FAIL, EVSTATE__TMO_SET_REL, EVSTATE__TMO_SET_REL__FAIL, EVSTATE__TMO_SET_PERIODIC,
  EVSTATE__TMO_SET_PERIODIC__FAIL, EVSTATE__TMO_CANCEL, EVSTATE__TMO_ACK, EVSTATE__TMO_ACK__NOSKIP,
  EVSTATE__TMO_ACK__FAIL, EVSTATE__TMO_CREATE, EVSTATE__TMO_DELETE, EVSTATE__AG_DELETE,
  EVSTATE__TERM_CORE__QUEUE_LOCAL, EVSTATE__TERM, EVSTATE__LAST
}
 ESV API operation IDs.
 

Functions

 COMPILE_TIME_ASSERT (EVSTATE__LAST<=UINT8_MAX, EVSTATE__LAST__TOO_BIG)
 
em_status_t esv_init (void)
 
void esv_disabled_warn_config (void)
 
em_event_t evstate_prealloc (const em_event_t event, event_hdr_t *const ev_hdr)
 
em_event_t evstate_alloc_tmo (const em_event_t event, event_hdr_t *const ev_hdr)
 
em_event_t evstate_alloc (const em_event_t event, event_hdr_t *const ev_hdr, const uint16_t api_op)
 
void evstate_alloc_multi (em_event_t ev_tbl[], event_hdr_t *const ev_hdr_tbl[], const int num)
 
em_event_t evstate_ref (const em_event_t event, event_hdr_t *const ev_hdr)
 
em_event_t evstate_init (const em_event_t event, event_hdr_t *const ev_hdr, bool is_extev)
 
void evstate_init_multi (em_event_t ev_tbl[], event_hdr_t *const ev_hdr_tbl[], const int num, bool is_extev)
 
em_event_t evstate_update (const em_event_t event, event_hdr_t *const ev_hdr, bool is_extev)
 
void evstate_free (em_event_t event, event_hdr_t *const ev_hdr, const uint16_t api_op)
 
void evstate_free_revert (em_event_t event, event_hdr_t *const ev_hdr, const uint16_t api_op)
 
void evstate_free_multi (const em_event_t ev_tbl[], event_hdr_t *const ev_hdr_tbl[], const int num, const uint16_t api_op)
 
void evstate_free_revert_multi (const em_event_t ev_tbl[], event_hdr_t *const ev_hdr_tbl[], const int num, const uint16_t api_op)
 
em_event_t evstate_em2usr (em_event_t event, event_hdr_t *const ev_hdr, const uint16_t api_op)
 
em_event_t evstate_em2usr_revert (em_event_t event, event_hdr_t *const ev_hdr, const uint16_t api_op)
 
void evstate_em2usr_multi (em_event_t ev_tbl[], event_hdr_t *const ev_hdr_tbl[], const int num, const uint16_t api_op)
 
void evstate_em2usr_revert_multi (em_event_t ev_tbl[], event_hdr_t *const ev_hdr_tbl[], const int num, const uint16_t api_op)
 
void evstate_usr2em (em_event_t event, event_hdr_t *const ev_hdr, const uint16_t api_op)
 
void evstate_usr2em_revert (em_event_t event, event_hdr_t *const ev_hdr, const uint16_t api_op)
 
void evstate_usr2em_multi (const em_event_t ev_tbl[], event_hdr_t *const ev_hdr_tbl[], const int num, const uint16_t api_op)
 
void evstate_usr2em_revert_multi (const em_event_t ev_tbl[], event_hdr_t *const ev_hdr_tbl[], const int num, const uint16_t api_op)
 
void evstate_unmark_send (const em_event_t event, event_hdr_t *const ev_hdr)
 
void evstate_unmark_free (const em_event_t event, event_hdr_t *const ev_hdr, const uint16_t api_op)
 
void evstate_unmark_free_multi (const em_event_t ev_tbl[], event_hdr_t *const ev_hdr_tbl[], const int num, const uint16_t api_op)
 

Detailed Description

EM event state verification support

Definition in file em_event_state.h.

Macro Definition Documentation

◆ EVGEN_INIT

#define EVGEN_INIT   ((uint16_t)0x1000)

Init values for the event-state counters.

The counters are 16-bit but are updated as one combined 64-bit atomic var, thus the init values are in the middle of the u16-range to avoid wraparounds when decrementing below '0'. Initial event generation value

Definition at line 111 of file em_event_state.h.

◆ EVGEN_MAX

#define EVGEN_MAX   ((uint16_t)UINT16_MAX - 0x1000)

Max evgen value before resetting to 'EVGEN_INIT' to avoid wrap

Definition at line 113 of file em_event_state.h.

◆ REF_CNT_INIT

#define REF_CNT_INIT   ((uint16_t)0x8000) /* = 0 + 'offset' */

Initial reference count value

Definition at line 117 of file em_event_state.h.

◆ REF_CNT_MAX

#define REF_CNT_MAX   ((uint16_t)UINT16_MAX - 0x1000)

Max reference count before resetting to 'REF_CNT_INIT' to avoid wrap

Definition at line 119 of file em_event_state.h.

◆ SEND_CNT_INIT

#define SEND_CNT_INIT   ((uint16_t)0x8000) /* = 0 + 'offset' */

Initial send count value

Definition at line 115 of file em_event_state.h.

Function Documentation

◆ esv_disabled_warn_config()

void esv_disabled_warn_config ( void  )

In the case that ESV has been disabled during compile time, verify that the compile-time option and runtime config file options do not clash - warn the user otherwise!

The user might not notice that the run time config file option has no effect if ESV has been disabled during compile time. The warning printed at startup is meant to notify the user that ESV will be disabled no matter the content in the run time config file.

Definition at line 1210 of file em_event_state.c.

◆ esv_init()

em_status_t esv_init ( void  )

Init ESV (if enabled at compile time), read config options

Definition at line 1202 of file em_event_state.c.

◆ evstate_alloc()

em_event_t evstate_alloc ( const em_event_t  event,
event_hdr_t *const  ev_hdr,
const uint16_t  api_op 
)

Set the initial event state during em_alloc() / em_event_clone()

Definition at line 738 of file em_event_state.c.

◆ evstate_alloc_multi()

void evstate_alloc_multi ( em_event_t  ev_tbl[],
event_hdr_t *const  ev_hdr_tbl[],
const int  num 
)

Set the initial state of multiple events during em_alloc_multi()

Definition at line 755 of file em_event_state.c.

◆ evstate_alloc_tmo()

em_event_t evstate_alloc_tmo ( const em_event_t  event,
event_hdr_t *const  ev_hdr 
)

Set the initial event state during timeout allocation.

Definition at line 750 of file em_event_state.c.

◆ evstate_em2usr()

em_event_t evstate_em2usr ( em_event_t  event,
event_hdr_t *const  ev_hdr,
const uint16_t  api_op 
)

Check & update event state - event passed from EM to user.

em_dispatch(), em_queue_dequeue(), em_tmo_cancel(), em_tmo_delete()

Definition at line 952 of file em_event_state.c.

◆ evstate_em2usr_multi()

void evstate_em2usr_multi ( em_event_t  ev_tbl[],
event_hdr_t *const  ev_hdr_tbl[],
const int  num,
const uint16_t  api_op 
)

Check & update the state of multiple events - events passed from EM to user

em_dispatch(), em_queue_dequeue_multi(), em_term()

Definition at line 970 of file em_event_state.c.

◆ evstate_em2usr_revert()

em_event_t evstate_em2usr_revert ( em_event_t  event,
event_hdr_t *const  ev_hdr,
const uint16_t  api_op 
)

Revert EM-to-user event-state update on failed operation.

Definition at line 961 of file em_event_state.c.

◆ evstate_em2usr_revert_multi()

void evstate_em2usr_revert_multi ( em_event_t  ev_tbl[],
event_hdr_t *const  ev_hdr_tbl[],
const int  num,
const uint16_t  api_op 
)

Revert EM-to-user event-state updates on failed operation.

Definition at line 980 of file em_event_state.c.

◆ evstate_free()

void evstate_free ( em_event_t  event,
event_hdr_t *const  ev_hdr,
const uint16_t  api_op 
)

Check & update event state during em_free() or em_event_mark_free()

Definition at line 914 of file em_event_state.c.

◆ evstate_free_multi()

void evstate_free_multi ( const em_event_t  ev_tbl[],
event_hdr_t *const  ev_hdr_tbl[],
const int  num,
const uint16_t  api_op 
)

Check & update the state of multiple events during em_free_multi() or em_event_mark_free_multi()

Definition at line 932 of file em_event_state.c.

◆ evstate_free_revert()

void evstate_free_revert ( em_event_t  event,
event_hdr_t *const  ev_hdr,
const uint16_t  api_op 
)

Check & update event state during em_event_unmark_free()

Definition at line 923 of file em_event_state.c.

◆ evstate_free_revert_multi()

void evstate_free_revert_multi ( const em_event_t  ev_tbl[],
event_hdr_t *const  ev_hdr_tbl[],
const int  num,
const uint16_t  api_op 
)

Check & update event state during em_event_unmark_free_multi()

Definition at line 942 of file em_event_state.c.

◆ evstate_init()

em_event_t evstate_init ( const em_event_t  event,
event_hdr_t *const  ev_hdr,
bool  is_extev 
)

Set the initial state for an event (e.g. an new odp-event converted into an EM-event)

Definition at line 788 of file em_event_state.c.

◆ evstate_init_multi()

void evstate_init_multi ( em_event_t  ev_tbl[],
event_hdr_t *const  ev_hdr_tbl[],
const int  num,
bool  is_extev 
)

Set the initial state for events (e.g. new odp-events converted into EM-events)

Definition at line 797 of file em_event_state.c.

◆ evstate_prealloc()

em_event_t evstate_prealloc ( const em_event_t  event,
event_hdr_t *const  ev_hdr 
)

Set the initial event state during em_pool_create() when preallocating events

Definition at line 733 of file em_event_state.c.

◆ evstate_ref()

em_event_t evstate_ref ( const em_event_t  event,
event_hdr_t *const  ev_hdr 
)

Update event state during em_event_ref()

Definition at line 780 of file em_event_state.c.

◆ evstate_unmark_free()

void evstate_unmark_free ( const em_event_t  event,
event_hdr_t *const  ev_hdr,
const uint16_t  api_op 
)

Check & update event state during em_event_unmark_free()

Wrapper function for evstate_free_revert(..., EVSTATE__UNMARK_FREE) with extra error checks.

Definition at line 1094 of file em_event_state.c.

◆ evstate_unmark_free_multi()

void evstate_unmark_free_multi ( const em_event_t  ev_tbl[],
event_hdr_t *const  ev_hdr_tbl[],
const int  num,
const uint16_t  api_op 
)

Check & update event state for multiple events during em_event_unmark_free_multi()

Wrapper function for evstate_free_revert_multi(..., EVSTATE__UNMARK_FREE_MULTI) with extra error checks.

Definition at line 1110 of file em_event_state.c.

◆ evstate_unmark_send()

void evstate_unmark_send ( const em_event_t  event,
event_hdr_t *const  ev_hdr 
)

Check & update event state during em_event_unmark_send()

Wrapper function for evstate_usr2em_revert(..., EVSTATE__UNMARK_SEND) with extra error checks.

Definition at line 1079 of file em_event_state.c.

◆ evstate_update()

em_event_t evstate_update ( const em_event_t  event,
event_hdr_t *const  ev_hdr,
bool  is_extev 
)

Update the state for external events input into EM. Used when esv.prealloc_pools = true and the input event was allocated externally to EM (e.g. by ODP) but from an EM event-pool.

Definition at line 895 of file em_event_state.c.

◆ evstate_usr2em()

void evstate_usr2em ( em_event_t  event,
event_hdr_t *const  ev_hdr,
const uint16_t  api_op 
)

Check & update event state - event passed from the user to EM.

em_send(), em_send_group(), em_tmo_set_abs/rel/periodic(), em_tmo_ack()

Definition at line 990 of file em_event_state.c.

◆ evstate_usr2em_multi()

void evstate_usr2em_multi ( const em_event_t  ev_tbl[],
event_hdr_t *const  ev_hdr_tbl[],
const int  num,
const uint16_t  api_op 
)

Check & update the state of multiple events - events passed from user to EM

em_send_multi(), em_send_group_multi()

Definition at line 1008 of file em_event_state.c.

◆ evstate_usr2em_revert()

void evstate_usr2em_revert ( em_event_t  event,
event_hdr_t *const  ev_hdr,
const uint16_t  api_op 
)

Revert user-to-EM event-state update on failed operation.

Definition at line 999 of file em_event_state.c.

◆ evstate_usr2em_revert_multi()

void evstate_usr2em_revert_multi ( const em_event_t  ev_tbl[],
event_hdr_t *const  ev_hdr_tbl[],
const int  num,
const uint16_t  api_op 
)

Revert user-to-EM event-state updates on failed operation.

Definition at line 1018 of file em_event_state.c.