Imre Kis | 3b32e7b | 2020-11-24 00:33:01 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: BSD-2-Clause */ |
| 2 | /* |
Gabor Toth | c9d54f6 | 2024-06-06 14:09:14 +0200 | [diff] [blame] | 3 | * Copyright (c) 2024, Arm Limited and Contributors. All rights reserved. |
Imre Kis | 3b32e7b | 2020-11-24 00:33:01 +0100 | [diff] [blame] | 4 | * Copyright (c) 2014, STMicroelectronics International N.V. |
| 5 | */ |
| 6 | |
Gabor Toth | c9d54f6 | 2024-06-06 14:09:14 +0200 | [diff] [blame] | 7 | #if defined(BTI_ENABLED) |
| 8 | #include <arm64_bti.S> |
| 9 | |
| 10 | #define BTI(...) __VA_ARGS__ |
| 11 | #else |
| 12 | #define BTI(...) |
| 13 | #endif |
| 14 | |
Imre Kis | 3b32e7b | 2020-11-24 00:33:01 +0100 | [diff] [blame] | 15 | .macro FUNC name colon section=default |
| 16 | .ifc \section\(),default |
| 17 | .section .text.\name |
| 18 | .else |
| 19 | .section \section , "ax" , %progbits |
| 20 | .endif |
| 21 | .global \name |
| 22 | .type \name , %function |
| 23 | .balign 4 |
| 24 | \name \colon |
Gabor Toth | c9d54f6 | 2024-06-06 14:09:14 +0200 | [diff] [blame] | 25 | BTI(bti c) |
Imre Kis | 3b32e7b | 2020-11-24 00:33:01 +0100 | [diff] [blame] | 26 | .endm |
| 27 | |
| 28 | .macro DATA name colon |
| 29 | .global \name |
| 30 | .type \name , %object |
| 31 | \name \colon |
| 32 | .endm |
| 33 | |
| 34 | .macro LOCAL_FUNC name colon section=default |
| 35 | .ifc \section\(),default |
| 36 | .section .text.\name |
| 37 | .else |
| 38 | .section \section , "ax" , %progbits |
| 39 | .endif |
| 40 | .type \name , %function |
| 41 | .balign 4 |
| 42 | \name \colon |
Gabor Toth | c9d54f6 | 2024-06-06 14:09:14 +0200 | [diff] [blame] | 43 | BTI(bti c) |
Imre Kis | 3b32e7b | 2020-11-24 00:33:01 +0100 | [diff] [blame] | 44 | .endm |
| 45 | |
| 46 | .macro LOCAL_DATA name colon |
| 47 | .type \name , %object |
| 48 | \name \colon |
| 49 | .endm |
| 50 | |
| 51 | .macro END_DATA name |
| 52 | .size \name , .-\name |
| 53 | .endm |
| 54 | |
| 55 | .macro END_FUNC name |
| 56 | .size \name , .-\name |
| 57 | .endm |