1 /*
2  * Copyright (c) 2006-2023 RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2023-03-12     WangXiaoyao  the first version
9  */
10 #ifndef __ASM_GENERIC_H__
11 #define __ASM_GENERIC_H__
12 
13 /* use to mark a start point where every task start from */
14 #define START_POINT(funcname)               \
15     .global funcname;                       \
16     .type funcname, %function;              \
17     funcname:                               \
18     .cfi_sections .debug_frame, .eh_frame;  \
19     .cfi_startproc;                         \
20     .cfi_undefined x30
21 
22 #define START_POINT_END(name)   \
23     .cfi_endproc;               \
24     .size name, .-name;
25 
26 #define TRACE_SYMBOL(name)
27 
28 .macro NEVER_RETURN
29 #ifdef RT_USING_DEBUG
30     b       .
31 #endif /* RT_USING_DEBUG */
32 .endm
33 
34 .macro GET_THREAD_SELF, dst:req
35 #ifdef ARCH_USING_HW_THREAD_SELF
36     mrs     x0, tpidr_el1
37 #else  /* !ARCH_USING_HW_THREAD_SELF */
38     bl      rt_thread_self
39 #endif /* ARCH_USING_HW_THREAD_SELF */
40     .if \dst != x0
41     mov     dst, x0
42     .endif
43 .endm
44 
45 #endif /* __ASM_GENERIC_H__ */
46