Skip to content

Commit 14d59b3

Browse files
galakMaureenHelm
authored andcommitted
cortex_m: tz_ns.h: Fix compiling with arm-clang
We get the following error when building with arm-clang: error: non-ASM statement in naked function is not supported __TZ_WRAP_FUNC(preface, foo1, postface); ^ tests/arch/arm/arm_tz_wrap_func/src/main.c:69:25: note: attribute is here uint32_t __attribute__((naked)) wrap_foo1(uint32_t arg1, uint32_t arg2, ^ 1 error generated. Remove the do/while wrapper to make this a true naked function. Signed-off-by: Kumar Gala <[email protected]>
1 parent fb9aefc commit 14d59b3

File tree

1 file changed

+1
-3
lines changed
  • arch/arm/include/aarch32/cortex_m

1 file changed

+1
-3
lines changed

arch/arm/include/aarch32/cortex_m/tz_ns.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
* r0-r3 unmodified.
4848
*/
4949
#define __TZ_WRAP_FUNC_RAW(preface, name, postface, store_lr, load_lr) \
50-
do { \
5150
__asm__ volatile( \
5251
".global "#preface"; .type "#preface", %function"); \
5352
__asm__ volatile( \
@@ -64,8 +63,7 @@
6463
"bl " #postface "\n\t" \
6564
"pop {r0-r3}\n\t" \
6665
load_lr "\n\t" \
67-
::); \
68-
} while (false)
66+
::);
6967

7068
/**
7169
* @brief Macro for "sandwiching" a function call (@p name) in two other calls

0 commit comments

Comments
 (0)