73call_api_hooks_alloc(
const em_event_t events[],
const int num_act,
81 alloc_hook_fn = alloc_hook_tbl->tbl[i].alloc;
82 if (alloc_hook_fn == NULL)
84 alloc_hook_fn(events, num_act, num_req, size, type, pool);
89call_api_hooks_free(
const em_event_t events[],
const int num)
95 free_hook_fn = free_hook_tbl->tbl[i].free;
96 if (free_hook_fn == NULL)
98 free_hook_fn(events, num);
103call_api_hooks_send(
const em_event_t events[],
const int num,
104 em_queue_t queue, em_event_group_t event_group)
110 send_hook_fn = send_hook_tbl->tbl[i].send;
111 if (send_hook_fn == NULL)
113 send_hook_fn(events, num, queue, event_group);
117static inline void call_idle_hooks_to_idle(uint64_t to_idle_delay_ns)
123 to_idle_hook_fn = to_idle_hook_tbl->tbl[i].to_idle;
124 if (to_idle_hook_fn == NULL)
126 to_idle_hook_fn(to_idle_delay_ns);
130static inline void call_idle_hooks_to_active(
void)
136 to_active_hook_fn = to_active_hook_tbl->tbl[i].to_active;
137 if (to_active_hook_fn == NULL)
143static inline void call_idle_hooks_while_idle(
void)
149 while_idle_hook_fn = while_idle_hook_tbl->tbl[i].while_idle;
150 if (while_idle_hook_fn == NULL)
152 while_idle_hook_fn();
em_status_t hooks_init(const em_api_hooks_t *api_hooks, const em_idle_hooks_t *idle_hooks)
em_status_t hook_unregister(uint8_t type, hook_fn_t hook_fn)
em_status_t hook_register(uint8_t type, hook_fn_t hook_fn)
void(* em_idle_hook_while_idle_t)(void)
void(* em_idle_hook_to_active_t)(void)
void(* em_api_hook_send_t)(const em_event_t events[], int num, em_queue_t queue, em_event_group_t event_group)
void(* em_idle_hook_to_idle_t)(uint64_t to_idle_delay_ns)
void(* em_api_hook_alloc_t)(const em_event_t events[], int num_act, int num_req, uint32_t size, em_event_type_t type, em_pool_t pool)
void(* em_api_hook_free_t)(const em_event_t events[], int num)
hook_tbl_t * alloc_hook_tbl
hook_tbl_t * to_idle_hook_tbl
hook_tbl_t * to_active_hook_tbl
hook_tbl_t * while_idle_hook_tbl
hook_tbl_t * free_hook_tbl
hook_tbl_t * send_hook_tbl