23#if VSF_USE_KERNEL == ENABLED && defined(__EDA_GADGET__)
37#if VSF_KERNEL_CFG_SUPPORT_SYNC == ENABLED
39#if VSF_KERNEL_CFG_SUPPORT_BITMAP_EVENT == ENABLED
58VSF_CAL_SECTION(
".text.vsf.kernel.__vsf_eda_bmpevt_adapter_sync_evthander")
76#if __IS_COMPILER_GCC__
77# pragma GCC diagnostic push
78# pragma GCC diagnostic ignored "-Wcast-align"
79#elif __IS_COMPILER_LLVM__ || __IS_COMPILER_ARM_COMPILER_6__
80# pragma clang diagnostic push
81# pragma clang diagnostic ignored "-Wcast-align"
91 adapter_eda->eda.fn.evthandler = __vsf_eda_bmpevt_adapter_sync_evthander;
92 return __vsf_eda_bmpevt_adapter_eda_init(adapter_eda);
103 if (
sync->max_union.bits.manual_rst) {
111 .
init = __vsf_eda_bmpevt_adapter_sync_init,
112 .reset = __vsf_eda_bmpevt_adapter_sync_reset,
115VSF_CAL_SECTION(
".text.vsf.kernel.__vsf_eda_bmpevt_adapter_bmpevt_evthander")
134VSF_CAL_SECTION(
".text.vsf.kernel.__vsf_eda_bmpevt_adapter_bmpevt_init")
141 adapter_eda->eda.fn.evthandler = __vsf_eda_bmpevt_adapter_bmpevt_evthander;
142 return __vsf_eda_bmpevt_adapter_eda_init(adapter_eda);
145VSF_CAL_SECTION(
".text.vsf.kernel.__vsf_eda_bmpevt_adapter_bmpevt_reset")
155#if __IS_COMPILER_GCC__
156# pragma GCC diagnostic pop
157#elif __IS_COMPILER_LLVM__ || __IS_COMPILER_ARM_COMPILER_6__
158# pragma clang diagnostic pop
163 .
init = __vsf_eda_bmpevt_adapter_bmpevt_init,
164 .reset = __vsf_eda_bmpevt_adapter_bmpevt_reset,
185 cur_mask = this_ptr->value & pender->mask;
187 if (cur_mask == pender->mask) {
212 is_to_repoll = this_ptr->state.bits.is_to_repoll;
214 this_ptr->state.bits.is_polling =
false;
223 while (node !=
NULL) {
224 if (is_poll_event && this_ptr->state.bits.is_to_repoll) {
226 this_ptr->state.bits.is_to_repoll =
false;
227 __vsf_eda_bmpevt_post_evt(this_ptr, this_ptr->pending_list.head, evt);
245static
void __vsf_eda_bmpevt_cancel_start(
vsf_bmpevt_t *this_ptr)
250 this_ptr->state.bits.is_cancelling =
true;
257static
void __vsf_eda_bmpevt_poll_start(
vsf_bmpevt_t *this_ptr)
264 is_polling = this_ptr->state.bits.is_polling;
266 this_ptr->state.bits.is_to_repoll =
true;
268 this_ptr->state.bits.is_polling =
true;
273 __vsf_eda_bmpevt_post_evt(this_ptr, this_ptr->pending_list.head,
VSF_EVT_SYNC_POLL);
285 this_ptr->state.flag = 0;
287 this_ptr->cancelled_value = 0;
288 this_ptr->state.bits.adapter_count = adapter_count;
290 for (i = 0; i < this_ptr->state.bits.adapter_count; i++) {
291 adapter = this_ptr->adapters[i];
292 if (adapter !=
NULL) {
293 adapter->bmpevt_host = this_ptr;
295 adapter->
op->
init(adapter);
309 mask &= this_ptr->value;
311 this_ptr->value &= ~mask;
314 for (i = 0; i < this_ptr->state.bits.adapter_count; i++) {
315 adapter = this_ptr->adapters[i];
316 if ((mask & (1 << i)) && (adapter !=
NULL)) {
331 this_ptr->cancelled_value |= mask;
334 __vsf_eda_bmpevt_cancel_start(this_ptr);
344 this_ptr->value |= mask;
347 __vsf_eda_bmpevt_poll_start(this_ptr);
360 if (__vsf_eda_bmpevt_poll(this_ptr, pender)) {
373 if (pender->mask & this_ptr->cancelled_value) {
379 __vsf_eda_set_timeout(eda,
timeout);
382 __vsf_eda_bmpevt_poll_start(this_ptr);
386#if __IS_COMPILER_LLVM__ || __IS_COMPILER_ARM_COMPILER_6__
387# pragma clang diagnostic push
388# pragma clang diagnostic ignored "-Wcast-align"
391#if __IS_COMPILER_GCC__
392# pragma GCC diagnostic push
393# pragma GCC diagnostic ignored "-Wcast-align"
407 eda = pender->eda_pending;
409#if VSF_KERNEL_CFG_EDA_SUPPORT_TIMER == ENABLED
411 __vsf_eda_bmpevt_remove_pender(this_ptr, pender);
416 if (this_ptr->cancelled_value && pender->mask) {
417 __vsf_eda_bmpevt_remove_pender(this_ptr, pender);
422 __vsf_eda_bmpevt_post_evt(this_ptr, eda->pending_node.next, evt);
424 if (__vsf_eda_bmpevt_poll(this_ptr, pender)) {
425 __vsf_eda_bmpevt_remove_pender(this_ptr, pender);
430 __vsf_eda_bmpevt_post_evt(this_ptr, eda->pending_node.next, evt);
435#if VSF_KERNEL_CFG_EDA_SUPPORT_TIMER == ENABLED
438 eda->flag.state.is_limitted =
false;
443#if __IS_COMPILER_LLVM__ || __IS_COMPILER_ARM_COMPILER_6__
444# pragma clang diagnostic pop
447#if __IS_COMPILER_GCC__
448# pragma GCC diagnostic pop
#define VSF_CAL_SECTION(__SEC)
Definition __compiler.h:181
#define vsf_container_of(__ptr, __type, __member)
Definition __type.h:164
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_FAIL
failed
Definition __type.h:51
const vsf_bmpevt_adapter_op_t * op
Definition vsf_eda.h:921
uint32_t mask
Definition vsf_eda.h:947
__le16 timeout
Definition ieee80211.h:94
#define NULL
Definition lvgl.h:26
unsigned char uint_fast8_t
Definition stdint.h:23
unsigned int uint_fast32_t
Definition stdint.h:27
Definition vsf_eda.h:1076
vsf_bmpevt_adapter_eda_t vsf_bmpevt_t * bmpevt
Definition vsf_eda.h:1078
vsf_bmpevt_pender_t pender
Definition vsf_eda.h:1079
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
Definition vsf_list.h:888
void sync(void)
Definition vsf_linux_fs.c:2137
uintalu_t vsf_protect_t
Definition vsf_arch_abstraction.h:53
vsf_err_t vsf_eda_post_evt(vsf_eda_t *pthis, vsf_evt_t evt)
Definition vsf_eda.c:929
vsf_eda_t * vsf_eda_get_cur(void)
Definition vsf_eda.c:416
int16_t vsf_evt_t
Definition vsf_eda.h:654
vsf_err_t vsf_eda_bmpevt_reset(vsf_bmpevt_t *pthis, uint_fast32_t mask)
vsf_err_t vsf_eda_bmpevt_cancel(vsf_bmpevt_t *pthis, uint_fast32_t mask)
#define VSF_BMPEVT_AND
Definition vsf_eda.h:906
vsf_err_t vsf_eda_bmpevt_set(vsf_bmpevt_t *pthis, uint_fast32_t mask)
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)
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_SYNC_POLL
Definition vsf_eda.h:617
@ VSF_EVT_INIT
Definition vsf_eda.h:605
@ VSF_EVT_TIMER
Definition vsf_eda.h:612
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_sync_reason_t vsf_eda_bmpevt_poll(vsf_bmpevt_t *pthis, vsf_bmpevt_pender_t *pender, vsf_evt_t evt)
const vsf_bmpevt_adapter_op_t vsf_eda_bmpevt_adapter_sync_op
#define vsf_eda_init(__eda,...)
Definition vsf_eda.h:166
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
#define VSF_KERNEL_ASSERT
Definition vsf_kernel_cfg.h:32
void __vsf_dlist_add_to_tail_imp(vsf_dlist_t *this_ptr, vsf_dlist_node_t *node)
Definition vsf_list.c:210
void __vsf_dlist_remove_imp(vsf_dlist_t *this_ptr, vsf_dlist_node_t *node)
Definition vsf_list.c:290
#define vsf_dlist_init_node( __host_type, __member, __item_ptr)
Definition vsf_list.h:717
#define __vsf_dlist_get_host(__host_type, __member, __node_ptr)
Definition vsf_list.h:271
#define vsf_dlist_init(__list_ptr)
Definition vsf_list.h:702
#define vsf_protect_sched()
Definition vsf_os.h:88
#define vsf_unprotect_sched(__prot)
Definition vsf_os.h:89