37 #ifndef EM_ATOMIC_GROUP_H_
38 #define EM_ATOMIC_GROUP_H_
44 #define invalid_atomic_group(atomic_group) \
45 ((unsigned int)agrp_hdl2idx((atomic_group)) >= EM_MAX_ATOMIC_GROUPS)
55 atomic_group_free(em_atomic_group_t atomic_group);
59 void atomic_group_dispatch(odp_event_t odp_evtbl[],
const int num_events,
69 agrp_hdl2idx(
const em_atomic_group_t atomic_group)
71 return (
int)((uintptr_t)atomic_group - 1);
74 static inline em_atomic_group_t
75 agrp_idx2hdl(
const int atomic_group_index)
77 return (em_atomic_group_t)(uintptr_t)(atomic_group_index + 1);
81 atomic_group_elem_get(
const em_atomic_group_t atomic_group)
83 const int ag_idx = agrp_hdl2idx(atomic_group);
89 ag_elem = &
em_shm->atomic_group_tbl.ag_elem[ag_idx];
98 env_spinlock_lock(&ag_elem->lock);
101 env_spinlock_unlock(&ag_elem->lock);
108 env_spinlock_lock(&ag_elem->lock);
113 env_spinlock_unlock(&ag_elem->lock);
117 atomic_group_release(
void)
121 em_atomic_group_t atomic_group = q_elem->agrp.
atomic_group;
125 env_spinlock_unlock(&agrp_elem->lock);
129 atomic_group_count(
void);
137 void print_ag_elem_info(
void);