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
109extern vsf_err_t vsf_evtq_init(vsf_evtq_t *this_ptr);
110# if VSF_KERNEL_CFG_SUPPORT_EVT_MESSAGE == ENABLED
111extern vsf_err_t vsf_evtq_post_evt_msg(vsf_eda_t *eda, vsf_evt_t evt, void *msg);
112# endif
113extern bool vsf_evtq_is_empty(vsf_evtq_t *this_ptr);
114extern vsf_err_t vsf_evtq_poll(vsf_evtq_t *this_ptr);
115
116extern void vsf_evtq_clean_evt(vsf_evt_t evt);
117#endif
118
119extern void vsf_evtq_on_eda_init(vsf_eda_t *eda);
120extern void vsf_evtq_on_eda_fini(vsf_eda_t *eda);
121
122extern vsf_err_t vsf_evtq_post_evt_ex(vsf_eda_t *eda, vsf_evt_t evt, bool force);
124extern vsf_err_t vsf_evtq_post_msg(vsf_eda_t *eda, void *msg);
125
126#ifdef __cplusplus
127}
128#endif
129
130#endif
131#endif
vsf_err_t
Definition __type.h:42
Definition vsf_eda.h:766
uint64_t vsf_systimer_tick_t
Definition cortex_a_generic.h:73
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
Definition vsf_eda.h:654
vsf_err_t vsf_evtq_post_evt_ex(vsf_eda_t *eda, vsf_evt_t evt, bool force)
Definition vsf_evtq_list.c:219
void vsf_evtq_on_eda_fini(vsf_eda_t *eda)
Definition vsf_evtq_list.c:111
void vsf_evtq_on_eda_init(vsf_eda_t *eda)
Definition vsf_evtq_list.c:105
bool vsf_evtq_is_empty(vsf_evtq_t *this_ptr)
Definition vsf_evtq_list.c:249
vsf_err_t vsf_evtq_poll(vsf_evtq_t *this_ptr)
Definition vsf_evtq_list.c:309
vsf_err_t vsf_evtq_init(vsf_evtq_t *this_ptr)
Definition vsf_evtq_list.c:143
void vsf_evtq_clean_evt(vsf_evt_t evt)
Definition vsf_evtq_list.c:254
vsf_err_t vsf_evtq_post_msg(vsf_eda_t *eda, void *msg)
Definition vsf_evtq_list.c:233
vsf_err_t vsf_evtq_post_evt(vsf_eda_t *eda, vsf_evt_t evt)
Definition vsf_evtq_list.c:228
vsf_err_t vsf_evtq_post_evt_msg(vsf_eda_t *eda, vsf_evt_t evt, void *msg)
Definition vsf_evtq_list.c:243
uint16_t tail
Definition vsf_queue.h:632
uint16_t head
Definition vsf_queue.h:632