23#if VSF_USE_KERNEL == ENABLED && defined(__EDA_GADGET__)
38#if VSF_KERNEL_CFG_SUPPORT_SYNC == ENABLED
47 eda = __vsf_eda_get_valid_eda(eda);
50#if VSF_KERNEL_CFG_EDA_SUPPORT_TIMER == ENABLED
51 eda->flag.state.is_limitted =
true;
54 #ifndef WEAK_VSF_KERNEL_ERR_REPORT
67 eda = __vsf_eda_get_valid_eda(eda);
75 __vsf_eda_set_timeout(eda,
timeout);
90#if __IS_COMPILER_LLVM__ || __IS_COMPILER_ARM_COMPILER_6__
91# pragma clang diagnostic push
92# pragma clang diagnostic ignored "-Wcast-align"
95#if __IS_COMPILER_GCC__
96# pragma GCC diagnostic push
97# pragma GCC diagnostic ignored "-Wcast-align"
111#if VSF_KERNEL_CFG_EDA_SUPPORT_TIMER == ENABLED
114 if (eda->flag.state.is_sync_got) {
133 eda->flag.state.is_sync_got =
false;
140 eda->flag.state.is_limitted =
false;
144#if __IS_COMPILER_LLVM__ || __IS_COMPILER_ARM_COMPILER_6__
145# pragma clang diagnostic pop
147#if __IS_COMPILER_GCC__
148# pragma GCC diagnostic pop
156 pthis->cur_union.cur_value = cur;
157 pthis->max_union.max_value =
max;
159 if (pthis->cur_union.bits.has_owner) {
165#if VSF_SYNC_CFG_SUPPORT_ISR == ENABLED
183 if (pthis->cur_union.bits.cur >= pthis->max_union.bits.max) {
187 pthis->cur_union.bits.cur++;
188#if VSF_KERNEL_CFG_SUPPORT_DYNAMIC_PRIOTIRY == ENABLED
189 if (pthis->cur_union.bits.has_owner) {
190 eda = __vsf_eda_get_valid_eda(eda);
193 if (eda->cur_priority != eda->priority) {
195 }
else if (eda->flag.state.is_new_prio) {
199 eda->flag.state.is_new_prio =
false;
209 if (pthis->cur_union.bits.cur > 0) {
210 eda_pending = __vsf_eda_sync_get_eda_pending(pthis);
211 if (eda_pending !=
NULL) {
212 eda_pending->flag.state.is_sync_got =
true;
214 pthis->cur_union.bits.cur--;
216#if VSF_KERNEL_CFG_SUPPORT_DYNAMIC_PRIOTIRY == ENABLED
217 if (pthis->cur_union.bits.has_owner) {
224 if (eda_pending !=
NULL) {
257 pthis->cur_union.bits.cur = 0;
268 eda = __vsf_eda_get_valid_eda(eda);
273 pthis->cur_union.bits.cur--;
275#if VSF_KERNEL_CFG_SUPPORT_DYNAMIC_PRIOTIRY == ENABLED
276 if (pthis->cur_union.bits.has_owner) {
286#if VSF_KERNEL_CFG_SUPPORT_DYNAMIC_PRIOTIRY == ENABLED
287 if (pthis->cur_union.bits.has_owner) {
292 &pthis->pending_list,
294 _->cur_priority < cur_priority);
295 __vsf_eda_set_timeout(eda,
timeout);
301#if VSF_KERNEL_CFG_SUPPORT_DYNAMIC_PRIOTIRY == ENABLED
302 if (pthis->cur_union.bits.has_owner) {
305 if (eda->cur_priority > eda_owner->cur_priority) {
337 eda = __vsf_eda_sync_get_eda_pending(pthis);
339 eda->flag.state.is_sync_got =
true;
345 }
while (eda !=
NULL);
351 return __vsf_eda_sync_get_reason(pthis, evt,
true);
#define VSF_CAL_SECTION(__SEC)
Definition __compiler.h:181
#define VSF_UNUSED_PARAM(__VAL)
Definition __type.h:190
vsf_err_t
Definition __type.h:42
@ VSF_ERR_NONE
none error
Definition __type.h:44
@ VSF_ERR_NOT_READY
service not ready yet
Definition __type.h:43
@ VSF_ERR_OVERRUN
overrun
Definition __type.h:60
__le16 timeout
Definition ieee80211.h:94
#define NULL
Definition lvgl.h:26
#define max(x, y)
Definition minmax.h:12
unsigned short uint_fast16_t
Definition stdint.h:25
void sync(void)
Definition vsf_linux_fs.c:2137
uintalu_t vsf_protect_t
Definition vsf_arch_abstraction.h:53
vsf_eda_t * vsf_eda_get_cur(void)
Definition vsf_eda.c:416
vsf_err_t __vsf_os_evtq_set_priority(vsf_evtq_t *pthis, vsf_prio_t priority)
Definition vsf_os.c:342
vsf_err_t vsf_eda_post_msg(vsf_eda_t *pthis, void *msg)
Definition vsf_eda.c:955
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_kernel_err_report(enum vsf_kernel_error_t err)
Definition vsf_eda.c:409
int16_t vsf_evt_t
Definition vsf_eda.h:654
vsf_err_t vsf_eda_sync_init(vsf_sync_t *pthis, uint_fast16_t cur_value, uint_fast16_t max_value)
vsf_sync_reason_t vsf_eda_sync_get_reason(vsf_sync_t *pthis, vsf_evt_t evt)
vsf_err_t vsf_eda_sync_increase(vsf_sync_t *pthis)
@ VSF_KERNEL_ERR_EDA_DOES_NOT_SUPPORT_TIMER
Definition vsf_eda.h:1087
vsf_err_t vsf_eda_sync_decrease(vsf_sync_t *pthis, vsf_timeout_tick_t timeout)
@ VSF_EVT_SYNC_CANCEL
Definition vsf_eda.h:616
@ VSF_EVT_SYNC
Definition vsf_eda.h:615
@ VSF_EVT_TIMER
Definition vsf_eda.h:612
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_eda_set_priority(vsf_eda_t *pthis, vsf_prio_t prio)
Definition vsf_evtq_list.c:82
vsf_prio_t __vsf_eda_get_cur_priority(vsf_eda_t *pthis)
Definition vsf_evtq_list.c:75
vsf_err_t __vsf_eda_sync_decrease_ex(vsf_sync_t *pthis, vsf_timeout_tick_t timeout, vsf_eda_t *eda, bool manual)
void vsf_eda_sync_force_reset(vsf_sync_t *pthis)
vsf_err_t __vsf_eda_sync_increase_ex(vsf_sync_t *pthis, vsf_eda_t *eda, bool manual)
vsf_err_t vsf_eda_sync_increase_isr(vsf_sync_t *pthis)
vsf_err_t vsf_eda_sync_decrease_ex(vsf_sync_t *pthis, vsf_timeout_tick_t timeout, vsf_eda_t *eda)
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_sync_increase_ex(vsf_sync_t *pthis, vsf_eda_t *eda)
void vsf_eda_sync_cancel(vsf_sync_t *pthis)
#define VSF_KERNEL_ASSERT
Definition vsf_kernel_cfg.h:32
vsf_prio_t
Definition vsf_kernel_common.h:37
void __vsf_eda_sync_pend(vsf_sync_t *sync, vsf_eda_t *eda, vsf_timeout_tick_t timeout)
#define vsf_dlist_insert( __host_type, __member, __list_ptr, __item_ptr, __cond)
Definition vsf_list.h:769
#define vsf_dlist_queue_dequeue(__host_type, __member, __list_ptr, __item_ref_ptr)
Definition vsf_list.h:859
#define vsf_dlist_remove( __host_type, __member, __list_ptr, __item_ptr)
Definition vsf_list.h:810
#define vsf_dlist_is_empty(__list_ptr)
Definition vsf_list.h:705
#define vsf_dlist_init(__list_ptr)
Definition vsf_list.h:702
#define vsf_dlist_queue_enqueue(__host_type, __member, __list_ptr, __item_ptr)
Definition vsf_list.h:852
#define vsf_protect_sched()
Definition vsf_os.h:88
#define vsf_unprotect_sched(__prot)
Definition vsf_os.h:89
vsf_evtq_t * __vsf_os_evtq_get(vsf_prio_t priority)
Definition vsf_os.c:325