xref: /optee_os/lib/libutils/ext/include/asm.S (revision 762a555345c148742d9e586e426884566e6b3f70)
1/* SPDX-License-Identifier: BSD-2-Clause */
2/*
3 * Copyright (c) 2014, STMicroelectronics International N.V.
4 * Copyright (c) 2020, Linaro Limited
5 */
6
7#if defined(CFG_UNWIND) && defined(__arm__)
8#define UNWIND(...) __VA_ARGS__
9#else
10#define UNWIND(...)
11#endif
12
13	.macro FUNC name colon section=default align=4
14	.ifc	\section\(),default
15	.section .text.\name
16	.else
17	.section \section , "ax" , %progbits
18	.endif
19	.global \name
20	.type \name , %function
21	.balign \align
22	\name \colon
23UNWIND(	.fnstart)
24	.endm
25
26	.macro DATA name colon
27	.global \name
28	.type \name , %object
29	\name \colon
30	.endm
31
32	.macro LOCAL_FUNC name colon section=default align=4
33	.ifc	\section\(),default
34	.section .text.\name
35	.else
36	.section \section , "ax" , %progbits
37	.endif
38	.type \name , %function
39	.balign \align
40	\name \colon
41UNWIND(	.fnstart)
42	.endm
43
44	.macro LOCAL_DATA name colon
45	.type \name , %object
46	\name \colon
47	.endm
48
49	.macro END_DATA name
50	.size \name , .-\name
51	.endm
52
53	.macro END_FUNC name
54UNWIND(	.fnend)
55	.size \name , .-\name
56	.endm
57