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