VSF Documented
vsf_evtq.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18#ifndef __VSF_EVTQ_H__
19#define __VSF_EVTQ_H__
20
21/*============================ INCLUDES ======================================*/
23#if VSF_USE_KERNEL == ENABLED
24
25#include "./vsf_eda.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31/*============================ MACROS ========================================*/
32/*============================ TYPES =========================================*/
33
34typedef struct vsf_evtq_ctx_t {
38#if VSF_KERNEL_CFG_EDA_CPU_USAGE == ENABLED
41#endif
43
44#if VSF_KERNEL_CFG_ALLOW_KERNEL_BEING_PREEMPTED == ENABLED
45
47typedef struct vsf_evtq_t vsf_evtq_t;
48
49#if VSF_KERNEL_CFG_SUPPORT_DYNAMIC_PRIOTIRY == ENABLED
50
51struct vsf_evtq_t {
54# if VSF_KERNEL_CFG_TRACE == ENABLED
56# endif
57};
58
60 implement(vsf_slist_node_t)
61
62# if VSF_KERNEL_CFG_SUPPORT_EVT_MESSAGE == ENABLED
64 void *msg;
65# else
66 union {
68 void *msg;
69 } evt_union;
70# endif
71};
72
73#else
74
75struct vsf_evt_node_t {
76 vsf_eda_t *eda;
77
78# if VSF_KERNEL_CFG_SUPPORT_EVT_MESSAGE == ENABLED
80 void *msg;
81# else
82 union {
84 void *msg;
85 } evt_union;
86# endif
87};
88
89struct vsf_evtq_t {
90 vsf_evt_node_t *node;
91 uint8_t bitsize;
92
93 // private
96# if VSF_KERNEL_CFG_TRACE == ENABLED
98# endif
100};
101
102#endif
103#endif
104
105/*============================ GLOBAL VARIABLES ==============================*/
106/*============================ PROTOTYPES ====================================*/
107
108#if VSF_KERNEL_CFG_ALLOW_KERNEL_BEING_PREEMPTED == ENABLED
121extern vsf_err_t vsf_evtq_init(vsf_evtq_t *this_ptr);
122# if VSF_KERNEL_CFG_SUPPORT_EVT_MESSAGE == ENABLED
143extern vsf_err_t vsf_evtq_post_evt_msg(vsf_eda_t *eda, vsf_evt_t evt, void *msg);
144# endif
157extern bool vsf_evtq_is_empty(vsf_evtq_t *this_ptr);
158
171extern vsf_err_t vsf_evtq_poll(vsf_evtq_t *this_ptr);
172
185extern void vsf_evtq_clean_evt(vsf_evt_t evt);
186#endif
187
200extern void vsf_evtq_on_eda_init(vsf_eda_t *eda);
201
214extern void vsf_evtq_on_eda_fini(vsf_eda_t *eda);
215
236extern vsf_err_t vsf_evtq_post_evt_ex(vsf_eda_t *eda, vsf_evt_t evt, bool force);
237
257
276extern vsf_err_t vsf_evtq_post_msg(vsf_eda_t *eda, void *msg);
277
278#ifdef __cplusplus
279}
280#endif
281
282#endif
283#endif
vsf_err_t
Definition __type.h:42
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
uint64_t vsf_systimer_tick_t
Definition cortex_a_generic.h:70
struct esp_netif_obj * head
Definition esp_netif_port.c:117
uint32_t uintptr_t
Definition stdint.h:38
unsigned char uint8_t
Definition stdint.h:5
Definition vsf_list.h:883
Definition vsf_evtq.h:59
vsf_slist_node_t vsf_evt_t evt
Definition vsf_evtq.h:63
void * msg
Definition vsf_evtq.h:64
Definition vsf_evtq.h:34
vsf_systimer_tick_t preempted_ticks
Definition vsf_evtq.h:39
bool is_timing
Definition vsf_evtq.h:40
vsf_eda_t * eda
Definition vsf_evtq.h:35
vsf_evt_t evt
Definition vsf_evtq.h:36
uintptr_t msg
Definition vsf_evtq.h:37
Definition vsf_evtq.h:51
vsf_dlist_t rdy_list
Definition vsf_evtq.h:52
bool is_isr_info_sent
Definition vsf_evtq.h:55
vsf_evtq_ctx_t cur
Definition vsf_evtq.h:53
Definition vsf_list.h:876
vk_av_control_value_t value
Definition vsf_audio.h:171
int16_t vsf_evt_t
Kernel event type.
Definition vsf_eda.h:1658
vsf_err_t vsf_evtq_post_evt_ex(vsf_eda_t *eda, vsf_evt_t evt, bool force)
Post an event to the event queue of the target eda, with force control.
Definition vsf_evtq_list.c:222
void vsf_evtq_on_eda_fini(vsf_eda_t *eda)
Event queue hook called when an eda is finalized.
Definition vsf_evtq_list.c:114
void vsf_evtq_on_eda_init(vsf_eda_t *eda)
Event queue hook called when an eda is initialized.
Definition vsf_evtq_list.c:107
bool vsf_evtq_is_empty(vsf_evtq_t *this_ptr)
Check whether an event queue is empty.
Definition vsf_evtq_list.c:252
vsf_err_t vsf_evtq_poll(vsf_evtq_t *this_ptr)
Poll an event queue and dispatch the pending events to their edas.
Definition vsf_evtq_list.c:312
vsf_err_t vsf_evtq_init(vsf_evtq_t *this_ptr)
Initialize an event queue.
Definition vsf_evtq_list.c:146
void vsf_evtq_clean_evt(vsf_evt_t evt)
Clean the pending event(s) posted to the current eda.
Definition vsf_evtq_list.c:257
vsf_err_t vsf_evtq_post_msg(vsf_eda_t *eda, void *msg)
Post a message to the event queue of the target eda (event VSF_EVT_MESSAGE)
Definition vsf_evtq_list.c:236
vsf_err_t vsf_evtq_post_evt(vsf_eda_t *eda, vsf_evt_t evt)
Post an event to the event queue of the target eda.
Definition vsf_evtq_list.c:231
vsf_err_t vsf_evtq_post_evt_msg(vsf_eda_t *eda, vsf_evt_t evt, void *msg)
Post an event with a message to the event queue of the target eda.
Definition vsf_evtq_list.c:246
struct vsf_evtq_ctx_t vsf_evtq_ctx_t
uint16_t tail
Definition vsf_queue.h:632
Generated from commit: vsfteam/vsf@a5104db