1 #ifndef __ADF_OS_DEFER_PVT_H
2 #define __ADF_OS_DEFER_PVT_H
4 #include <adf_os_types.h>
6 #include "Magpie_api.h"
9 * Because the real function taked an extra int :(
12 adf_os_defer_fn_t caller_fn;
14 }__adf_os_defer_ctx_t;
17 * wrapper around the real task func
21 __adf_os_defer_ctx_t ctx;
24 //typedef __adf_os_defer_t __adf_os_bh_t;
25 typedef A_tasklet_t __adf_os_bh_t;
26 typedef __adf_os_defer_t __adf_os_work_t;
31 extern void __adf_os_defer_func(void *arg, int pending);
34 * @brief initiallize the defer function (work or bh)
40 static inline void __adf_os_init_defer(__adf_os_defer_t *defer,
41 adf_os_defer_fn_t func,
44 defer->ctx.caller_fn = func;
45 defer->ctx.caller_arg = arg;
47 //TASK_INIT(&defer->tsk, 0, __adf_os_defer_func, &defer->ctx);
50 static inline void __adf_os_init_work(adf_os_handle_t hdl,
51 __adf_os_work_t *work,
52 adf_os_defer_fn_t func,
55 __adf_os_init_defer(work, func, arg);
58 static inline void __adf_os_init_bh(adf_os_handle_t hdl,
60 adf_os_defer_fn_t func,
63 //__adf_os_init_defer(bh, func, arg);
64 A_TASKLET_INIT_TASK(func, arg, bh);
66 static inline void __adf_os_sched_work(adf_os_handle_t hdl,
67 __adf_os_work_t * work)
69 //taskqueue_enqueue(taskqueue_thread, &work->tsk);
71 static inline void __adf_os_disable_work(adf_os_handle_t hdl,
72 __adf_os_work_t * work)
74 //taskqueue_drain(taskqueue_thread, &work->tsk);
77 static inline void __adf_os_sched_bh(adf_os_handle_t hdl,
80 A_TASKLET_SCHEDULE(bh);
83 static inline void __adf_os_disable_bh(adf_os_handle_t hdl,
86 A_TASKLET_DISABLE(bh);