11bb92983SJerome Forissier/* SPDX-License-Identifier: BSD-2-Clause */ 2a0fdab65SJens Wiklander/* 3a0fdab65SJens Wiklander * Copyright (c) 2014, STMicroelectronics International N.V. 4762a5553SJens Wiklander * Copyright (c) 2020, Linaro Limited 5a0fdab65SJens Wiklander */ 6a0fdab65SJens Wiklander 73513f961SJerome Forissier#if defined(CFG_UNWIND) && defined(__arm__) 8827be46cSJerome Forissier#define UNWIND(...) __VA_ARGS__ 9827be46cSJerome Forissier#else 10827be46cSJerome Forissier#define UNWIND(...) 11827be46cSJerome Forissier#endif 12827be46cSJerome Forissier 13762a5553SJens Wiklander .macro FUNC name colon section=default align=4 140095acfcSJens Wiklander .ifc \section\(),default 158473540dSJens Wiklander .section .text.\name 160095acfcSJens Wiklander .else 170095acfcSJens Wiklander .section \section , "ax" , %progbits 180095acfcSJens Wiklander .endif 19a0fdab65SJens Wiklander .global \name 20a0fdab65SJens Wiklander .type \name , %function 21762a5553SJens Wiklander .balign \align 22a0fdab65SJens Wiklander \name \colon 233513f961SJerome ForissierUNWIND( .fnstart) 24a0fdab65SJens Wiklander .endm 25a0fdab65SJens Wiklander 26762a5553SJens Wiklander .macro LOCAL_FUNC name colon section=default align=4 270095acfcSJens Wiklander .ifc \section\(),default 288473540dSJens Wiklander .section .text.\name 290095acfcSJens Wiklander .else 300095acfcSJens Wiklander .section \section , "ax" , %progbits 310095acfcSJens Wiklander .endif 32a0fdab65SJens Wiklander .type \name , %function 33762a5553SJens Wiklander .balign \align 34a0fdab65SJens Wiklander \name \colon 353513f961SJerome ForissierUNWIND( .fnstart) 36a0fdab65SJens Wiklander .endm 37a0fdab65SJens Wiklander 38*44a8a0cfSJerome Forissier .macro WEAK_FUNC name colon section=default align=4 39*44a8a0cfSJerome Forissier .ifc \section\(),default 40*44a8a0cfSJerome Forissier .section .text.\name 41*44a8a0cfSJerome Forissier .else 42*44a8a0cfSJerome Forissier .section \section , "ax" , %progbits 43*44a8a0cfSJerome Forissier .endif 44*44a8a0cfSJerome Forissier .weak \name 45*44a8a0cfSJerome Forissier .type \name , %function 46*44a8a0cfSJerome Forissier .balign \align 47*44a8a0cfSJerome Forissier \name \colon 48*44a8a0cfSJerome ForissierUNWIND( .fnstart) 49*44a8a0cfSJerome Forissier .endm 50*44a8a0cfSJerome Forissier 51914103c1SJerome Forissier .macro END_FUNC name 52914103c1SJerome ForissierUNWIND( .fnend) 53914103c1SJerome Forissier .size \name , .-\name 54914103c1SJerome Forissier .endm 55914103c1SJerome Forissier 56914103c1SJerome Forissier .macro DATA name colon 57914103c1SJerome Forissier .global \name 58914103c1SJerome Forissier .type \name , %object 59914103c1SJerome Forissier \name \colon 60914103c1SJerome Forissier .endm 61914103c1SJerome Forissier 62a0fdab65SJens Wiklander .macro LOCAL_DATA name colon 63a0fdab65SJens Wiklander .type \name , %object 64a0fdab65SJens Wiklander \name \colon 65a0fdab65SJens Wiklander .endm 66a0fdab65SJens Wiklander 67a0fdab65SJens Wiklander .macro END_DATA name 68a0fdab65SJens Wiklander .size \name , .-\name 69a0fdab65SJens Wiklander .endm 70