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__
59#define VSF_SYNC_AUTO_RST 0x0000
68#define VSF_SYNC_MANUAL_RST 0x8000
77#define VSF_SYNC_HAS_OWNER 0x8000
85#define VSF_SYNC_MAX 0x7FFF
87#ifndef VSF_KERNEL_CFG_EDA_USER_BITLEN
88# define VSF_KERNEL_CFG_EDA_USER_BITLEN 5
94#define __vsf_eda_sem_init2(__psem, __init_cnt, __max_cnt) \
95 vsf_eda_sync_init((__psem), (__init_cnt), (__max_cnt) | VSF_SYNC_AUTO_RST)
96#define __vsf_eda_sem_init1(__psem, __init_cnt) \
97 __vsf_eda_sem_init2((__psem), (__init_cnt), VSF_SYNC_MAX)
98#define __vsf_eda_sem_init0(__psem) \
99 __vsf_eda_sem_init1((__psem), 0)
117#define vsf_eda_sem_init(__psem, ...) \
118 __PLOOC_EVAL(__vsf_eda_sem_init, __VA_ARGS__)((__psem), ##__VA_ARGS__)
132#define vsf_eda_sem_post(__psem) vsf_eda_sync_increase((__psem))
134#define __vsf_eda_sem_pend1(__psem, __timeout) vsf_eda_sync_decrease((__psem), (__timeout))
135#define __vsf_eda_sem_pend0(__psem) __vsf_eda_sem_pend1((__psem), -1)
164#define vsf_eda_sem_pend(__psem, ...) \
165 __PLOOC_EVAL(__vsf_eda_sem_pend, __VA_ARGS__)((__psem), ##__VA_ARGS__)
167#if VSF_SYNC_CFG_SUPPORT_ISR == ENABLED
188# define vsf_eda_sem_post_isr(__psem) vsf_eda_sync_increase_isr((__psem))
209#define vsf_eda_mutex_init(__pmtx) \
210 vsf_eda_sync_init( &((__pmtx)->use_as__vsf_sync_t), \
211 1 | VSF_SYNC_HAS_OWNER, \
212 1 | VSF_SYNC_AUTO_RST)
214#define __vsf_eda_mutex_enter1(__pmtx, __timeout) \
215 vsf_eda_sync_decrease(&((__pmtx)->use_as__vsf_sync_t), (__timeout))
216#define __vsf_eda_mutex_enter0(__pmtx) __vsf_eda_mutex_enter1((__pmtx), -1)
245#define vsf_eda_mutex_enter(__pmtx, ...) \
246 __PLOOC_EVAL(__vsf_eda_mutex_enter, __VA_ARGS__)((__pmtx), ##__VA_ARGS__)
264#define vsf_eda_mutex_leave(__pmtx) \
265 vsf_eda_sync_increase(&((__pmtx)->use_as__vsf_sync_t))
266#if VSF_SYNC_CFG_SUPPORT_ISR == ENABLED
287# define vsf_eda_mutex_leave_isr(__pmtx) vsf_eda_sync_increase_isr(&(__pmtx)->use_as__vsf_sync_t)
307#define vsf_eda_crit_init(__pcrit) \
308 vsf_eda_mutex_init((__pcrit))
310#define __vsf_eda_crit_enter1(__pcrit, __timeout) \
311 vsf_eda_mutex_enter((__pcrit), (__timeout))
312#define __vsf_eda_crit_enter0(__pcrit) __vsf_eda_crit_enter1((__pcrit), -1)
341#define vsf_eda_crit_enter(__pcrit, ...) \
342 __PLOOC_EVAL(__vsf_eda_crit_enter, __VA_ARGS__)((__pcrit), ##__VA_ARGS__)
356#define vsf_eda_crit_leave(__pcrit) \
357 vsf_eda_mutex_leave((__pcrit))
376#define vsf_eda_trig_init(__pevt, __set, __auto_rst) \
377 vsf_eda_sync_init((__pevt), (__set), \
378 1 | ((__auto_rst) ? VSF_SYNC_AUTO_RST : VSF_SYNC_MANUAL_RST))
380#define vsf_eda_trig_set0(__pevt) vsf_eda_sync_increase((__pevt))
381#define vsf_eda_trig_set1(__pevt, __manual) \
382 __vsf_eda_sync_increase_ex((__pevt), NULL, (__manual))
403#define vsf_eda_trig_set(__pevt, ...) \
404 __PLOOC_EVAL(vsf_eda_trig_set, __VA_ARGS__)((__pevt), ##__VA_ARGS__)
418#define vsf_eda_trig_reset(__pevt) vsf_eda_sync_force_reset((__pevt))
420#define __vsf_eda_trig_wait1(__pevt, __timeout) \
421 vsf_eda_sync_decrease((__pevt), (__timeout))
422#define __vsf_eda_trig_wait0(__pevt) __vsf_eda_trig_wait1((__pevt), -1)
450#define vsf_eda_trig_wait(__pevt, ...) \
451 __PLOOC_EVAL(__vsf_eda_trig_wait, __VA_ARGS__)((__pevt), ##__VA_ARGS__)
453#if VSF_SYNC_CFG_SUPPORT_ISR == ENABLED
474# define vsf_eda_trig_set_isr(__pevt) vsf_eda_sync_increase_isr((__pevt))
493#define __vsf_eda_crit_npb_init(__pcrit) \
494 vsf_eda_sync_init((__pcrit), 1, 1 | VSF_SYNC_AUTO_RST)
496#define __vsf_eda_crit_npb_enter1(__pcrit, __timeout) \
497 vsf_eda_sync_decrease((__pcrit), (__timeout))
498#define __vsf_eda_crit_npb_enter0(__pcrit) __vsf_eda_crit_npb_enter1((__pcrit), -1)
523#define __vsf_eda_crit_npb_enter(__pcrit, ...) \
524 __PLOOC_EVAL(__vsf_eda_crit_npb_enter, __VA_ARGS__)((__pcrit), ##__VA_ARGS__)
542#define __vsf_eda_crit_npb_leave(__pcrit) \
543 vsf_eda_sync_increase((__pcrit))
545#define __vsf_eda_init2(__eda, __priority, __feature) \
546 __vsf_eda_init((__eda), (__priority), (__feature))
547#define __vsf_eda_init1(__eda, __priority) \
548 __vsf_eda_init2((__eda), (__priority), (vsf_eda_feature_t){.value = 0})
549#define __vsf_eda_init0(__eda) \
550 __vsf_eda_init1((__eda), vsf_prio_inherit)
573#define vsf_eda_init(__eda, ...) \
574 __PLOOC_EVAL(__vsf_eda_init, __VA_ARGS__)((__eda), ##__VA_ARGS__)
576#if VSF_KERNEL_CFG_EDA_SUPPORT_TIMER == ENABLED
597# define vsf_teda_init(__teda, ...) vsf_eda_init(&(__teda)->use_as__vsf_eda_t, ##__VA_ARGS__)
620#define vsf_eda_return(...) __vsf_eda_return((uintptr_t)(0, ##__VA_ARGS__))
622#if VSF_KERNEL_CFG_EDA_SUPPORT_TIMER == ENABLED
637# define vsf_systimer_get_ms() vsf_systimer_tick_to_ms(vsf_systimer_get_tick())
652# define vsf_systimer_get_us() vsf_systimer_tick_to_us(vsf_systimer_get_tick())
655#if VSF_KERNEL_CFG_EDA_SUPPORT_SUB_CALL == ENABLED
680# define vsf_eda_call_eda(__evthandler, ...) \
681 __vsf_eda_call_eda((uintptr_t)__evthandler, NULL, (0, ##__VA_ARGS))
704# define vsf_eda_call_param_eda(__param_evthandler, __param, ...) \
705 __vsf_eda_call_eda( (uintptr_t)__param_evthandler, \
706 (uintptr_t)__param, \
726# define vsf_eda_get_local(...) \
727 __vsf_eda_get_local((vsf_eda_t *)(vsf_eda_get_cur(), ##__VA_ARGS__))
729# define __vsf_peda_local(__name) peda_local_##__name
738# define vsf_peda_local(__name) __vsf_peda_local(__name)
740# define __vsf_peda_arg(__name) peda_arg_##__name
749# define vsf_peda_arg(__name) __vsf_peda_arg(__name)
751# define __vsf_peda_func(__name) vsf_peda_func_##__name
760# define vsf_peda_func(__name) __vsf_peda_func(__name)
763# define __vsf_peda_param(__name) peda_cb_##__name
772# define vsf_peda_param(__name) __vsf_peda_param(__name)
775# define __declare_vsf_peda_ctx(__name) \
776 typedef struct vsf_peda_param(__name) vsf_peda_param(__name); \
777 typedef struct vsf_peda_arg(__name) vsf_peda_arg(__name); \
778 typedef struct vsf_peda_local(__name) vsf_peda_local(__name);
787# define declare_vsf_peda_ctx(__name) __declare_vsf_peda_ctx(__name)
797# define dcl_vsf_peda_ctx(__name) \
798 declare_vsf_peda_ctx(__name)
800# define __declare_vsf_peda(__name) \
801 typedef struct __name __name; \
802 __declare_vsf_peda_ctx(__name)
811# define declare_vsf_peda(__name) __declare_vsf_peda(__name)
821# define dcl_vsf_peda(__name) \
822 declare_vsf_peda(__name)
824# define declare_vsf_peda_methods1(__decoration, __name) \
825 declare_vsf_peda_ctx(__name) \
827 void vsf_peda_func(__name)( \
828 struct vsf_peda_local(__name) *vsf_pthis,\
831# define declare_vsf_peda_methods2(__decoration, __name, __func1) \
832 declare_vsf_peda_ctx(__name) \
834 void vsf_peda_func(__name)( \
835 struct vsf_peda_local(__name) *vsf_pthis,\
838 void __func1( struct vsf_peda_local(__name) *vsf_pthis,\
841# define declare_vsf_peda_methods3(__decoration, __name, __func1, __func2) \
842 declare_vsf_peda_ctx(__name) \
844 void vsf_peda_func(__name)( \
845 struct vsf_peda_local(__name) *vsf_pthis,\
848 void __func1( struct vsf_peda_local(__name) *vsf_pthis,\
851 void __func2( struct vsf_peda_local(__name) *vsf_pthis,\
854# define declare_vsf_peda_methods4(__name, __func1, __func2, __func3) \
855 declare_vsf_peda_ctx(__name) \
857 void vsf_peda_func(__name)( \
858 struct vsf_peda_local(__name) *vsf_pthis,\
861 void __func1( struct vsf_peda_local(__name) *vsf_pthis,\
864 void __func2( struct vsf_peda_local(__name) *vsf_pthis,\
867 void __func3( struct vsf_peda_local(__name) *vsf_pthis,\
870# define declare_vsf_peda_methods5( __decoration, __name, __func1, __func2, \
872 declare_vsf_peda_ctx(__name) \
874 void vsf_peda_func(__name)( \
875 struct vsf_peda_local(__name) *vsf_pthis,\
878 void __func1( struct vsf_peda_local(__name) *vsf_pthis,\
881 void __func2( struct vsf_peda_local(__name) *vsf_pthis,\
884 void __func3( struct vsf_peda_local(__name) *vsf_pthis,\
887 void __func4( struct vsf_peda_local(__name) *vsf_pthis,\
891# define declare_vsf_peda_methods6( __decoration, __name, __func1, __func2, \
892 __func3, __func4, __func5) \
893 declare_vsf_peda_ctx(__name) \
895 void vsf_peda_func(__name)( \
896 struct vsf_peda_local(__name) *vsf_pthis,\
899 void __func1( struct vsf_peda_local(__name) *vsf_pthis,\
902 void __func2( struct vsf_peda_local(__name) *vsf_pthis,\
905 void __func3( struct vsf_peda_local(__name) *vsf_pthis,\
908 void __func4( struct vsf_peda_local(__name) *vsf_pthis,\
911 void __func5( struct vsf_peda_local(__name) *vsf_pthis,\
914# define declare_vsf_peda_methods7( __decoration, __name, __func1, __func2, \
915 __func3, __func4, __func5, __func6) \
916 declare_vsf_peda_ctx(__name) \
918 void vsf_peda_func(__name)( \
919 struct vsf_peda_local(__name) *vsf_pthis,\
922 void __func1( struct vsf_peda_local(__name) *vsf_pthis,\
925 void __func2( struct vsf_peda_local(__name) *vsf_pthis,\
928 void __func3( struct vsf_peda_local(__name) *vsf_pthis,\
931 void __func4( struct vsf_peda_local(__name) *vsf_pthis,\
934 void __func5( struct vsf_peda_local(__name) *vsf_pthis,\
937 void __func6( struct vsf_peda_local(__name) *vsf_pthis,\
940# define declare_vsf_peda_methods8( __decoration, __name, __func1, __func2, \
941 __func3, __func4, __func5, __func6, \
943 declare_vsf_peda_ctx(__name) \
945 void vsf_peda_func(__name)( \
946 struct vsf_peda_local(__name) *vsf_pthis,\
949 void __func1( struct vsf_peda_local(__name) *vsf_pthis,\
952 void __func2( struct vsf_peda_local(__name) *vsf_pthis,\
955 void __func3( struct vsf_peda_local(__name) *vsf_pthis,\
958 void __func4( struct vsf_peda_local(__name) *vsf_pthis,\
961 void __func5( struct vsf_peda_local(__name) *vsf_pthis,\
964 void __func6( struct vsf_peda_local(__name) *vsf_pthis,\
967 void __func7( struct vsf_peda_local(__name) *vsf_pthis,\
986#define declare_vsf_peda_methods(__decoration, ...) \
987 __PLOOC_EVAL(declare_vsf_peda_methods, __VA_ARGS__) \
988 (__decoration, __VA_ARGS__)
1000#define dcl_vsf_peda_methods(__decoration, ...) \
1001 declare_vsf_peda_methods(__decoration, __VA_ARGS__)
1003# if __IS_COMPILER_IAR__
1004# define __def_vsf_peda_ctx4(__name, __param, __arg, __local) \
1005 struct vsf_peda_param(__name) { \
1007 uint8_t VSF_MCONNECT4(_,__LINE__,__COUNTER__,_canary); \
1009 struct vsf_peda_arg(__name) { \
1011 uint8_t VSF_MCONNECT4(_,__LINE__,__COUNTER__,_canary); \
1013 struct vsf_peda_local(__name) { \
1014 implement(vsf_peda_arg(__name)) \
1018# define __def_vsf_peda_ctx4(__name, __param, __arg, __local) \
1019 struct vsf_peda_param(__name) { \
1022 struct vsf_peda_arg(__name) { \
1025 struct vsf_peda_local(__name) { \
1026 implement(vsf_peda_arg(__name)) \
1031# define __def_vsf_peda4(__name, __param, __arg, __local) \
1032 __def_vsf_peda_ctx4(__name, __param, __arg, __local) \
1034 implement(vsf_peda_t) \
1035 implement_ex(vsf_peda_param(__name), param) \
1038# if __IS_COMPILER_IAR__
1039# define __def_vsf_peda_ctx3(__name, __param, __arg) \
1040 struct vsf_peda_param(__name) { \
1042 uint8_t VSF_MCONNECT4(_,__LINE__,__COUNTER__,_canary); \
1044 struct vsf_peda_arg(__name) { \
1046 uint8_t VSF_MCONNECT4(_,__LINE__,__COUNTER__,_canary); \
1048 struct vsf_peda_local(__name) { \
1049 implement(vsf_peda_arg(__name)) \
1052# define __def_vsf_peda_ctx3(__name, __param, __arg) \
1053 struct vsf_peda_param(__name) { \
1056 struct vsf_peda_arg(__name) { \
1059 struct vsf_peda_local(__name) { \
1060 implement(vsf_peda_arg(__name)) \
1064# define __def_vsf_peda3(__name, __param, __arg) \
1065 __def_vsf_peda_ctx3(__name, __param, __arg) \
1067 implement(vsf_peda_t) \
1068 implement_ex(vsf_peda_param(__name), param) \
1072# if __IS_COMPILER_IAR__
1073# define __def_vsf_peda_ctx2(__name, __param) \
1074 struct vsf_peda_param(__name) { \
1076 uint8_t VSF_MCONNECT4(_,__LINE__,__COUNTER__,_canary); \
1078 struct vsf_peda_arg(__name) { \
1079 uint8_t VSF_MCONNECT4(_,__LINE__,__COUNTER__,_canary); \
1081 struct vsf_peda_local(__name) { \
1082 implement(vsf_peda_arg(__name)) \
1085# define __def_vsf_peda_ctx2(__name, __param) \
1086 struct vsf_peda_param(__name) { \
1089 struct vsf_peda_arg(__name) { \
1091 struct vsf_peda_local(__name) { \
1092 implement(vsf_peda_arg(__name)) \
1096# define __def_vsf_peda_ctx1(__name) \
1097 __def_vsf_peda_ctx2(__name, )
1099# define __def_vsf_peda2(__name, __param) \
1100 __def_vsf_peda_ctx2(__name, __param) \
1102 implement(vsf_peda_t) \
1103 implement_ex(vsf_peda_param(__name), param) \
1106# define __def_vsf_peda1(__name) \
1107 __def_vsf_peda_ctx1(__name) \
1109 implement(vsf_peda_t) \
1110 implement_ex(vsf_peda_param(__name), param) \
1129# define def_vsf_peda(...) \
1130 __PLOOC_EVAL(__def_vsf_peda, __VA_ARGS__) (__VA_ARGS__)
1138# define end_def_vsf_peda(...)
1155# define def_vsf_peda_ctx(...) \
1156 __PLOOC_EVAL(__def_vsf_peda_ctx, __VA_ARGS__)(__VA_ARGS__)
1164# define end_def_vsf_peda_ctx(...)
1175# define define_vsf_peda_ctx(__name, ...) \
1176 def_vsf_peda_ctx(__name, __VA_ARGS__)
1184# define end_define_vsf_peda_ctx(...)
1192# define def_locals(...) ,##__VA_ARGS__
1199# define end_def_locals(...)
1207# define define_locals(...) ,##__VA_ARGS__
1214# define end_define_locals(...)
1222# define def_args(...) ,__VA_ARGS__
1229# define end_def_args(...)
1237# define define_args(...) ,__VA_ARGS__
1244# define end_define_args(...)
1252# define define_arguments(...) ,__VA_ARGS__
1259# define end_define_arguments(...)
1267# define define_parameters(...) __VA_ARGS__
1274# define end_define_parameters(...)
1290#if VSF_KERNEL_CFG_EDA_SUPPORT_TIMER == ENABLED
1291# define vsf_peda_start vsf_teda_start
1293# define vsf_peda_start vsf_eda_start
1296# define __init_vsf_peda(__name, __param_eda, __pri, ...) \
1298 vsf_eda_cfg_t VSF_MACRO_SAFE_NAME(cfg) = { \
1299 .fn.param_evthandler = \
1300 (vsf_param_eda_evthandler_t)vsf_peda_func(__name), \
1301 .priority = (__pri), \
1302 .target = (uintptr_t)&((__param_eda)->param), \
1303 .local_size = sizeof(vsf_peda_local(__name)), \
1306 vsf_peda_start((vsf_peda_t *)(__param_eda), \
1307 &VSF_MACRO_SAFE_NAME(cfg)); \
1332# define init_vsf_peda(__name, __param_eda, __pri, ...) \
1333 __init_vsf_peda(__name, (__param_eda), (__pri), __VA_ARGS__)
1336# define __implement_vsf_peda2(__name, __func_name) \
1337 void __func_name( struct vsf_peda_local(__name) *vsf_plocal, \
1340 vsf_peda_param(__name) *vsf_pthis = \
1341 *(vsf_peda_param(__name) **) \
1342 ((uintptr_t)vsf_plocal - sizeof(uintptr_t)); \
1343 VSF_UNUSED_PARAM(vsf_pthis); \
1344 VSF_KERNEL_ASSERT(NULL != vsf_pthis || NULL != vsf_plocal);
1346# define __implement_vsf_peda1(__name) \
1347 void vsf_peda_func(__name)( struct vsf_peda_local(__name) *vsf_plocal, \
1350 vsf_peda_param(__name) *vsf_pthis = \
1351 *(vsf_peda_param(__name) **) \
1352 ((uintptr_t)vsf_plocal - sizeof(uintptr_t)); \
1353 VSF_UNUSED_PARAM(vsf_pthis); \
1354 VSF_KERNEL_ASSERT(NULL != vsf_pthis || NULL != vsf_plocal);
1364# define vsf_peda_begin()
1374# define vsf_peda_end() \
1393# define implement_vsf_peda(...) \
1394 __PLOOC_EVAL(__implement_vsf_peda, __VA_ARGS__)(__VA_ARGS__)
1405# define imp_vsf_peda(...) \
1406 implement_vsf_peda(__VA_ARGS__)
1430# define vsf_eda_call_peda(__name, __param) \
1431 vsf_eda_call_param_eda( vsf_peda_func(__name), \
1433 sizeof(vsf_peda_local(__name)))
1441# define vsf_local (*vsf_plocal)
1450# define vsf_this (*vsf_pthis)
1461#define vsf_eda_mutex_try_enter vsf_eda_mutex_enter
1470#define vsf_eda_crit_try_enter vsf_eda_crit_enter
1481#ifndef VSF_KERNEL_TIMEOUT_TICK_T
1482# define VSF_KERNEL_TIMEOUT_TICK_T int_fast64_t
1518#if VSF_KERNEL_CFG_SUPPORT_THREAD == ENABLED && VSF_KERNEL_CFG_THREAD_SIGNAL == ENABLED
1613#if VSF_KERNEL_CFG_CPU_USAGE == ENABLED || VSF_KERNEL_CFG_EDA_CPU_USAGE == ENABLED
1683#if VSF_KERNEL_CFG_EDA_USER_BITLEN <= 8 - 3
1686#elif VSF_KERNEL_CFG_EDA_USER_BITLEN <= 16 - 3
1689#elif VSF_KERNEL_CFG_EDA_USER_BITLEN <= 32 - 3
1693# error VSF_KERNEL_CFG_EDA_USER_BITLEN not supported yet
1704#if VSF_KERNEL_CFG_EDA_SUPPORT_SUB_CALL == ENABLED
1717#if VSF_KERNEL_USE_SIMPLE_SHELL == ENABLED
1722#if VSF_KERNEL_CFG_EDA_SUBCALL_HAS_RETURN_VALUE == ENABLED
1739#if VSF_KERNEL_CFG_ALLOW_KERNEL_BEING_PREEMPTED == ENABLED
1740# if VSF_KERNEL_CFG_SUPPORT_DYNAMIC_PRIOTIRY == ENABLED
1748#if VSF_KERNEL_CFG_SUPPORT_SYNC == ENABLED
1752# if (VSF_KERNEL_CFG_EDA_SUPPORT_TIMER == ENABLED) && defined(__VSF_OS_CFG_EVTQ_LIST)
1757#if VSF_KERNEL_CFG_EDA_SUPPORT_TIMER == ENABLED
1839#if VSF_KERNEL_CFG_EDA_SUPPORT_ON_TERMINATE == ENABLED
1870# if VSF_KERNEL_CFG_ALLOW_KERNEL_BEING_PREEMPTED == ENABLED
1871# if VSF_KERNEL_CFG_SUPPORT_DYNAMIC_PRIOTIRY == ENABLED
1886# if VSF_KERNEL_CFG_EDA_SUBCALL_HAS_RETURN_VALUE == ENABLED
1888 int8_t subcall_return_value;
1890# if VSF_KERNEL_OPT_AVOID_UNNECESSARY_YIELD_EVT == ENABLED
1891 bool is_evt_incoming;
1904#if VSF_KERNEL_CFG_EDA_SUPPORT_TIMER == ENABLED
1927#if VSF_KERNEL_CFG_SUPPORT_CALLBACK_TIMER == ENABLED
1955#if VSF_KERNEL_CFG_SUPPORT_SYNC == ENABLED
2019#ifndef __VSF_BITMAP_EVT_DEFINED__
2020#define __VSF_BITMAP_EVT_DEFINED__
2029#define VSF_BMPEVT_OR 0
2037#define VSF_BMPEVT_AND 1
2160#if VSF_KERNEL_CFG_SUPPORT_EDA_QUEUE == ENABLED
2196#if VSF_KERNEL_CFG_QUEUE_MULTI_TX_EN == ENABLED
2222#
if VSF_EDA_QUEUE_CFG_REGION ==
ENABLED
2235#if VSF_EDA_QUEUE_CFG_SUPPORT_ISR == ENABLED
2238#if VSF_KERNEL_CFG_QUEUE_HAS_RX_NOTIFIED == ENABLED
2248# if VSF_KERNEL_CFG_EDA_SUPPORT_TIMER == ENABLED
2393#if VSF_KERNEL_CFG_EDA_SUPPORT_TIMER == ENABLED
2395# if VSF_KERNEL_CFG_TIMER_MODE == VSF_KERNEL_CFG_TIMER_MODE_TICK
2462#if defined(__VSF_EDA_CLASS_INHERIT__) || defined(__VSF_EDA_CLASS_IMPLEMENT)
2524# if VSF_KERNEL_CFG_SUPPORT_SYNC == ENABLED
2547# if VSF_KERNEL_USE_SIMPLE_SHELL == ENABLED
2662#if VSF_KERNEL_USE_SIMPLE_SHELL == ENABLED
2703#if VSF_KERNEL_CFG_EDA_SUPPORT_SUB_CALL == ENABLED
2740#if VSF_KERNEL_CFG_EDA_CPU_USAGE == ENABLED
2781#if defined(__VSF_EDA_CLASS_INHERIT__) || defined(__VSF_EDA_CLASS_IMPLEMENT)
2842# if VSF_KERNEL_CFG_SUPPORT_DYNAMIC_PRIOTIRY == ENABLED
2912#if VSF_KERNEL_CFG_EDA_SUPPORT_SUB_CALL == ENABLED
3120#if VSF_KERNEL_CFG_EDA_SUPPORT_TIMER == ENABLED
3299# if VSF_KERNEL_CFG_SUPPORT_CALLBACK_TIMER == ENABLED
3384# if VSF_CALLBACK_TIMER_CFG_SUPPORT_ISR == ENABLED
3573#if VSF_KERNEL_CFG_SUPPORT_EVT_MESSAGE == ENABLED
3600#if VSF_KERNEL_CFG_SUPPORT_SYNC == ENABLED
3627#if VSF_SYNC_CFG_SUPPORT_ISR == ENABLED
3847#if VSF_KERNEL_CFG_SUPPORT_BITMAP_EVENT == ENABLED
4032#if VSF_KERNEL_CFG_SUPPORT_EDA_QUEUE == ENABLED
4277# if VSF_EDA_QUEUE_CFG_SUPPORT_ISR == ENABLED
4344#undef __VSF_EDA_CLASS_INHERIT__
4345#undef __VSF_EDA_CLASS_IMPLEMENT
4349#if VSF_KERNEL_CFG_TRACE == ENABLED
4350# ifdef VSF_KERNEL_CFG_TRACE_HEADER
4351# include VSF_KERNEL_CFG_TRACE_HEADER
#define VSF_CAL_SECTION(__SEC_STR)
Definition __compiler.h:189
#define ENABLED
Definition __type.h:28
vsf_err_t
Definition __type.h:42
Definition vsf_eda.h:1784
bmpevt adapter with an internal eda
Definition vsf_eda.h:2086
Adapter mapping an IPC object (e.g. a semaphore) onto bitmap-event bits, so one task can wait on mult...
Definition vsf_eda.h:2062
Wait condition of a bitmap-event wait.
Definition vsf_eda.h:2104
Bitmap-event group.
Definition vsf_eda.h:2129
Task-independent timer; when it expires the kernel task invokes the user callback.
Definition vsf_eda.h:1937
OS-aware queue; send pends while full, recv pends while empty; backend ops are supplied by the user (...
Definition vsf_eda.h:2193
The event-driven task (TCB); every VSF task is an eda at the bottom. Tasks share stacks and only occu...
Definition vsf_eda.h:1838
Sync object with an owner (mutex base); supports priority inheritance; the owner must leave it itself...
Definition vsf_eda.h:2009
Base sync IPC object; sem/mutex/trig/crit are built on it.
Definition vsf_eda.h:1964
eda with timer support (can use vsf_teda_set_timer() etc.); derived classes (task/pt/thread) inherit ...
Definition vsf_eda.h:1916
uint64_t vsf_systimer_tick_t
Definition cortex_a_generic.h:70
vsf_arch_prio_t
Definition cortex_a_generic.h:85
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
#define max(x, y)
Definition minmax.h:12
#define vsf_dcl_class
Definition ooc_class.h:50
#define vsf_class(__name)
Definition ooc_class.h:52
uint32_t uintptr_t
Definition stdint.h:38
short int16_t
Definition stdint.h:6
unsigned short uint16_t
Definition stdint.h:7
unsigned char uint_fast8_t
Definition stdint.h:23
unsigned uint32_t
Definition stdint.h:9
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
unsigned char uint8_t
Definition stdint.h:5
signed char int8_t
Definition stdint.h:4
Definition vsf_eda.h:1778
uint16_t local_size
Definition vsf_eda.h:1780
vsf_eda_feature_t feature
Definition vsf_eda.h:1779
Adapter mapping a nested vsf_bmpevt_t onto bitmap-event bits.
Definition vsf_eda.h:2342
Adapter init/reset operations, mapping an IPC object (e.g. a semaphore) onto bitmap-event bits so one...
Definition vsf_eda.h:2047
vsf_err_t(* reset)(vsf_bmpevt_adapter_t *pthis)
Definition vsf_eda.h:2049
vsf_err_t(* init)(vsf_bmpevt_adapter_t *pthis)
Definition vsf_eda.h:2048
Adapter mapping a vsf_sync_t onto bitmap-event bits.
Definition vsf_eda.h:2331
vsf_bmpevt_adapter_eda_t vsf_sync_t * sync
Definition vsf_eda.h:2333
Context for per-task CPU usage sampling; the user provides the ctx storage and must keep it valid unt...
Definition vsf_eda.h:1624
vsf_systimer_tick_t duration
Definition vsf_eda.h:1626
vsf_systimer_tick_t ticks
Definition vsf_eda.h:1625
Per-task CPU usage sampling data; points to the user-provided sampling context vsf_cpu_usage_ctx_t.
Definition vsf_eda.h:1635
vsf_systimer_tick_t ticks
Definition vsf_eda.h:1636
vsf_cpu_usage_ctx_t * ctx
Definition vsf_eda.h:1637
Definition vsf_list.h:888
Definition vsf_list.h:883
Configuration for starting an eda/teda task (vsf_eda_start(), vsf_teda_start(), init_vsf_peda(),...
Definition vsf_eda.h:1804
uint16_t local_size
Definition vsf_eda.h:1821
vsf_eda_on_terminate_t on_terminate
Definition vsf_eda.h:1811
uintptr_t target
Definition vsf_eda.h:1825
vsf_prio_t priority
Definition vsf_eda.h:1815
__vsf_eda_fn_t fn
Definition vsf_eda.h:1807
vsf_eda_feature_t feature
Definition vsf_eda.h:1818
User-provided queue backend operations for vsf_eda_queue_t; enqueue/dequeue return bool success,...
Definition vsf_eda.h:2168
bool(* enqueue)(vsf_eda_queue_t *pthis, void *node)
Definition vsf_eda.h:2169
bool(* dequeue)(vsf_eda_queue_t *pthis, void **node)
Definition vsf_eda.h:2170
Definition vsf_eda.h:2384
vsf_arch_prio_t systimer_arch_prio
Definition vsf_eda.h:2386
vsf_prio_t highest_prio
Definition vsf_eda.h:2385
Definition vsf_arch_abstraction.h:61
Definition vsf_list.h:876
Definition vsf_list.h:896
Definition vsf_list.h:872
Definition vsf_eda.h:1764
__vsf_eda_state_t state
Definition vsf_eda.h:1766
vsf_eda_feature_t feature
Definition vsf_eda.h:1767
__vsf_eda_flag_word value
Definition vsf_eda.h:1769
Definition vsf_eda.h:1772
vsf_param_eda_evthandler_t param_evthandler
Definition vsf_eda.h:1775
vsf_eda_evthandler_t evthandler
Definition vsf_eda.h:1774
uintptr_t func
Definition vsf_eda.h:1773
Definition vsf_eda.h:1737
uint8_t is_to_set_due
Definition vsf_eda.h:1753
uint8_t is_to_exit
Definition vsf_eda.h:1743
uint8_t is_limitted
Definition vsf_eda.h:1750
uint8_t is_timed
Definition vsf_eda.h:1758
uint8_t value
Definition vsf_eda.h:1761
uint8_t is_new_prio
Definition vsf_eda.h:1741
uint8_t is_sync_got
Definition vsf_eda.h:1751
Task feature flags passed in vsf_eda_cfg_t.
Definition vsf_eda.h:1702
__vsf_eda_feature_word is_subcall_has_return_value
Definition vsf_eda.h:1725
__vsf_eda_feature_word is_stack_owner
Definition vsf_eda.h:1720
__vsf_eda_feature_word user_bits
Definition vsf_eda.h:1730
__vsf_eda_feature_word is_use_frame
Definition vsf_eda.h:1715
__vsf_eda_feature_word value
Definition vsf_eda.h:1734
vk_av_control_value_t value
Definition vsf_audio.h:171
vsf_err_t vsf_eda_set_evthandler(vsf_eda_t *pthis, vsf_eda_evthandler_t evthandler)
Definition vsf_eda.c:745
void __vsf_eda_on_terminate(vsf_eda_t *pthis)
Definition vsf_eda.c:149
void __vsf_dispatch_evt(vsf_eda_t *pthis, vsf_evt_t evt)
Definition vsf_eda.c:224
void vsf_eda_polling_state_set(vsf_eda_t *pthis, bool state)
Definition vsf_eda.c:436
vsf_err_t __vsf_eda_init(vsf_eda_t *pthis, vsf_prio_t priority, vsf_eda_feature_t feature)
Definition vsf_eda.c:819
vsf_err_t __vsf_eda_post_evt_ex(vsf_eda_t *pthis, vsf_evt_t evt, bool force)
Definition vsf_eda.c:953
void vsf_kernel_init(const vsf_kernel_cfg_t *cfg_ptr)
Definition vsf_eda.c:162
bool vsf_eda_polling_state_get(vsf_eda_t *pthis)
Definition vsf_eda.c:429
vsf_err_t vsf_eda_fini(vsf_eda_t *pthis)
Definition vsf_eda.c:903
int16_t vsf_evt_t
Kernel event type.
Definition vsf_eda.h:1658
vsf_mutex_t vsf_crit_t
Critical section (alias of mutex semantics)
Definition vsf_eda.h:2323
uintptr_t vsf_eda_get_return_value(void)
Get the return value passed back by the sub-called task.
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)
Initialize a sync object, the base of semaphore, mutex, trigger etc.
void vsf_systimer_on_tick(void)
System timer tick handler; called by the user on every system tick to drive the kernel timers.
vsf_sync_reason_t vsf_eda_sync_get_reason(vsf_sync_t *pthis, vsf_evt_t evt)
Retrieve the result of a sync operation from the wakeup event.
struct vsf_bmpevt_adapter_op_t vsf_bmpevt_adapter_op_t
Adapter init/reset operations, mapping an IPC object (e.g. a semaphore) onto bitmap-event bits so one...
vsf_sync_owner_t vsf_mutex_t
Mutex (vsf_sync_owner_t with priority inheritance); the owner must leave it itself.
Definition vsf_eda.h:2316
vsf_err_t vsf_eda_bmpevt_reset(vsf_bmpevt_t *pthis, uint_fast32_t mask)
Reset (clear) event bits of a bitmap event, resetting the bound adapters whose bits are cleared.
void __vsf_eda_yield(void)
Yield the current task by posting VSF_EVT_YIELD to itself, so that it is dispatched again later.
Definition vsf_eda.c:539
vsf_err_t vsf_teda_cancel_timer(void)
Cancel the pending timer of the current teda task.
vsf_err_t vsf_callback_timer_add_isr(vsf_callback_timer_t *timer, vsf_systimer_tick_t tick)
Add a callback timer with a relative interval in ticks from interrupt context.
void(* vsf_eda_on_terminate_t)(vsf_eda_t *eda)
On-terminate callback; invoked with the terminating task (eda)
Definition vsf_eda.h:1673
uint8_t vsf_eda_get_user_value(void)
Get the user-defined bits in the feature of the current eda.
Definition vsf_eda.c:556
vsf_err_t vsf_eda_queue_init(vsf_eda_queue_t *pthis, uint_fast16_t max)
Initialize an OS-aware queue whose enqueue/dequeue operations are provided by the user in the op memb...
vsf_err_t vsf_callback_timer_remove_isr(vsf_callback_timer_t *timer)
Remove a callback timer from interrupt context.
vsf_err_t vsf_teda_set_timer(vsf_systimer_tick_t tick)
Set a one-shot timer of the given ticks for the current teda task; the task receives VSF_EVT_TIMER wh...
vsf_err_t vsf_eda_post_evt(vsf_eda_t *pthis, vsf_evt_t evt)
Post an event to an eda task.
Definition vsf_eda.c:935
vsf_err_t vsf_eda_bmpevt_cancel(vsf_bmpevt_t *pthis, uint_fast32_t mask)
Cancel the pending tasks on a bitmap event whose mask intersects the given mask; they are woken with ...
vsf_sync_t vsf_trig_t
Trigger/event flag (sync with max 1, auto or manual reset)
Definition vsf_eda.h:2303
vsf_teda_t vsf_peda_t
Definition vsf_eda.h:2249
#define VSF_KERNEL_TIMEOUT_TICK_T
Underlying integer type of vsf_timeout_tick_t; redefine it before including this header to change the...
Definition vsf_eda.h:1482
vsf_err_t vsf_eda_sync_increase(vsf_sync_t *pthis)
Increase a sync object, waking up the pending tasks if any.
union __vsf_eda_state_t __vsf_eda_state_t
@ VSF_EVT_NONE
No event; compatible with fsm_rt_cpl.
Definition vsf_eda.h:1512
@ VSF_EVT_SYNC_CANCEL
The pending sync IPC was cancelled (e.g. by vsf_eda_sync_cancel())
Definition vsf_eda.h:1583
@ VSF_EVT_SYNC
A pending sync IPC (semaphore/mutex/trigger/queue/bmpevt) was obtained.
Definition vsf_eda.h:1577
@ VSF_EVT_SYNC_POLL
Sync poll event (used by bmpevt polling)
Definition vsf_eda.h:1588
@ VSF_EVT_SYSTEM
Base of system events; system events start here, user events start at VSF_EVT_USER.
Definition vsf_eda.h:1531
@ VSF_EVT_DUMMY
Dummy system event.
Definition vsf_eda.h:1536
@ VSF_EVT_SIGNAL
POSIX-like thread signal event (VSF_KERNEL_CFG_THREAD_SIGNAL)
Definition vsf_eda.h:1523
@ VSF_EVT_EXIT
Received when a called sub task returns.
Definition vsf_eda.h:1556
@ VSF_EVT_YIELD
Cooperative yield event; compatible with fsm_rt_on_going.
Definition vsf_eda.h:1517
@ VSF_EVT_INVALID
Invalid event; waiting for it means waiting for any event; also compatible with fsm_rt_err.
Definition vsf_eda.h:1507
@ VSF_EVT_INIT
Received once when a task starts.
Definition vsf_eda.h:1541
@ VSF_EVT_ENTER
Received when entering a sub-call frame.
Definition vsf_eda.h:1551
@ VSF_EVT_FINI
Received once when a task terminates.
Definition vsf_eda.h:1546
@ VSF_EVT_MESSAGE
A message event carrying a pointer, retrieved with vsf_eda_get_cur_msg()
Definition vsf_eda.h:1596
@ VSF_EVT_RETURN
Same value as VSF_EVT_EXIT; received when a called sub task returns.
Definition vsf_eda.h:1562
@ VSF_EVT_TIMER
teda timer expired (only for teda tasks)
Definition vsf_eda.h:1569
@ VSF_EVT_USER
Base of user-defined events; values from here on are user events.
Definition vsf_eda.h:1602
vsf_err_t vsf_eda_queue_recv_isr(vsf_eda_queue_t *pthis, void **node)
Receive a node from a queue from interrupt context.
void vsf_eda_queue_cancel(vsf_eda_queue_t *pthis)
Cancel all pending senders and the pending receiver on a queue; they are woken with VSF_EVT_SYNC_CANC...
vsf_err_t vsf_eda_bmpevt_set(vsf_bmpevt_t *pthis, uint_fast32_t mask)
Set event bits of a bitmap event, polling the pending tasks.
void vsf_eda_cpu_usage_start(vsf_eda_t *pthis, vsf_cpu_usage_ctx_t *ctx)
Start measuring the CPU usage of an eda task.
Definition vsf_eda.c:976
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)
Prepare an extended sub-call frame without dispatching VSF_EVT_INIT.
Definition vsf_eda.c:633
vsf_kernel_error_t
Kernel error codes reported to vsf_kernel_err_report()
Definition vsf_eda.h:2355
@ VSF_KERNEL_ERR_INVALID_CONTEXT
API called from an invalid context.
Definition vsf_eda.h:2365
@ VSF_KERNEL_ERR_NONE
No error.
Definition vsf_eda.h:2360
@ VSF_KERNEL_ERR_SHOULD_NOT_USE_PRIO_INHERIT_IN_IDLE_OR_ISR
vsf_prio_inherit used where there is no current event queue (idle or ISR)
Definition vsf_eda.h:2381
@ VSF_KERNEL_ERR_EDA_DOES_NOT_SUPPORT_TIMER
Timer service used on an eda without timer support.
Definition vsf_eda.h:2375
@ VSF_KERNEL_ERR_INVALID_USAGE
API used incorrectly.
Definition vsf_eda.h:2370
struct vsf_kernel_cfg_t vsf_kernel_cfg_t
union vsf_eda_feature_t vsf_eda_feature_t
Task feature flags passed in vsf_eda_cfg_t.
vsf_err_t vsf_eda_go_to(uintptr_t evthandler)
Switch the current task to a new event handler and post VSF_EVT_INIT to it.
Definition vsf_eda.c:762
void(* vsf_eda_evthandler_t)(vsf_eda_t *eda, vsf_evt_t evt)
eda event handler; invoked with the task (eda) and the event (evt)
Definition vsf_eda.h:1666
vsf_sync_t __vsf_crit_npb_t
Definition vsf_eda.h:2305
const vsf_bmpevt_adapter_op_t vsf_eda_bmpevt_adapter_bmpevt_op
Adapter operation table vsf_bmpevt_adapter_op_t used to bind another bitmap event to a bitmap event.
struct __vsf_eda_frame_state_t __vsf_eda_frame_state_t
vsf_err_t vsf_eda_bmpevt_init(vsf_bmpevt_t *pthis, uint_fast8_t adapter_count)
Initialize a bitmap event, initializing the bound adapters as well.
void vsf_callback_timer_init(vsf_callback_timer_t *timer)
Initialize a task-independent callback timer; set the on_timer callback before adding the timer.
void vsf_eda_cpu_usage_stop(vsf_eda_t *pthis)
Stop measuring the CPU usage of an eda task.
Definition vsf_eda.c:990
vsf_err_t vsf_eda_sync_decrease(vsf_sync_t *pthis, vsf_timeout_tick_t timeout)
Decrease a sync object, pending if the resource is not available.
struct vsf_eda_queue_op_t vsf_eda_queue_op_t
User-provided queue backend operations for vsf_eda_queue_t; enqueue/dequeue return bool success,...
union __vsf_eda_flag_t __vsf_eda_flag_t
vsf_err_t vsf_eda_post_evt_msg(vsf_eda_t *pthis, vsf_evt_t evt, void *msg)
Post an event carrying a pointer message to an eda task; the pointer is retrieved with vsf_eda_get_cu...
Definition vsf_eda.c:969
uintptr_t vsf_eda_target_get(void)
Get the target parameter of the current frame of the current task.
Definition vsf_eda.c:615
vsf_systimer_tick_t vsf_systimer_get_elapsed(vsf_systimer_tick_t from_time)
Get the ticks elapsed from the given tick count to now.
vsf_systimer_tick_t vsf_systimer_get_tick(void)
Get the current system timer tick count.
vsf_err_t vsf_eda_start(vsf_eda_t *pthis, vsf_eda_cfg_t *cfg)
Start an eda task with the given configuration and post VSF_EVT_INIT to it.
Definition vsf_eda.c:835
vsf_err_t vsf_callback_timer_add_due(vsf_callback_timer_t *timer, vsf_systimer_tick_t due)
Add a callback timer with an absolute due tick.
uintptr_t __vsf_eda_get_local(vsf_eda_t *pthis)
Get the local variable storage of a frame-based eda.
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)
Receive a node from a queue on behalf of the given eda.
struct vsf_eda_cfg_t vsf_eda_cfg_t
Configuration for starting an eda/teda task (vsf_eda_start(), vsf_teda_start(), init_vsf_peda(),...
vsf_err_t vsf_eda_bmpevt_pend(vsf_bmpevt_t *pthis, vsf_bmpevt_pender_t *pender, vsf_timeout_tick_t timeout)
Pend on a bitmap event until the masked bits are set (in OR or AND mode according to the pender confi...
VSF_KERNEL_TIMEOUT_TICK_T vsf_timeout_tick_t
Timeout type in system timer ticks: negative means wait forever, 0 means non-blocking try,...
Definition vsf_eda.h:1491
vsf_err_t vsf_teda_set_timer_ex(vsf_teda_t *pthis, vsf_systimer_tick_t tick)
Set a one-shot timer of the given ticks for the given teda task; the task receives VSF_EVT_TIMER when...
vsf_err_t vsf_callback_timer_add(vsf_callback_timer_t *timer, vsf_systimer_tick_t tick)
Add a callback timer with a relative interval in ticks.
vsf_sync_reason_t vsf_eda_bmpevt_poll(vsf_bmpevt_t *pthis, vsf_bmpevt_pender_t *pender, vsf_evt_t evt)
Retrieve the result of a bitmap event pend from the wakeup event.
vsf_err_t vsf_teda_start(vsf_teda_t *pthis, vsf_eda_cfg_t *cfg)
Start a teda (eda with timer support) task with the given configuration and post VSF_EVT_INIT to it.
uint_fast16_t vsf_eda_queue_get_cnt(vsf_eda_queue_t *pthis)
Get the number of nodes currently held in a queue.
void vsf_eda_set_user_value(uint8_t value)
Set the user-defined bits in the feature of the current eda.
Definition vsf_eda.c:547
vsf_err_t vsf_eda_queue_recv(vsf_eda_queue_t *pthis, void **node, vsf_timeout_tick_t timeout)
Receive a node from a queue, pending while the queue is empty.
void * vsf_eda_get_cur_msg(void)
Get the pointer message carried by the current event (e.g. VSF_EVT_MESSAGE)
Definition vsf_eda.c:466
uint16_t __vsf_eda_flag_word
Definition vsf_eda.h:1685
@ VSF_KERNEL_EVT_QUEUE_SEND_NOTIFY
Definition vsf_eda.h:1609
@ VSF_KERNEL_EVT_CALLBACK_TIMER
Definition vsf_eda.h:1607
@ VSF_KERNEL_EVT_QUEUE_RECV_NOTIFY
Definition vsf_eda.h:1610
@ VSF_KERNEL_EVT_CALLBACK_TIMER_ADD
Definition vsf_eda.h:1608
struct vsf_cpu_usage_ctx_t vsf_cpu_usage_ctx_t
Context for per-task CPU usage sampling; the user provides the ctx storage and must keep it valid unt...
vsf_err_t vsf_teda_set_due_ex(vsf_teda_t *this_ptr, vsf_systimer_tick_t due)
Set a one-shot timer with an absolute due tick for the given teda task.
uint8_t __vsf_eda_feature_word
Definition vsf_eda.h:1684
vsf_eda_t * vsf_eda_get_cur(void)
Get the eda task currently being dispatched.
Definition vsf_eda.c:416
vsf_err_t vsf_callback_timer_add_due_isr(vsf_callback_timer_t *timer, vsf_systimer_tick_t due)
Add a callback timer with an absolute due tick from interrupt context.
vsf_err_t __vsf_eda_go_to_ex(uintptr_t evthandler, uintptr_t param)
Switch the current frame to a new event handler with a target parameter and dispatch VSF_EVT_INIT.
Definition vsf_eda.c:723
vsf_err_t __vsf_eda_sync_decrease_ex(vsf_sync_t *pthis, vsf_timeout_tick_t timeout, vsf_eda_t *eda, bool manual)
Decrease a sync object with an explicit manual-reset flag.
vsf_systimer_tick_t vsf_systimer_get_duration(vsf_systimer_tick_t from_time, vsf_systimer_tick_t to_time)
Get the tick duration between two tick counts, handling wrap-around.
union __vsf_eda_fn_t __vsf_eda_fn_t
vsf_err_t vsf_eda_target_set(uintptr_t param)
Set the target parameter of the current frame of the current task.
Definition vsf_eda.c:601
void vsf_eda_sync_force_reset(vsf_sync_t *pthis)
Force the count of a sync object to 0.
vsf_err_t __vsf_eda_call_eda_ex(uintptr_t func, uintptr_t param, __vsf_eda_frame_state_t state, bool is_sub_call)
Extended sub-call: prepare a frame and dispatch VSF_EVT_INIT.
Definition vsf_eda.c:696
vsf_sync_t vsf_sem_t
Counting semaphore (vsf_sync_t with auto-reset)
Definition vsf_eda.h:2296
vsf_sync_reason_t vsf_eda_queue_send_get_reason(vsf_eda_queue_t *pthis, vsf_evt_t evt, void *node)
Retrieve the result of a queue send from the wakeup event, retrying the enqueue if the resource is ob...
#define VSF_KERNEL_CFG_EDA_USER_BITLEN
Definition vsf_eda.h:88
uintptr_t vsf_irq_enter(void)
Notify the kernel of entering interrupt context.
Definition vsf_eda.c:129
vsf_err_t vsf_eda_queue_send_isr(vsf_eda_queue_t *pthis, void *node)
Send a node to a queue from interrupt context.
vsf_evt_t vsf_eda_get_cur_evt(void)
Get the event currently being processed by the current task.
Definition vsf_eda.c:458
bool vsf_eda_is_stack_owner(vsf_eda_t *pthis)
Check whether an eda owns a dedicated stack.
Definition vsf_eda.c:450
struct vsf_cpu_usage_t vsf_cpu_usage_t
Per-task CPU usage sampling data; points to the user-provided sampling context vsf_cpu_usage_ctx_t.
const vsf_bmpevt_adapter_op_t vsf_eda_bmpevt_adapter_sync_op
Adapter operation table vsf_bmpevt_adapter_op_t used to bind a sync object to a bitmap event.
vsf_err_t __vsf_eda_sync_increase_ex(vsf_sync_t *pthis, vsf_eda_t *eda, bool manual)
Increase a sync object with an explicit manual-reset flag.
vsf_err_t __vsf_eda_call_eda_prepare(uintptr_t evthandler, uintptr_t param, size_t local_size)
Prepare a sub-call frame without dispatching VSF_EVT_INIT.
Definition vsf_eda.c:685
vsf_err_t __vsf_eda_call_eda(uintptr_t evthandler, uintptr_t param, size_t local_size)
Sub-call an event handler: prepare a frame and dispatch VSF_EVT_INIT.
Definition vsf_eda.c:730
vsf_err_t vsf_eda_post_msg(vsf_eda_t *pthis, void *msg)
Post a pointer message to an eda task; the task receives VSF_EVT_MESSAGE and retrieves the pointer wi...
Definition vsf_eda.c:961
vsf_err_t vsf_eda_queue_send_ex(vsf_eda_queue_t *pthis, void *node, vsf_timeout_tick_t timeout, vsf_eda_t *eda)
Send a node to a queue on behalf of the given eda.
void vsf_irq_leave(uintptr_t ctx)
Notify the kernel of leaving interrupt context.
Definition vsf_eda.c:141
vsf_err_t vsf_eda_sync_increase_isr(vsf_sync_t *pthis)
Increase a sync object from interrupt context.
vsf_sync_reason_t vsf_eda_queue_recv_get_reason(vsf_eda_queue_t *pthis, vsf_evt_t evt, void **node)
Retrieve the result of a queue receive from the wakeup event, retrying the dequeue if the resource is...
vsf_err_t vsf_eda_sync_decrease_ex(vsf_sync_t *pthis, vsf_timeout_tick_t timeout, vsf_eda_t *eda)
Decrease a sync object on behalf of the given eda.
void(* vsf_param_eda_evthandler_t)(uintptr_t target, vsf_evt_t evt)
Parameterized event handler; invoked with the user parameter (target) and the event (evt)
Definition vsf_eda.h:1681
bool __vsf_eda_return(uintptr_t return_value)
Return from the current (sub-called) eda with the given return value.
Definition vsf_eda.c:484
vsf_err_t __vsf_teda_cancel_timer(vsf_teda_t *pthis)
Cancel the pending timer of the given teda task.
vsf_sync_reason_t
Result of a sync wait, returned by the *_get_reason() APIs and thread IPC.
Definition vsf_eda.h:2262
@ VSF_SYNC_GET
Obtained.
Definition vsf_eda.h:2282
@ VSF_SYNC_FAIL
Failed/error.
Definition vsf_eda.h:2267
@ VSF_SYNC_CANCEL
Cancelled.
Definition vsf_eda.h:2287
@ VSF_SYNC_TIMEOUT
Timed out.
Definition vsf_eda.h:2272
@ VSF_SYNC_PENDING
Still waiting, retry.
Definition vsf_eda.h:2277
vsf_err_t vsf_eda_queue_send(vsf_eda_queue_t *pthis, void *node, vsf_timeout_tick_t timeout)
Send a node to a queue, pending while the queue is full.
vsf_err_t vsf_callback_timer_remove(vsf_callback_timer_t *timer)
Remove a callback timer before it expires.
vsf_err_t vsf_eda_sync_increase_ex(vsf_sync_t *pthis, vsf_eda_t *eda)
Increase a sync object on behalf of the given eda (e.g. the owner of a mutex)
void vsf_eda_sync_cancel(vsf_sync_t *pthis)
Cancel all pending tasks on a sync object; they are woken with VSF_EVT_SYNC_CANCEL.
vsf_prio_t __vsf_eda_get_cur_priority(vsf_eda_t *pthis)
Definition vsf_evtq_list.c:77
vsf_err_t __vsf_eda_set_priority(vsf_eda_t *pthis, vsf_prio_t priority)
Definition vsf_evtq_list.c:84
#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
Kernel priority enumeration.
Definition vsf_kernel_common.h:55
uint8_t state
Definition vsf_msg_tree.h:247