18#ifdef __VSF_ARCH_WITHOUT_THREAD_SUSPEND_TEMPLATE__
19#undef __VSF_ARCH_WITHOUT_THREAD_SUSPEND_TEMPLATE__
26typedef struct vsf_arch_common_t {
36 bool irq_end_from_por;
39#if VSF_ARCH_BG_TRACE_EN == ENABLED
40typedef struct vsf_arch_bg_trace_event_t {
44 VSF_ARCH_TRACE_IRQ_START,
45 VSF_ARCH_TRACE_IRQ_ENTER,
46 VSF_ARCH_TRACE_IRQ_END,
51} vsf_arch_bg_trace_event_t;
53typedef struct vsf_arch_bg_trace_t {
54 vsf_arch_bg_trace_event_t
events[1024];
65#if VSF_ARCH_BG_TRACE_EN == ENABLED
66static vsf_arch_bg_trace_t __vsf_arch_bg_trace;
69static vsf_arch_common_t __vsf_arch_common;
74#if VSF_ARCH_BG_TRACE_EN == ENABLED
75static vsf_arch_bg_trace_event_t * __vsf_arch_bg_trace_get_event(
void)
77 vsf_arch_bg_trace_event_t *
event = &__vsf_arch_bg_trace.events[__vsf_arch_bg_trace.pos++];
78 if (__vsf_arch_bg_trace.pos >=
dimof(__vsf_arch_bg_trace.events)) {
79 __vsf_arch_bg_trace.pos = 0;
81 event->idx = __vsf_arch_bg_trace.idx++;
87 vsf_arch_bg_trace_event_t *trace_event = __vsf_arch_bg_trace_get_event();
88 trace_event->event = event;
89 trace_event->thread = irq_thread;
90 trace_event->info = info;
94static bool __vsf_arch_low_level_init(
void)
98 __vsf_arch_common.gint_state =
true;
107#if VSF_ARCH_BG_TRACE_EN == ENABLED
108 __vsf_arch_bg_trace_event(VSF_ARCH_TRACE_IRQ_START, irq_thread, __vsf_arch_common.irq_ready_cnt);
110 __vsf_arch_common.irq_ready_cnt++;
114#if VSF_ARCH_BG_TRACE_EN == ENABLED
116 __vsf_arch_bg_trace_event(VSF_ARCH_TRACE_IRQ_ENTER, irq_thread, __vsf_arch_common.irq_ready_cnt);
119 __vsf_arch_common.cur_thread = irq_thread;
128#if VSF_ARCH_BG_TRACE_EN == ENABLED
129 __vsf_arch_bg_trace_event(VSF_ARCH_TRACE_IRQ_END, irq_thread, __vsf_arch_common.irq_ready_cnt);
131 is_to_wakeup = (0 == --__vsf_arch_common.irq_ready_cnt) && !__vsf_arch_common.irq_end_from_por;
132 __vsf_arch_common.irq_end_from_por =
false;
136 __vsf_arch_common.cur_thread = &__vsf_arch_common.por_thread;
140 __vsf_arch_common.cur_thread =
NULL;
156 if (
VSF_ERR_NONE != __vsf_arch_create_irq_thread(irq_thread, entry)) {
172 return vsf_arch_prio_0;
178 return __vsf_arch_common.gint_state;
185 __vsf_arch_common.gint_state = level;
186#if VSF_ARCH_BG_TRACE_EN == ENABLED
188 __vsf_arch_bg_trace_event(VSF_ARCH_TRACE_GINT, __vsf_arch_common.cur_thread, __vsf_arch_common.gint_state);
199 __vsf_arch_common.gint_state =
false;
200#if VSF_ARCH_BG_TRACE_EN == ENABLED
202 __vsf_arch_bg_trace_event(VSF_ARCH_TRACE_GINT, __vsf_arch_common.cur_thread, __vsf_arch_common.gint_state);
222 __vsf_arch_common.irq_end_from_por =
true;
#define dimof(__arr)
Definition __type.h:155
@ VSF_ERR_NONE
none error
Definition __type.h:44
vsf_gint_state_t vsf_disable_interrupt(void)
Definition arm9_generic.c:176
vsf_gint_state_t vsf_get_interrupt(void)
Definition arm9_generic.c:164
void vsf_arch_sleep(uint32_t mode)
Definition arm9_generic.c:193
vsf_gint_state_t vsf_enable_interrupt(void)
Definition arm9_generic.c:181
vsf_gint_state_t vsf_set_interrupt(vsf_gint_state_t level)
Definition arm9_generic.c:169
Definition linux_generic.h:104
Definition linux_generic.h:122
const char * name
Definition freertos_generic.h:83
vsf_arch_prio_t
Definition cortex_a_generic.h:88
vsf_arch_prio_t vsf_set_base_priority(vsf_arch_prio_t priority)
Definition cortex_m_generic.c:267
#define __vsf_arch_crit_enter(__crit)
Definition linux_generic.c:92
#define __vsf_arch_crit_init(__crit)
Definition linux_generic.c:91
void __vsf_arch_irq_request_pend(vsf_arch_irq_request_t *request)
Definition linux_generic.c:205
void __vsf_arch_irq_request_send(vsf_arch_irq_request_t *request)
Definition linux_generic.c:228
void __vsf_arch_irq_request_init(vsf_arch_irq_request_t *request)
Definition linux_generic.c:167
#define __vsf_arch_crit_leave(__crit)
Definition linux_generic.c:93
void __vsf_arch_irq_set_background(vsf_arch_irq_thread_t *irq_thread)
Definition win_generic.c:724
void __vsf_arch_irq_init(vsf_arch_irq_thread_t *irq_thread, char *name, vsf_arch_irq_entry_t entry, vsf_arch_prio_t priority)
Definition win_generic.c:691
void __vsf_arch_irq_end(vsf_arch_irq_thread_t *irq_thread, bool is_terminate)
Definition win_generic.c:669
void __vsf_arch_irq_fini(vsf_arch_irq_thread_t *irq_thread)
Definition win_generic.c:679
void(* vsf_arch_irq_entry_t)(void *)
Definition linux_generic.h:102
void __vsf_arch_irq_start(vsf_arch_irq_thread_t *irq_thread)
Definition win_generic.c:659
#define NULL
Definition lvgl.h:26
unsigned int uint32_t
Definition lvgl.h:43
unsigned int uint_fast32_t
Definition stdint.h:27
size_t strlen(const char *str)
char * strcpy(char *dest, const char *src)
Definition linux_generic.c:134
#define VSF_HAL_ASSERT(__CON)
all hal modules use this configuration file
Definition vsf_hal_cfg.h:36
struct event_t events[32]
Definition vsf_xboot.c:36
@ VSF_ARCH_TRACE_LOCK
Definition win_generic.c:195