66 call_api_hooks_alloc(
const em_event_t events[],
const int num_act,
74 alloc_hook_fn = alloc_hook_tbl->tbl[i].alloc;
75 if (alloc_hook_fn == NULL)
77 alloc_hook_fn(events, num_act, num_req, size, type, pool);
82 call_api_hooks_free(
const em_event_t events[],
const int num)
88 free_hook_fn = free_hook_tbl->tbl[i].free;
89 if (free_hook_fn == NULL)
91 free_hook_fn(events, num);
96 call_api_hooks_send(
const em_event_t events[],
const int num,
97 em_queue_t queue, em_event_group_t event_group)
103 send_hook_fn = send_hook_tbl->tbl[i].send;
104 if (send_hook_fn == NULL)
106 send_hook_fn(events, num, queue, event_group);
110 static inline void call_idle_hooks_to_idle(uint64_t to_idle_delay_ns)
116 to_idle_hook_fn = to_idle_hook_tbl->tbl[i].to_idle;
117 if (to_idle_hook_fn == NULL)
119 to_idle_hook_fn(to_idle_delay_ns);
123 static inline void call_idle_hooks_to_active(
void)
129 to_active_hook_fn = to_active_hook_tbl->tbl[i].to_active;
130 if (to_active_hook_fn == NULL)
136 static inline void call_idle_hooks_while_idle(
void)
142 while_idle_hook_fn = while_idle_hook_tbl->tbl[i].while_idle;
143 if (while_idle_hook_fn == NULL)
145 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