25#if VSF_USE_KERNEL == ENABLED
37#if defined(__VSF_EDA_CLASS_IMPLEMENT)
38# define __VSF_CLASS_IMPLEMENT__
39#elif defined(__VSF_EDA_CLASS_INHERIT__)
40# define __VSF_CLASS_INHERIT__
51#define VSF_SYNC_AUTO_RST 0x0000
52#define VSF_SYNC_MANUAL_RST 0x8000
53#define VSF_SYNC_HAS_OWNER 0x8000
55#define VSF_SYNC_MAX 0x7FFF
57#ifndef VSF_KERNEL_CFG_EDA_USER_BITLEN
58# define VSF_KERNEL_CFG_EDA_USER_BITLEN 5
64#define __vsf_eda_sem_init2(__psem, __init_cnt, __max_cnt) \
65 vsf_eda_sync_init((__psem), (__init_cnt), (__max_cnt) | VSF_SYNC_AUTO_RST)
66#define __vsf_eda_sem_init1(__psem, __init_cnt) \
67 __vsf_eda_sem_init2((__psem), (__init_cnt), VSF_SYNC_MAX)
68#define __vsf_eda_sem_init0(__psem) \
69 __vsf_eda_sem_init1((__psem), 0)
71#define vsf_eda_sem_init(__psem, ...) \
72 __PLOOC_EVAL(__vsf_eda_sem_init, __VA_ARGS__)((__psem), ##__VA_ARGS__)
74#define vsf_eda_sem_post(__psem) vsf_eda_sync_increase((__psem))
76#define __vsf_eda_sem_pend1(__psem, __timeout) vsf_eda_sync_decrease((__psem), (__timeout))
77#define __vsf_eda_sem_pend0(__psem) __vsf_eda_sem_pend1((__psem), -1)
79#define vsf_eda_sem_pend(__psem, ...) \
80 __PLOOC_EVAL(__vsf_eda_sem_pend, __VA_ARGS__)((__psem), ##__VA_ARGS__)
82#if VSF_SYNC_CFG_SUPPORT_ISR == ENABLED
83# define vsf_eda_sem_post_isr(__psem) vsf_eda_sync_increase_isr((__psem))
87#define vsf_eda_mutex_init(__pmtx) \
88 vsf_eda_sync_init( &((__pmtx)->use_as__vsf_sync_t), \
89 1 | VSF_SYNC_HAS_OWNER, \
90 1 | VSF_SYNC_AUTO_RST)
92#define __vsf_eda_mutex_enter1(__pmtx, __timeout) \
93 vsf_eda_sync_decrease(&((__pmtx)->use_as__vsf_sync_t), (__timeout))
94#define __vsf_eda_mutex_enter0(__pmtx) __vsf_eda_mutex_enter1((__pmtx), -1)
96#define vsf_eda_mutex_enter(__pmtx, ...) \
97 __PLOOC_EVAL(__vsf_eda_mutex_enter, __VA_ARGS__)((__pmtx), ##__VA_ARGS__)
99#define vsf_eda_mutex_leave(__pmtx) \
100 vsf_eda_sync_increase(&((__pmtx)->use_as__vsf_sync_t))
101#if VSF_SYNC_CFG_SUPPORT_ISR == ENABLED
102# define vsf_eda_mutex_leave_isr(__pmtx) vsf_eda_sync_increase_isr(&(__pmtx)->use_as__vsf_sync_t)
106#define vsf_eda_crit_init(__pcrit) \
107 vsf_eda_mutex_init((__pcrit))
109#define __vsf_eda_crit_enter1(__pcrit, __timeout) \
110 vsf_eda_mutex_enter((__pcrit), (__timeout))
111#define __vsf_eda_crit_enter0(__pcrit) __vsf_eda_crit_enter1((__pcrit), -1)
113#define vsf_eda_crit_enter(__pcrit, ...) \
114 __PLOOC_EVAL(__vsf_eda_crit_enter, __VA_ARGS__)((__pcrit), ##__VA_ARGS__)
116#define vsf_eda_crit_leave(__pcrit) \
117 vsf_eda_mutex_leave((__pcrit))
120#define vsf_eda_trig_init(__pevt, __set, __auto_rst) \
121 vsf_eda_sync_init((__pevt), (__set), \
122 1 | ((__auto_rst) ? VSF_SYNC_AUTO_RST : VSF_SYNC_MANUAL_RST))
124#define vsf_eda_trig_set0(__pevt) vsf_eda_sync_increase((__pevt))
125#define vsf_eda_trig_set1(__pevt, __manual) \
126 __vsf_eda_sync_increase_ex((__pevt), NULL, (__manual))
129#define vsf_eda_trig_set(__pevt, ...) \
130 __PLOOC_EVAL(vsf_eda_trig_set, __VA_ARGS__)((__pevt), ##__VA_ARGS__)
132#define vsf_eda_trig_reset(__pevt) vsf_eda_sync_force_reset((__pevt))
134#define __vsf_eda_trig_wait1(__pevt, __timeout) \
135 vsf_eda_sync_decrease((__pevt), (__timeout))
136#define __vsf_eda_trig_wait0(__pevt) __vsf_eda_trig_wait1((__pevt), -1)
137#define vsf_eda_trig_wait(__pevt, ...) \
138 __PLOOC_EVAL(__vsf_eda_trig_wait, __VA_ARGS__)((__pevt), ##__VA_ARGS__)
140#if VSF_SYNC_CFG_SUPPORT_ISR == ENABLED
141# define vsf_eda_trig_set_isr(__pevt) vsf_eda_sync_increase_isr((__pevt))
146#define __vsf_eda_crit_npb_init(__pcrit) \
147 vsf_eda_sync_init((__pcrit), 1, 1 | VSF_SYNC_AUTO_RST)
149#define __vsf_eda_crit_npb_enter1(__pcrit, __timeout) \
150 vsf_eda_sync_decrease((__pcrit), (__timeout))
151#define __vsf_eda_crit_npb_enter0(__pcrit) __vsf_eda_crit_npb_enter1((__pcrit), -1)
153#define __vsf_eda_crit_npb_enter(__pcrit, ...) \
154 __PLOOC_EVAL(__vsf_eda_crit_npb_enter, __VA_ARGS__)((__pcrit), ##__VA_ARGS__)
156#define __vsf_eda_crit_npb_leave(__pcrit) \
157 vsf_eda_sync_increase((__pcrit))
159#define __vsf_eda_init2(__eda, __priority, __feature) \
160 __vsf_eda_init((__eda), (__priority), (__feature))
161#define __vsf_eda_init1(__eda, __priority) \
162 __vsf_eda_init2((__eda), (__priority), (vsf_eda_feature_t){.value = 0})
163#define __vsf_eda_init0(__eda) \
164 __vsf_eda_init1((__eda), vsf_prio_inherit)
166#define vsf_eda_init(__eda, ...) \
167 __PLOOC_EVAL(__vsf_eda_init, __VA_ARGS__)((__eda), ##__VA_ARGS__)
169#if VSF_KERNEL_CFG_EDA_SUPPORT_TIMER == ENABLED
170# define vsf_teda_init(__teda, ...) vsf_eda_init(&(__teda)->use_as__vsf_eda_t, ##__VA_ARGS__)
173#define vsf_eda_return(...) __vsf_eda_return((uintptr_t)(0, ##__VA_ARGS__))
175#if VSF_KERNEL_CFG_EDA_SUPPORT_TIMER == ENABLED
176# define vsf_systimer_get_ms() vsf_systimer_tick_to_ms(vsf_systimer_get_tick())
177# define vsf_systimer_get_us() vsf_systimer_tick_to_us(vsf_systimer_get_tick())
180#if VSF_KERNEL_CFG_EDA_SUPPORT_SUB_CALL == ENABLED
181# define vsf_eda_call_eda(__evthandler, ...) \
182 __vsf_eda_call_eda((uintptr_t)__evthandler, NULL, (0, ##__VA_ARGS))
183# define vsf_eda_call_param_eda(__param_evthandler, __param, ...) \
184 __vsf_eda_call_eda( (uintptr_t)__param_evthandler, \
185 (uintptr_t)__param, \
188# define vsf_eda_get_local(...) \
189 __vsf_eda_get_local((vsf_eda_t *)(vsf_eda_get_cur(), ##__VA_ARGS__))
191# define __vsf_peda_local(__name) peda_local_##__name
192# define vsf_peda_local(__name) __vsf_peda_local(__name)
194# define __vsf_peda_arg(__name) peda_arg_##__name
195# define vsf_peda_arg(__name) __vsf_peda_arg(__name)
197# define __vsf_peda_func(__name) vsf_peda_func_##__name
198# define vsf_peda_func(__name) __vsf_peda_func(__name)
201# define __vsf_peda_param(__name) peda_cb_##__name
202# define vsf_peda_param(__name) __vsf_peda_param(__name)
205# define __declare_vsf_peda_ctx(__name) \
206 typedef struct vsf_peda_param(__name) vsf_peda_param(__name); \
207 typedef struct vsf_peda_arg(__name) vsf_peda_arg(__name); \
208 typedef struct vsf_peda_local(__name) vsf_peda_local(__name);
209# define declare_vsf_peda_ctx(__name) __declare_vsf_peda_ctx(__name)
211# define dcl_vsf_peda_ctx(__name) \
212 declare_vsf_peda_ctx(__name)
214# define __declare_vsf_peda(__name) \
215 typedef struct __name __name; \
216 __declare_vsf_peda_ctx(__name)
217# define declare_vsf_peda(__name) __declare_vsf_peda(__name)
219# define dcl_vsf_peda(__name) \
220 declare_vsf_peda(__name)
222# define declare_vsf_peda_methods1(__decoration, __name) \
223 declare_vsf_peda_ctx(__name) \
225 void vsf_peda_func(__name)( \
226 struct vsf_peda_local(__name) *vsf_pthis,\
229# define declare_vsf_peda_methods2(__decoration, __name, __func1) \
230 declare_vsf_peda_ctx(__name) \
232 void vsf_peda_func(__name)( \
233 struct vsf_peda_local(__name) *vsf_pthis,\
236 void __func1( struct vsf_peda_local(__name) *vsf_pthis,\
239# define declare_vsf_peda_methods3(__decoration, __name, __func1, __func2) \
240 declare_vsf_peda_ctx(__name) \
242 void vsf_peda_func(__name)( \
243 struct vsf_peda_local(__name) *vsf_pthis,\
246 void __func1( struct vsf_peda_local(__name) *vsf_pthis,\
249 void __func2( struct vsf_peda_local(__name) *vsf_pthis,\
252# define declare_vsf_peda_methods4(__name, __func1, __func2, __func3) \
253 declare_vsf_peda_ctx(__name) \
255 void vsf_peda_func(__name)( \
256 struct vsf_peda_local(__name) *vsf_pthis,\
259 void __func1( struct vsf_peda_local(__name) *vsf_pthis,\
262 void __func2( struct vsf_peda_local(__name) *vsf_pthis,\
265 void __func3( struct vsf_peda_local(__name) *vsf_pthis,\
268# define declare_vsf_peda_methods5( __decoration, __name, __func1, __func2, \
270 declare_vsf_peda_ctx(__name) \
272 void vsf_peda_func(__name)( \
273 struct vsf_peda_local(__name) *vsf_pthis,\
276 void __func1( struct vsf_peda_local(__name) *vsf_pthis,\
279 void __func2( struct vsf_peda_local(__name) *vsf_pthis,\
282 void __func3( struct vsf_peda_local(__name) *vsf_pthis,\
285 void __func4( struct vsf_peda_local(__name) *vsf_pthis,\
289# define declare_vsf_peda_methods6( __decoration, __name, __func1, __func2, \
290 __func3, __func4, __func5) \
291 declare_vsf_peda_ctx(__name) \
293 void vsf_peda_func(__name)( \
294 struct vsf_peda_local(__name) *vsf_pthis,\
297 void __func1( struct vsf_peda_local(__name) *vsf_pthis,\
300 void __func2( struct vsf_peda_local(__name) *vsf_pthis,\
303 void __func3( struct vsf_peda_local(__name) *vsf_pthis,\
306 void __func4( struct vsf_peda_local(__name) *vsf_pthis,\
309 void __func5( struct vsf_peda_local(__name) *vsf_pthis,\
312# define declare_vsf_peda_methods7( __decoration, __name, __func1, __func2, \
313 __func3, __func4, __func5, __func6) \
314 declare_vsf_peda_ctx(__name) \
316 void vsf_peda_func(__name)( \
317 struct vsf_peda_local(__name) *vsf_pthis,\
320 void __func1( struct vsf_peda_local(__name) *vsf_pthis,\
323 void __func2( struct vsf_peda_local(__name) *vsf_pthis,\
326 void __func3( struct vsf_peda_local(__name) *vsf_pthis,\
329 void __func4( struct vsf_peda_local(__name) *vsf_pthis,\
332 void __func5( struct vsf_peda_local(__name) *vsf_pthis,\
335 void __func6( struct vsf_peda_local(__name) *vsf_pthis,\
338# define declare_vsf_peda_methods8( __decoration, __name, __func1, __func2, \
339 __func3, __func4, __func5, __func6, \
341 declare_vsf_peda_ctx(__name) \
343 void vsf_peda_func(__name)( \
344 struct vsf_peda_local(__name) *vsf_pthis,\
347 void __func1( struct vsf_peda_local(__name) *vsf_pthis,\
350 void __func2( struct vsf_peda_local(__name) *vsf_pthis,\
353 void __func3( struct vsf_peda_local(__name) *vsf_pthis,\
356 void __func4( struct vsf_peda_local(__name) *vsf_pthis,\
359 void __func5( struct vsf_peda_local(__name) *vsf_pthis,\
362 void __func6( struct vsf_peda_local(__name) *vsf_pthis,\
365 void __func7( struct vsf_peda_local(__name) *vsf_pthis,\
368#define declare_vsf_peda_methods(__decoration, ...) \
369 __PLOOC_EVAL(declare_vsf_peda_methods, __VA_ARGS__) \
370 (__decoration, __VA_ARGS__)
372#define dcl_vsf_peda_methods(__decoration, ...) \
373 declare_vsf_peda_methods(__decoration, __VA_ARGS__)
375# if __IS_COMPILER_IAR__
376# define __def_vsf_peda_ctx4(__name, __param, __arg, __local) \
377 struct vsf_peda_param(__name) { \
379 uint8_t VSF_MCONNECT4(_,__LINE__,__COUNTER__,_canary); \
381 struct vsf_peda_arg(__name) { \
383 uint8_t VSF_MCONNECT4(_,__LINE__,__COUNTER__,_canary); \
385 struct vsf_peda_local(__name) { \
386 implement(vsf_peda_arg(__name)) \
390# define __def_vsf_peda_ctx4(__name, __param, __arg, __local) \
391 struct vsf_peda_param(__name) { \
394 struct vsf_peda_arg(__name) { \
397 struct vsf_peda_local(__name) { \
398 implement(vsf_peda_arg(__name)) \
403# define __def_vsf_peda4(__name, __param, __arg, __local) \
404 __def_vsf_peda_ctx4(__name, __param, __arg, __local) \
406 implement(vsf_peda_t) \
407 implement_ex(vsf_peda_param(__name), param) \
410# if __IS_COMPILER_IAR__
411# define __def_vsf_peda_ctx3(__name, __param, __arg) \
412 struct vsf_peda_param(__name) { \
414 uint8_t VSF_MCONNECT4(_,__LINE__,__COUNTER__,_canary); \
416 struct vsf_peda_arg(__name) { \
418 uint8_t VSF_MCONNECT4(_,__LINE__,__COUNTER__,_canary); \
420 struct vsf_peda_local(__name) { \
421 implement(vsf_peda_arg(__name)) \
424# define __def_vsf_peda_ctx3(__name, __param, __arg) \
425 struct vsf_peda_param(__name) { \
428 struct vsf_peda_arg(__name) { \
431 struct vsf_peda_local(__name) { \
432 implement(vsf_peda_arg(__name)) \
436# define __def_vsf_peda3(__name, __param, __arg) \
437 __def_vsf_peda_ctx3(__name, __param, __arg) \
439 implement(vsf_peda_t) \
440 implement_ex(vsf_peda_param(__name), param) \
444# if __IS_COMPILER_IAR__
445# define __def_vsf_peda_ctx2(__name, __param) \
446 struct vsf_peda_param(__name) { \
448 uint8_t VSF_MCONNECT4(_,__LINE__,__COUNTER__,_canary); \
450 struct vsf_peda_arg(__name) { \
451 uint8_t VSF_MCONNECT4(_,__LINE__,__COUNTER__,_canary); \
453 struct vsf_peda_local(__name) { \
454 implement(vsf_peda_arg(__name)) \
457# define __def_vsf_peda_ctx2(__name, __param) \
458 struct vsf_peda_param(__name) { \
461 struct vsf_peda_arg(__name) { \
463 struct vsf_peda_local(__name) { \
464 implement(vsf_peda_arg(__name)) \
468# define __def_vsf_peda_ctx1(__name) \
469 __def_vsf_peda_ctx2(__name, )
471# define __def_vsf_peda2(__name, __param) \
472 __def_vsf_peda_ctx2(__name, __param) \
474 implement(vsf_peda_t) \
475 implement_ex(vsf_peda_param(__name), param) \
478# define __def_vsf_peda1(__name) \
479 __def_vsf_peda_ctx1(__name) \
481 implement(vsf_peda_t) \
482 implement_ex(vsf_peda_param(__name), param) \
485# define def_vsf_peda(...) \
486 __PLOOC_EVAL(__def_vsf_peda, __VA_ARGS__) (__VA_ARGS__)
488# define end_def_vsf_peda(...)
490# define def_vsf_peda_ctx(...) \
491 __PLOOC_EVAL(__def_vsf_peda_ctx, __VA_ARGS__)(__VA_ARGS__)
493# define end_def_vsf_peda_ctx(...)
495# define define_vsf_peda_ctx(__name, ...) \
496 def_vsf_peda_ctx(__name, __VA_ARGS__)
498# define end_define_vsf_peda_ctx(...)
500# define def_locals(...) ,##__VA_ARGS__
501# define end_def_locals(...)
503# define define_locals(...) ,##__VA_ARGS__
504# define end_define_locals(...)
506# define def_args(...) ,__VA_ARGS__
507# define end_def_args(...)
509# define define_args(...) ,__VA_ARGS__
510# define end_define_args(...)
512# define define_arguments(...) ,__VA_ARGS__
513# define end_define_arguments(...)
515# define define_parameters(...) __VA_ARGS__
516# define end_define_parameters(...)
518#if VSF_KERNEL_CFG_EDA_SUPPORT_TIMER == ENABLED
519# define vsf_peda_start vsf_teda_start
521# define vsf_peda_start vsf_eda_start
524# define __init_vsf_peda(__name, __param_eda, __pri, ...) \
526 vsf_eda_cfg_t VSF_MACRO_SAFE_NAME(cfg) = { \
527 .fn.param_evthandler = \
528 (vsf_param_eda_evthandler_t)vsf_peda_func(__name), \
529 .priority = (__pri), \
530 .target = (uintptr_t)&((__param_eda)->param), \
531 .local_size = sizeof(vsf_peda_local(__name)), \
534 vsf_peda_start((vsf_peda_t *)(__param_eda), \
535 &VSF_MACRO_SAFE_NAME(cfg)); \
538# define init_vsf_peda(__name, __param_eda, __pri, ...) \
539 __init_vsf_peda(__name, (__param_eda), (__pri), __VA_ARGS__)
542# define __implement_vsf_peda2(__name, __func_name) \
543 void __func_name( struct vsf_peda_local(__name) *vsf_plocal, \
546 vsf_peda_param(__name) *vsf_pthis = \
547 *(vsf_peda_param(__name) **) \
548 ((uintptr_t)vsf_plocal - sizeof(uintptr_t)); \
549 VSF_UNUSED_PARAM(vsf_pthis); \
550 VSF_KERNEL_ASSERT(NULL != vsf_pthis || NULL != vsf_plocal);
552# define __implement_vsf_peda1(__name) \
553 void vsf_peda_func(__name)( struct vsf_peda_local(__name) *vsf_plocal, \
556 vsf_peda_param(__name) *vsf_pthis = \
557 *(vsf_peda_param(__name) **) \
558 ((uintptr_t)vsf_plocal - sizeof(uintptr_t)); \
559 VSF_UNUSED_PARAM(vsf_pthis); \
560 VSF_KERNEL_ASSERT(NULL != vsf_pthis || NULL != vsf_plocal);
562# define vsf_peda_begin()
564# define vsf_peda_end() \
567# define implement_vsf_peda(...) \
568 __PLOOC_EVAL(__implement_vsf_peda, __VA_ARGS__)(__VA_ARGS__)
570# define imp_vsf_peda(...) \
571 implement_vsf_peda(__VA_ARGS__)
573# define vsf_eda_call_peda(__name, __param) \
574 vsf_eda_call_param_eda( vsf_peda_func(__name), \
576 sizeof(vsf_peda_local(__name)))
578# define vsf_local (*vsf_plocal)
581# define vsf_this (*vsf_pthis)
584#define vsf_eda_mutex_try_enter vsf_eda_mutex_enter
585#define vsf_eda_crit_try_enter vsf_eda_crit_enter
589#ifndef VSF_KERNEL_TIMEOUT_TICK_T
590# define VSF_KERNEL_TIMEOUT_TICK_T int_fast64_t
599#if VSF_KERNEL_CFG_SUPPORT_THREAD == ENABLED && VSF_KERNEL_CFG_THREAD_SIGNAL == ENABLED
632#if VSF_KERNEL_CFG_CPU_USAGE == ENABLED || VSF_KERNEL_CFG_EDA_CPU_USAGE == ENABLED
660#if VSF_KERNEL_CFG_EDA_USER_BITLEN <= 8 - 3
663#elif VSF_KERNEL_CFG_EDA_USER_BITLEN <= 16 - 3
666#elif VSF_KERNEL_CFG_EDA_USER_BITLEN <= 32 - 3
670# error VSF_KERNEL_CFG_EDA_USER_BITLEN not supported yet
675#if VSF_KERNEL_CFG_EDA_SUPPORT_SUB_CALL == ENABLED
686#if VSF_KERNEL_USE_SIMPLE_SHELL == ENABLED
689#if VSF_KERNEL_CFG_EDA_SUBCALL_HAS_RETURN_VALUE == ENABLED
699#if VSF_KERNEL_CFG_ALLOW_KERNEL_BEING_PREEMPTED == ENABLED
700# if VSF_KERNEL_CFG_SUPPORT_DYNAMIC_PRIOTIRY == ENABLED
709#if VSF_KERNEL_CFG_SUPPORT_SYNC == ENABLED
715#if VSF_KERNEL_CFG_EDA_SUPPORT_TIMER == ENABLED
767#if VSF_KERNEL_CFG_EDA_SUPPORT_ON_TERMINATE == ENABLED
798# if VSF_KERNEL_CFG_ALLOW_KERNEL_BEING_PREEMPTED == ENABLED
799# if VSF_KERNEL_CFG_SUPPORT_DYNAMIC_PRIOTIRY == ENABLED
813# if VSF_KERNEL_CFG_EDA_SUBCALL_HAS_RETURN_VALUE == ENABLED
815 int8_t subcall_return_value;
817# if VSF_KERNEL_OPT_AVOID_UNNECESSARY_YIELD_EVT == ENABLED
818 bool is_evt_incoming;
831#if VSF_KERNEL_CFG_EDA_SUPPORT_TIMER == ENABLED
845#if VSF_KERNEL_CFG_SUPPORT_CALLBACK_TIMER == ENABLED
861#if VSF_KERNEL_CFG_SUPPORT_SYNC == ENABLED
902#ifndef __VSF_BITMAP_EVT_DEFINED__
903#define __VSF_BITMAP_EVT_DEFINED__
905#define VSF_BMPEVT_OR 0
906#define VSF_BMPEVT_AND 1
984#if VSF_KERNEL_CFG_SUPPORT_EDA_QUEUE == ENABLED
999#if VSF_KERNEL_CFG_QUEUE_MULTI_TX_EN == ENABLED
1025#
if VSF_EDA_QUEUE_CFG_REGION ==
ENABLED
1033#if VSF_EDA_QUEUE_CFG_SUPPORT_ISR == ENABLED
1036#if VSF_KERNEL_CFG_QUEUE_HAS_RX_NOTIFIED == ENABLED
1046# if VSF_KERNEL_CFG_EDA_SUPPORT_TIMER == ENABLED
1100#if VSF_KERNEL_CFG_EDA_SUPPORT_TIMER == ENABLED
1102# if VSF_KERNEL_CFG_TIMER_MODE == VSF_KERNEL_CFG_TIMER_MODE_TICK
1118#if defined(__VSF_EDA_CLASS_INHERIT__) || defined(__VSF_EDA_CLASS_IMPLEMENT)
1128# if VSF_KERNEL_CFG_SUPPORT_SYNC == ENABLED
1133# if VSF_KERNEL_USE_SIMPLE_SHELL == ENABLED
1160#if VSF_KERNEL_USE_SIMPLE_SHELL == ENABLED
1169#if VSF_KERNEL_CFG_EDA_SUPPORT_SUB_CALL == ENABLED
1177#if VSF_KERNEL_CFG_EDA_CPU_USAGE == ENABLED
1184#if defined(__VSF_EDA_CLASS_INHERIT__) || defined(__VSF_EDA_CLASS_IMPLEMENT)
1200# if VSF_KERNEL_CFG_SUPPORT_DYNAMIC_PRIOTIRY == ENABLED
1216#if VSF_KERNEL_CFG_EDA_SUPPORT_SUB_CALL == ENABLED
1255#if VSF_KERNEL_CFG_EDA_SUPPORT_TIMER == ENABLED
1282# if VSF_KERNEL_CFG_SUPPORT_CALLBACK_TIMER == ENABLED
1292# if VSF_CALLBACK_TIMER_CFG_SUPPORT_ISR == ENABLED
1323#if VSF_KERNEL_CFG_SUPPORT_EVT_MESSAGE == ENABLED
1328#if VSF_KERNEL_CFG_SUPPORT_SYNC == ENABLED
1333#if VSF_SYNC_CFG_SUPPORT_ISR == ENABLED
1363#if VSF_KERNEL_CFG_SUPPORT_BITMAP_EVENT == ENABLED
1389#if VSF_KERNEL_CFG_SUPPORT_EDA_QUEUE == ENABLED
1417# if VSF_EDA_QUEUE_CFG_SUPPORT_ISR == ENABLED
1434#undef __VSF_EDA_CLASS_INHERIT__
1435#undef __VSF_EDA_CLASS_IMPLEMENT
1439#if VSF_KERNEL_CFG_TRACE == ENABLED
1440# ifdef VSF_KERNEL_CFG_TRACE_HEADER
1441# include VSF_KERNEL_CFG_TRACE_HEADER
#define VSF_CAL_SECTION(__SEC)
Definition __compiler.h:181
#define ENABLED
Definition __type.h:28
vsf_err_t
Definition __type.h:42
vsf_arch_prio_t
Definition cortex_a_generic.h:88
uint64_t vsf_systimer_tick_t
Definition cortex_a_generic.h:73
struct ieee80211_ext_chansw_ie data
Definition ieee80211.h:80
__le16 timeout
Definition ieee80211.h:94
vsf_systimer_tick_t vsf_systimer_ms_to_tick(uint_fast32_t time_ms)
Definition linux_generic.c:440
vsf_systimer_tick_t vsf_systimer_us_to_tick(uint_fast32_t time_us)
Definition linux_generic.c:435
signed short int16_t
Definition lvgl.h:42
unsigned short uint16_t
Definition lvgl.h:41
unsigned int uint32_t
Definition lvgl.h:43
unsigned char uint8_t
Definition lvgl.h:40
signed char int8_t
Definition lvgl.h:38
#define max(x, y)
Definition minmax.h:12
#define vsf_dcl_class
Definition ooc_class.h:46
#define vsf_class(__name)
Definition ooc_class.h:48
uint32_t uintptr_t
Definition stdint.h:38
unsigned char uint_fast8_t
Definition stdint.h:23
unsigned int uint_fast32_t
Definition stdint.h:27
unsigned long long uint64_t
Definition stdint.h:11
unsigned short uint_fast16_t
Definition stdint.h:25
uint16_t local_size
Definition vsf_eda.h:738
vsf_eda_feature_t feature
Definition vsf_eda.h:737
Definition vsf_eda.h:1076
vsf_err_t(* reset)(vsf_bmpevt_adapter_t *pthis)
Definition vsf_eda.h:910
vsf_err_t(* init)(vsf_bmpevt_adapter_t *pthis)
Definition vsf_eda.h:909
Definition vsf_eda.h:1071
vsf_bmpevt_adapter_eda_t vsf_sync_t * sync
Definition vsf_eda.h:1073
vsf_systimer_tick_t duration
Definition vsf_eda.h:635
vsf_systimer_tick_t ticks
Definition vsf_eda.h:634
vsf_systimer_tick_t ticks
Definition vsf_eda.h:638
vsf_cpu_usage_ctx_t * ctx
Definition vsf_eda.h:639
Definition vsf_list.h:888
Definition vsf_list.h:883
uint16_t local_size
Definition vsf_eda.h:760
vsf_eda_on_terminate_t on_terminate
Definition vsf_eda.h:757
uintptr_t target
Definition vsf_eda.h:761
vsf_prio_t priority
Definition vsf_eda.h:758
__vsf_eda_fn_t fn
Definition vsf_eda.h:756
vsf_eda_feature_t feature
Definition vsf_eda.h:759
bool(* enqueue)(vsf_eda_queue_t *pthis, void *node)
Definition vsf_eda.h:986
bool(* dequeue)(vsf_eda_queue_t *pthis, void **node)
Definition vsf_eda.h:987
Definition vsf_eda.h:1091
vsf_arch_prio_t systimer_arch_prio
Definition vsf_eda.h:1093
vsf_prio_t highest_prio
Definition vsf_eda.h:1092
Definition vsf_arch_abstraction.h:54
Definition vsf_list.h:876
Definition vsf_list.h:896
Definition vsf_list.h:872
__vsf_eda_state_t state
Definition vsf_eda.h:724
vsf_eda_feature_t feature
Definition vsf_eda.h:725
__vsf_eda_flag_word value
Definition vsf_eda.h:727
vsf_param_eda_evthandler_t param_evthandler
Definition vsf_eda.h:733
vsf_eda_evthandler_t evthandler
Definition vsf_eda.h:732
uintptr_t func
Definition vsf_eda.h:731
uint8_t is_to_exit
Definition vsf_eda.h:704
uint8_t is_limitted
Definition vsf_eda.h:711
uint8_t is_timed
Definition vsf_eda.h:716
uint8_t value
Definition vsf_eda.h:719
uint8_t is_ready
Definition vsf_eda.h:701
uint8_t is_new_prio
Definition vsf_eda.h:702
uint8_t is_sync_got
Definition vsf_eda.h:712
__vsf_eda_feature_word is_subcall_has_return_value
Definition vsf_eda.h:690
__vsf_eda_feature_word is_stack_owner
Definition vsf_eda.h:687
__vsf_eda_feature_word user_bits
Definition vsf_eda.h:692
__vsf_eda_feature_word is_use_frame
Definition vsf_eda.h:684
__vsf_eda_feature_word value
Definition vsf_eda.h:694
vk_av_control_value_t value
Definition vsf_audio.h:171
int16_t vsf_evt_t
Definition vsf_eda.h:654
vsf_mutex_t vsf_crit_t
Definition vsf_eda.h:1069
uintptr_t vsf_eda_get_return_value(void)
Definition vsf_eda.c:475
vsf_err_t vsf_eda_sync_init(vsf_sync_t *pthis, uint_fast16_t cur_value, uint_fast16_t max_value)
vsf_err_t vsf_eda_set_evthandler(vsf_eda_t *pthis, vsf_eda_evthandler_t evthandler)
Definition vsf_eda.c:742
void vsf_systimer_on_tick(void)
vsf_sync_reason_t vsf_eda_sync_get_reason(vsf_sync_t *pthis, vsf_evt_t evt)
vsf_sync_owner_t vsf_mutex_t
Definition vsf_eda.h:1068
vsf_err_t vsf_eda_bmpevt_reset(vsf_bmpevt_t *pthis, uint_fast32_t mask)
void __vsf_eda_yield(void)
Definition vsf_eda.c:539
vsf_err_t vsf_teda_cancel_timer(void)
vsf_err_t vsf_callback_timer_add_isr(vsf_callback_timer_t *timer, vsf_systimer_tick_t tick)
void(* vsf_eda_on_terminate_t)(vsf_eda_t *eda)
Definition vsf_eda.h:657
uint8_t vsf_eda_get_user_value(void)
Definition vsf_eda.c:556
vsf_err_t vsf_eda_queue_init(vsf_eda_queue_t *pthis, uint_fast16_t max)
vsf_err_t vsf_callback_timer_remove_isr(vsf_callback_timer_t *timer)
vsf_err_t vsf_teda_set_timer(vsf_systimer_tick_t tick)
vsf_err_t vsf_eda_post_evt(vsf_eda_t *pthis, vsf_evt_t evt)
Definition vsf_eda.c:929
vsf_err_t vsf_eda_bmpevt_cancel(vsf_bmpevt_t *pthis, uint_fast32_t mask)
vsf_sync_t vsf_trig_t
Definition vsf_eda.h:1062
vsf_teda_t vsf_peda_t
Definition vsf_eda.h:1047
#define VSF_KERNEL_TIMEOUT_TICK_T
Definition vsf_eda.h:590
vsf_err_t vsf_eda_sync_increase(vsf_sync_t *pthis)
vsf_err_t vsf_eda_queue_recv_isr(vsf_eda_queue_t *pthis, void **node)
void __vsf_eda_on_terminate(vsf_eda_t *pthis)
Definition vsf_eda.c:149
void vsf_eda_queue_cancel(vsf_eda_queue_t *pthis)
vsf_err_t vsf_eda_bmpevt_set(vsf_bmpevt_t *pthis, uint_fast32_t mask)
void vsf_eda_cpu_usage_start(vsf_eda_t *pthis, vsf_cpu_usage_ctx_t *ctx)
Definition vsf_eda.c:970
vsf_err_t __vsf_eda_call_eda_ex_prepare(uintptr_t func, uintptr_t param, __vsf_eda_frame_state_t state, bool is_sub_call)
Definition vsf_eda.c:633
vsf_kernel_error_t
Definition vsf_eda.h:1083
@ VSF_KERNEL_ERR_INVALID_CONTEXT
Definition vsf_eda.h:1085
@ VSF_KERNEL_ERR_NONE
Definition vsf_eda.h:1084
@ VSF_KERNEL_ERR_SHOULD_NOT_USE_PRIO_INHERIT_IN_IDLE_OR_ISR
Definition vsf_eda.h:1088
@ VSF_KERNEL_ERR_EDA_DOES_NOT_SUPPORT_TIMER
Definition vsf_eda.h:1087
@ VSF_KERNEL_ERR_INVALID_USAGE
Definition vsf_eda.h:1086
vsf_err_t vsf_eda_go_to(uintptr_t evthandler)
Definition vsf_eda.c:759
void(* vsf_eda_evthandler_t)(vsf_eda_t *eda, vsf_evt_t evt)
Definition vsf_eda.h:656
vsf_sync_t __vsf_crit_npb_t
Definition vsf_eda.h:1064
vsf_err_t __vsf_eda_init(vsf_eda_t *pthis, vsf_prio_t priotiry, vsf_eda_feature_t feature)
Definition vsf_eda.c:816
const vsf_bmpevt_adapter_op_t vsf_eda_bmpevt_adapter_bmpevt_op
vsf_err_t vsf_eda_bmpevt_init(vsf_bmpevt_t *pthis, uint_fast8_t adapter_count)
void vsf_callback_timer_init(vsf_callback_timer_t *timer)
void vsf_eda_cpu_usage_stop(vsf_eda_t *pthis)
Definition vsf_eda.c:984
vsf_err_t vsf_eda_sync_decrease(vsf_sync_t *pthis, vsf_timeout_tick_t timeout)
vsf_err_t vsf_eda_post_evt_msg(vsf_eda_t *pthis, vsf_evt_t evt, void *msg)
Definition vsf_eda.c:963
uintptr_t vsf_eda_target_get(void)
Definition vsf_eda.c:615
vsf_systimer_tick_t vsf_systimer_get_elapsed(vsf_systimer_tick_t from_time)
@ VSF_EVT_NONE
compatible with fsm_rt_cpl
Definition vsf_eda.h:597
@ VSF_EVT_SYNC_CANCEL
Definition vsf_eda.h:616
@ VSF_EVT_SYNC
Definition vsf_eda.h:615
@ VSF_EVT_SYNC_POLL
Definition vsf_eda.h:617
@ VSF_EVT_SYSTEM
Definition vsf_eda.h:603
@ VSF_EVT_DUMMY
Definition vsf_eda.h:604
@ VSF_EVT_SIGNAL
Definition vsf_eda.h:600
@ VSF_EVT_EXIT
Definition vsf_eda.h:608
@ VSF_EVT_YIELD
compatible with fsm_rt_on_going
Definition vsf_eda.h:598
@ VSF_EVT_INVALID
compatible with fsm_rt_err
Definition vsf_eda.h:596
@ VSF_EVT_INIT
Definition vsf_eda.h:605
@ VSF_EVT_ENTER
Definition vsf_eda.h:607
@ VSF_EVT_FINI
Definition vsf_eda.h:606
@ VSF_EVT_MESSAGE
Definition vsf_eda.h:620
@ VSF_EVT_RETURN
Definition vsf_eda.h:609
@ VSF_EVT_TIMER
Definition vsf_eda.h:612
@ VSF_EVT_USER
Definition vsf_eda.h:621
vsf_systimer_tick_t vsf_systimer_get_tick(void)
vsf_err_t vsf_eda_start(vsf_eda_t *pthis, vsf_eda_cfg_t *cfg)
Definition vsf_eda.c:832
uintptr_t __vsf_eda_get_local(vsf_eda_t *pthis)
Definition vsf_eda.c:589
vsf_err_t vsf_eda_queue_recv_ex(vsf_eda_queue_t *pthis, void **node, vsf_timeout_tick_t timeout, vsf_eda_t *eda)
vsf_err_t vsf_eda_bmpevt_pend(vsf_bmpevt_t *pthis, vsf_bmpevt_pender_t *pender, vsf_timeout_tick_t timeout)
VSF_KERNEL_TIMEOUT_TICK_T vsf_timeout_tick_t
Definition vsf_eda.h:592
vsf_err_t vsf_teda_set_timer_ex(vsf_teda_t *pthis, vsf_systimer_tick_t tick)
vsf_err_t vsf_callback_timer_add(vsf_callback_timer_t *timer, vsf_systimer_tick_t tick)
vsf_err_t __vsf_eda_set_priority(vsf_eda_t *pthis, vsf_prio_t prio)
Definition vsf_evtq_list.c:82
vsf_sync_reason_t vsf_eda_bmpevt_poll(vsf_bmpevt_t *pthis, vsf_bmpevt_pender_t *pender, vsf_evt_t evt)
vsf_err_t vsf_teda_start(vsf_teda_t *pthis, vsf_eda_cfg_t *cfg)
uint_fast16_t vsf_eda_queue_get_cnt(vsf_eda_queue_t *pthis)
void vsf_eda_set_user_value(uint8_t value)
Definition vsf_eda.c:547
vsf_err_t vsf_eda_queue_recv(vsf_eda_queue_t *pthis, void **node, vsf_timeout_tick_t timeout)
void * vsf_eda_get_cur_msg(void)
Definition vsf_eda.c:466
uint16_t __vsf_eda_flag_word
Definition vsf_eda.h:662
vsf_prio_t __vsf_eda_get_cur_priority(vsf_eda_t *pthis)
Definition vsf_evtq_list.c:75
uint8_t __vsf_eda_feature_word
Definition vsf_eda.h:661
vsf_eda_t * vsf_eda_get_cur(void)
Definition vsf_eda.c:416
void __vsf_dispatch_evt(vsf_eda_t *pthis, vsf_evt_t evt)
Definition vsf_eda.c:224
vsf_err_t __vsf_eda_go_to_ex(uintptr_t evthandler, uintptr_t param)
Definition vsf_eda.c:720
vsf_err_t __vsf_eda_sync_decrease_ex(vsf_sync_t *pthis, vsf_timeout_tick_t timeout, vsf_eda_t *eda, bool manual)
vsf_systimer_tick_t vsf_systimer_get_duration(vsf_systimer_tick_t from_time, vsf_systimer_tick_t to_time)
void vsf_eda_polling_state_set(vsf_eda_t *pthis, bool state)
Definition vsf_eda.c:436
vsf_err_t vsf_eda_target_set(uintptr_t param)
Definition vsf_eda.c:601
void vsf_eda_sync_force_reset(vsf_sync_t *pthis)
vsf_err_t __vsf_eda_call_eda_ex(uintptr_t func, uintptr_t param, __vsf_eda_frame_state_t state, bool is_sub_call)
Definition vsf_eda.c:693
vsf_sync_t vsf_sem_t
Definition vsf_eda.h:1061
vsf_sync_reason_t vsf_eda_queue_send_get_reason(vsf_eda_queue_t *pthis, vsf_evt_t evt, void *node)
#define VSF_KERNEL_CFG_EDA_USER_BITLEN
Definition vsf_eda.h:58
uintptr_t vsf_irq_enter(void)
Definition vsf_eda.c:129
vsf_err_t vsf_eda_queue_send_isr(vsf_eda_queue_t *pthis, void *node)
vsf_evt_t vsf_eda_get_cur_evt(void)
Definition vsf_eda.c:458
bool vsf_eda_is_stack_owner(vsf_eda_t *pthis)
Definition vsf_eda.c:450
const vsf_bmpevt_adapter_op_t vsf_eda_bmpevt_adapter_sync_op
vsf_err_t __vsf_eda_sync_increase_ex(vsf_sync_t *pthis, vsf_eda_t *eda, bool manual)
vsf_err_t __vsf_eda_call_eda_prepare(uintptr_t evthandler, uintptr_t param, size_t local_size)
Definition vsf_eda.c:682
vsf_err_t __vsf_eda_call_eda(uintptr_t evthandler, uintptr_t param, size_t local_size)
Definition vsf_eda.c:727
vsf_err_t vsf_eda_post_msg(vsf_eda_t *pthis, void *msg)
Definition vsf_eda.c:955
vsf_err_t vsf_eda_queue_send_ex(vsf_eda_queue_t *pthis, void *node, vsf_timeout_tick_t timeout, vsf_eda_t *eda)
vsf_err_t __vsf_eda_post_evt_ex(vsf_eda_t *pthis, vsf_evt_t evt, bool force)
Definition vsf_eda.c:947
void vsf_irq_leave(uintptr_t ctx)
Definition vsf_eda.c:141
vsf_err_t vsf_eda_sync_increase_isr(vsf_sync_t *pthis)
void vsf_kernel_init(const vsf_kernel_cfg_t *cfg_ptr)
Definition vsf_eda.c:162
vsf_sync_reason_t vsf_eda_queue_recv_get_reason(vsf_eda_queue_t *pthis, vsf_evt_t evt, void **node)
bool vsf_eda_polling_state_get(vsf_eda_t *pthis)
Definition vsf_eda.c:429
vsf_err_t vsf_eda_sync_decrease_ex(vsf_sync_t *pthis, vsf_timeout_tick_t timeout, vsf_eda_t *eda)
void(* vsf_param_eda_evthandler_t)(uintptr_t target, vsf_evt_t evt)
Definition vsf_eda.h:658
bool __vsf_eda_return(uintptr_t return_value)
Definition vsf_eda.c:484
vsf_err_t __vsf_teda_cancel_timer(vsf_teda_t *pthis)
vsf_sync_reason_t
Definition vsf_eda.h:1053
@ VSF_SYNC_GET
Definition vsf_eda.h:1057
@ VSF_SYNC_FAIL
Definition vsf_eda.h:1054
@ VSF_SYNC_CANCEL
Definition vsf_eda.h:1058
@ VSF_SYNC_TIMEOUT
Definition vsf_eda.h:1055
@ VSF_SYNC_PENDING
Definition vsf_eda.h:1056
vsf_err_t vsf_eda_queue_send(vsf_eda_queue_t *pthis, void *node, vsf_timeout_tick_t timeout)
vsf_err_t vsf_callback_timer_remove(vsf_callback_timer_t *timer)
vsf_err_t vsf_eda_sync_increase_ex(vsf_sync_t *pthis, vsf_eda_t *eda)
void vsf_eda_sync_cancel(vsf_sync_t *pthis)
@ VSF_KERNEL_EVT_QUEUE_SEND_NOTIFY
Definition vsf_eda.h:628
@ VSF_KERNEL_EVT_CALLBACK_TIMER
Definition vsf_eda.h:626
@ VSF_KERNEL_EVT_QUEUE_RECV_NOTIFY
Definition vsf_eda.h:629
@ VSF_KERNEL_EVT_CALLBACK_TIMER_ADD
Definition vsf_eda.h:627
vsf_err_t vsf_eda_fini(vsf_eda_t *pthis)
Definition vsf_eda.c:897
#define VSF_KERNEL_CFG_SUPPORT_SYNC
Definition vsf_kernel_cfg.h:46
#define VSF_KERNEL_CFG_EDA_SUPPORT_SUB_CALL
Definition vsf_kernel_cfg.h:106
#define VSF_KERNEL_CFG_EDA_CPU_USAGE
Definition vsf_kernel_cfg.h:376
vsf_prio_t
Definition vsf_kernel_common.h:37
uint8_t state
Definition vsf_msg_tree.h:247
which(union { inherit(vsf_msgt_container_t) vsf_tgui_control_t };vsf_tgui_v_container_t) implement_ex(struct
Definition vsf_tgui_control.h:562