18#ifndef __RTOS_GENERIC_H__
19#define __RTOS_GENERIC_H__
31#ifndef __LITTLE_ENDIAN
32# define __LITTLE_ENDIAN 1
35# define __BYTE_ORDER __LITTLE_ENDIAN
38#ifndef VSF_ARCH_RTOS_CFG_STACK_DEPTH
39# define VSF_ARCH_RTOS_CFG_STACK_DEPTH 1024
42#ifndef VSF_ARCH_SWI_NUM
43# define VSF_ARCH_SWI_NUM 0
46#ifndef VSF_ARCH_PRI_NUM
47# if VSF_ARCH_SWI_NUM > 0
48# define VSF_ARCH_PRI_NUM VSF_ARCH_SWI_NUM
50# define VSF_ARCH_PRI_NUM 1
56# define VSF_USER_ENTRY vsf_main
59#define VSF_ARCH_IRQ_REQUEST_SUPPORT_MANUAL_RESET
61#define VSF_ARCH_RTOS_MODE_SUSPEND_RESUME 1
62#define VSF_ARCH_RTOS_MODE_REQUEST 2
65#define VSF_ARCH_RTOS_CFG_MODE VSF_ARCH_RTOS_MODE_SUSPEND_RESUME
69#define __VSF_ARCH_PRI(__N, __UNUSED) \
70 VSF_ARCH_PRIO_##__N = (__N), \
71 vsf_arch_prio_##__N = (__N),
86#if !defined(VSF_ARCH_RTOS_MODEL_HEADER)
87# if defined(__FREERTOS__)
88# define VSF_ARCH_RTOS_MODEL_HEADER "./freertos/freertos_generic.h"
90# error no supported rtos found
107#include VSF_ARCH_RTOS_MODEL_HEADER
109#if defined(__VSF_ARCH_RTOS_IMPLEMENT)
110# define __VSF_CLASS_IMPLEMENT__
121#ifndef VSF_ARCH_RTOS_CFG_SET_STACK
122# define VSF_ARCH_LIMIT_NO_SET_STACK
125#if VSF_ARCH_SWI_NUM > VSF_ARCH_RTOS_PRIORITY_NUM
126# error too many SWI to support in the current rtos configuration
130#if defined(VSF_ARCH_IRQ_SUPPORT_STACK) && (VSF_ARCH_RTOS_CFG_STACK_DEPTH == 0)
131# define VSF_ARCH_RTOS_DYNAMIC_STACK ENABLED
172#if VSF_ARCH_RTOS_CFG_MODE == VSF_ARCH_RTOS_MODE_SUSPEND_RESUME
181#ifndef VSF_ARCH_LIMIT_NO_SET_STACK
182static VSF_CAL_ALWAYS_INLINE
void vsf_arch_set_stack(
uint32_t stack)
184 VSF_ARCH_RTOS_CFG_SET_STACK(stack);
#define VSF_CAL_ALIGN(__N)
Definition __compiler.h:179
vsf_err_t
Definition __type.h:42
Definition linux_generic.h:104
Definition linux_generic.h:122
Definition rtos_generic.h:136
vsf_arch_prio_t
Definition cortex_a_generic.h:88
#define VSF_ARCH_RTOS_STACK_T
Definition freertos_generic.h:49
#define VSF_ARCH_STACK_ALIGN_BIT
Definition linux_generic.h:64
unsigned int uint32_t
Definition lvgl.h:43
#define vsf_class(__name)
Definition ooc_class.h:48
void __vsf_arch_irq_request_reset(vsf_arch_irq_request_t *request)
Definition freertos_generic.c:199
vsf_arch_prio_t __vsf_arch_irq_get_priority(vsf_arch_irq_thread_t *irq_thread)
Definition freertos_generic.c:289
@ VSF_ARCH_PRIO_INVALID
Definition rtos_generic.h:76
@ vsf_arch_prio_highest
Definition rtos_generic.h:79
@ vsf_arch_prio_invalid
Definition rtos_generic.h:77
void vsf_arch_wakeup(void)
Definition rtos_generic.c:201
#define __VSF_ARCH_PRI(__N, __UNUSED)
Definition rtos_generic.h:69
void __vsf_arch_irq_request_init(vsf_arch_irq_request_t *request, bool auto_reset)
Definition freertos_generic.c:160
void __vsf_arch_delay_ms(uint_fast32_t ms)
Definition freertos_generic.c:310
void __vsf_arch_irq_enter(void)
Definition freertos_generic.c:130
vsf_err_t __vsf_arch_irq_restart(vsf_arch_irq_thread_t *irq_thread, vsf_arch_irq_request_t *request_pending)
Definition linux_generic.c:309
void __vsf_arch_irq_request_fini(vsf_arch_irq_request_t *request)
Definition linux_generic.c:188
void __vsf_arch_irq_init(vsf_arch_irq_thread_t *irq_thread, const char *const name, vsf_arch_irq_thread_entry_t entry, vsf_arch_prio_t priority, VSF_ARCH_RTOS_STACK_T *stack, uint_fast32_t stack_depth)
Definition freertos_generic.c:213
void __vsf_arch_irq_set_priority(vsf_arch_irq_thread_t *irq_thread, vsf_arch_prio_t priority)
Definition freertos_generic.c:266
void(* vsf_arch_irq_thread_entry_t)(void *)
Definition rtos_generic.h:82
void __vsf_arch_irq_leave(void)
Definition freertos_generic.c:143
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_suspend(vsf_arch_irq_thread_t *irq_thread)
Definition freertos_generic.c:279
#define VSF_ARCH_RTOS_CFG_STACK_DEPTH
Definition rtos_generic.h:39
void __vsf_arch_irq_resume(vsf_arch_irq_thread_t *irq_thread)
Definition freertos_generic.c:284
void __vsf_arch_irq_exit(vsf_arch_irq_thread_t *irq_thread)
Definition linux_generic.c:303
#define VSF_ARCH_PRI_NUM
Definition rtos_generic.h:50
unsigned int uint_fast32_t
Definition stdint.h:27
#define VSF_MREPEAT(__COUNT, __MACRO, __PARAM)
Definition vsf_repeat_macro.h:51