18#ifndef __CORTEX_M_GENERIC_H__
19#define __CORTEX_M_GENERIC_H__
25#define __VSF_HEADER_ONLY_SHOW_ARCH_INFO__
27#undef __VSF_HEADER_ONLY_SHOW_ARCH_INFO__
37#ifndef __LITTLE_ENDIAN
38# define __LITTLE_ENDIAN 1
41# define __BYTE_ORDER __LITTLE_ENDIAN
44#if __ARM_ARCH == 6 || __TARGET_ARCH_6_M == 1 || __TARGET_ARCH_6S_M == 1
45# ifndef VSF_ARCH_PRI_NUM
46# define VSF_ARCH_PRI_NUM 4
47# undef VSF_ARCH_PRI_BIT
48# define VSF_ARCH_PRI_BIT 2
51# ifndef VSF_ARCH_PRI_BIT
52# define VSF_ARCH_PRI_BIT 2
54#elif __ARM_ARCH >= 7 || __TARGET_ARCH_7_M == 1 || __TARGET_ARCH_7E_M == 1
55# ifndef VSF_ARCH_PRI_NUM
56# define VSF_ARCH_PRI_NUM 16
57# undef VSF_ARCH_PRI_BIT
58# define VSF_ARCH_PRI_BIT 4
61# ifndef VSF_ARCH_PRI_BIT
62# define VSF_ARCH_PRI_BIT 4
66#ifndef VSF_ARCH_CFG_CALLSTACK_TRACE
67# define VSF_ARCH_CFG_CALLSTACK_TRACE ENABLED
71#define VSF_ARCH_SWI_NUM 1
73#ifndef VSF_SYSTIMER_CFG_IMPL_MODE
75# define VSF_SYSTIMER_CFG_IMPL_MODE VSF_SYSTIMER_IMPL_WITH_NORMAL_TIMER
77#define __VSF_ARCH_SYSTIMER_BITS 24
81#define vsf_arch_wakeup()
83#if (__ARM_ARCH >= 7) || (__TARGET_ARCH_7_M == 1) || (__TARGET_ARCH_7E_M == 1)
85# define vsf_atom32_op(__ptr, ...) \
89 _ = (int32_t)__LDREXW((volatile uint32_t *)(__ptr)); \
90 } while ((__STREXW((uint32_t)(__VA_ARGS__), (volatile uint32_t *)(__ptr))) != 0U);\
94# define vsf_atom16_op(__ptr, ...) \
98 _ = (int16_t)__LDREXH((volatile uint16_t *)(__ptr)); \
99 } while ((__STREXH((uint16_t)(__VA_ARGS__), (volatile uint16_t *)(__ptr))) != 0U);\
103# define vsf_atom8_op(__ptr, ...) \
107 _ = (int8_t)__LDREXB((volatile uint8_t *)(__ptr)); \
108 } while ((__STREXB((uint8_t)(__VA_ARGS__), (volatile uint8_t *)(__ptr))) != 0U);\
112# define vsf_spinlock_t uint32_t
113# define vsf_spinlock_init(__plock) \
117# define vsf_spin_lock(__plock) \
119 vsf_spinlock_t VSF_MACRO_SAFE_NAME(value) = __LDREXW((volatile vsf_spinlock_t *)(__plock));\
120 if (VSF_MACRO_SAFE_NAME(value) != 0) { \
122 } else if ((__STREXW(1, (volatile vsf_spinlock_t *)(__plock))) == 0U) {\
126# define vsf_spin_unlock(__plock) \
131# define vsf_spin_trylock(__plock) (vsf_spin_lock(__plock), 1)
161#define __VSF_ARCH_PRI_INDEX(__N, __UNUSED) \
162 __vsf_arch_prio_index_##__N = (__N),
169#define __VSF_ARCH_PRI(__N, __BIT) \
170 VSF_ARCH_PRIO_##__N = \
171 ((VSF_ARCH_PRI_NUM - 1 - __vsf_arch_prio_index_##__N)) & 0xFF, \
172 vsf_arch_prio_##__N = \
173 ((VSF_ARCH_PRI_NUM - 1 - __vsf_arch_prio_index_##__N)) & 0xFF,
194#ifndef VSF_APPLET_USE_ARCH_ABI
195# define VSF_APPLET_USE_ARCH_ABI ENABLED
197#if VSF_APPLET_USE_ARCH_ABI == ENABLED
266# ifndef __VSF_APPLET__
275static VSF_CAL_ALWAYS_INLINE
void vsf_arch_set_stack(
uintptr_t stack)
280static VSF_CAL_ALWAYS_INLINE
uintptr_t vsf_arch_get_stack(
void)
285#if VSF_ARCH_USE_THREAD_REG == ENABLED
295#if VSF_ARCH_CFG_CALLSTACK_TRACE == ENABLED
#define __volatile__
Definition __compiler.h:56
#define VSF_ARCH_PRI_NUM
Definition arm9_generic.h:46
vsf_arch_prio_t
Definition cortex_a_generic.h:88
double __aeabi_l2d(long long)
long long __aeabi_llsr(long long, int)
int __aeabi_fcmpun(float, float)
long long __aeabi_f2lz(float)
int __aeabi_dcmpun(double, double)
long long __aeabi_uread8(void *)
void __aeabi_cdcmple(double, double)
double __aeabi_dmul(double, double)
unsigned long long __aeabi_d2ulz(double)
float __aeabi_fdiv(float, float)
lldiv_t __aeabi_ldivmod(long long, long long)
int __aeabi_fcmpgt(float, float)
unsigned __aeabi_f2uiz(float)
uidiv_return __aeabi_uidivmod(unsigned, unsigned)
int __aeabi_fcmplt(float, float)
double __aeabi_f2d(float)
unsigned __aeabi_d2uiz(double)
void __aeabi_cfrcmple(float, float)
int __aeabi_dcmpge(double, double)
long long __aeabi_llsl(long long, int)
float __aeabi_ui2f(unsigned)
float __aeabi_fadd(float, float)
int __aeabi_dcmpgt(double, double)
float __aeabi_ul2f(unsigned long long)
void __aeabi_cdrcmple(double, double)
double __aeabi_dadd(double, double)
int __aeabi_dcmpeq(double, double)
void __aeabi_cdcmpeq(double, double)
long long __aeabi_lmul(long long, long long)
double __aeabi_drsub(double, double)
double __aeabi_ddiv(double, double)
int __aeabi_dcmplt(double, double)
long long __aeabi_d2lz(double)
void __aeabi_cfcmple(float, float)
unsigned __aeabi_uidiv(unsigned, unsigned)
float __aeabi_fsub(float, float)
unsigned long long __aeabi_f2ulz(float)
double __aeabi_ui2d(unsigned)
int __aeabi_uread4(void *)
int __aeabi_fcmple(float, float)
double __aeabi_dsub(double, double)
float __aeabi_l2f(long long)
int __aeabi_idiv(int, int)
int __aeabi_fcmpeq(float, float)
double __aeabi_ul2d(unsigned long long)
int __aeabi_ulcmp(unsigned long long, unsigned long long)
float __aeabi_fmul(float, float)
long long __aeabi_lasr(long long, int)
int __aeabi_dcmple(double, double)
div_t __aeabi_idivmod(int, int)
float __aeabi_frsub(float, float)
void __aeabi_cfcmpeq(float, float)
ulldiv_t __aeabi_uldivmod(unsigned long long, unsigned long long)
long long __aeabi_uwrite8(long long, void *)
int __aeabi_lcmp(long long, long long)
int __aeabi_uwrite4(int, void *)
int __aeabi_fcmpge(float, float)
float __aeabi_d2f(double)
@ __VSF_ARCH_PRIO_LEAST_MAX
Definition cortex_m_generic.h:178
@ VSF_ARCH_PRIO_ENABLE_ALL
Definition cortex_m_generic.h:183
@ vsf_arch_prio_enable_all
Definition cortex_m_generic.h:184
@ __VSF_ARCH_PRIO_LEAST_MIN
Definition cortex_m_generic.h:179
@ VSF_ARCH_PRIO_INVALID
Definition cortex_m_generic.h:180
@ vsf_arch_prio_highest
Definition cortex_m_generic.h:190
@ VSF_ARCH_PRIO_DISABLE_ALL
Definition cortex_m_generic.h:185
@ vsf_arch_prio_invalid
Definition cortex_m_generic.h:181
@ VSF_ARCH_PRIO_HIGHEST
Definition cortex_m_generic.h:191
@ vsf_arch_prio_disable_all
Definition cortex_m_generic.h:186
void vsf_arch_mpu_config_region(uint32_t idx, uint32_t baseaddr, uint32_t size, vsf_arch_mpu_feature_t feature)
#define __VSF_ARCH_PRI(__N, __BIT)
Definition cortex_m_generic.h:169
void vsf_arch_add_text_region(vsf_arch_text_region_t *region)
Definition cortex_m_generic.c:523
vsf_arch_mpu_feature_t
Definition cortex_m_generic.h:138
@ VSF_ARCH_MPU_CACHABLE_WRITE_THROUGH_NOALLOC
Definition cortex_m_generic.h:155
@ VSF_ARCH_MPU_ACCESS_NO
Definition cortex_m_generic.h:150
@ VSF_ARCH_MPU_NON_SHARABLE
Definition cortex_m_generic.h:142
@ VSF_ARCH_MPU_CACHABLE_WRITE_BACK_NOALLOC
Definition cortex_m_generic.h:156
@ VSF_ARCH_MPU_EXECUTABLE
Definition cortex_m_generic.h:145
@ VSF_ARCH_MPU_CACHABLE_WRITE_BACK_ALLOC
Definition cortex_m_generic.h:157
@ VSF_ARCH_MPU_NON_EXECUTABLE
Definition cortex_m_generic.h:146
@ VSF_ARCH_MPU_ACCESS_FULL
Definition cortex_m_generic.h:151
@ VSF_ARCH_MPU_ACCESS_READONLY
Definition cortex_m_generic.h:152
@ VSF_ARCH_MPU_SHARABLE
Definition cortex_m_generic.h:141
@ VSF_ARCH_MPU_NON_CACHABLE
Definition cortex_m_generic.h:158
void vsf_arch_mpu_clear_region(uint32_t idx)
uint64_t vsf_systimer_tick_t
Definition cortex_m_generic.h:136
void vsf_arch_mpu_add_region(uint32_t baseaddr, uint32_t size, vsf_arch_mpu_feature_t feature)
uint_fast16_t vsf_arch_get_callstack(uintptr_t sp, uintptr_t *callstack, uint_fast16_t callstack_num)
Definition cortex_m_generic.c:533
#define __VSF_ARCH_PRI_INDEX(__N, __UNUSED)
Definition cortex_m_generic.h:161
void vsf_arch_mpu_disable(void)
@ __vsf_arch_prio_index_number
Definition cortex_m_generic.h:166
__VSF_VPLT_DECORATOR__ vsf_arch_abi_vplt_t vsf_arch_abi_vplt
Definition cortex_m_generic.c:675
void vsf_arch_mpu_enable(void)
unsigned int uint32_t
Definition lvgl.h:43
#define VSF_ARCH_PRI_BIT
Definition mcs51_generic.h:42
uint32_t uintptr_t
Definition stdint.h:38
unsigned long long uint64_t
Definition stdint.h:11
unsigned short uint_fast16_t
Definition stdint.h:25
#define INT16_MAX
Definition stdint.h:50
#define INT16_MIN
Definition stdint.h:45
Definition cortex_m_generic.h:200
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_ui2d)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_f2lz)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_idiv)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_i2d)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_ul2f)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_dcmpgt)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_lmul)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_l2d)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_fcmple)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_lasr)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_uwrite8)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_dmul)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_d2f)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_dadd)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_dcmplt)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_uread4)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_fcmplt)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_fcmpeq)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_dsub)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_uldivmod)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_f2d)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_fcmpgt)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_dcmpun)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_i2f)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_dcmpge)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_drsub)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_idivmod)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_uread8)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_d2lz)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_fdiv)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_llsr)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_cdcmple)
vsf_vplt_info_t info
Definition cortex_m_generic.h:201
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_fcmpge)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_ldivmod)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_d2uiz)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_f2ulz)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_ulcmp)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_ui2f)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_dcmple)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_cdcmpeq)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_cfcmple)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_ul2d)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_uidiv)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_cfrcmple)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_fsub)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_f2uiz)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_fmul)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_d2ulz)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_frsub)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_ddiv)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_cfcmpeq)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_uwrite4)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_f2iz)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_cdrcmple)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_d2iz)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_uidivmod)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_fcmpun)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_llsl)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_lcmp)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_fadd)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_dcmpeq)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__aeabi_l2f)
Definition vsf_arch_abstraction.h:60
vk_av_control_value_t value
Definition vsf_audio.h:171
#define __VSF_VPLT_DECORATOR__
Definition vsf_cfg.h:93
uint32_t size
Definition vsf_memfs.h:50
#define VSF_MREPEAT(__COUNT, __MACRO, __PARAM)
Definition vsf_repeat_macro.h:51