diff options
author | Michael Tretter <m.tretter@pengutronix.de> | 2018-12-07 11:11:55 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-12-10 10:13:30 +0100 |
commit | be2ca38aaaac1739421588a71a6fc2c601bc7604 (patch) | |
tree | 098dc3263495fd97b33916039f88aecf04afdcfa /arch | |
parent | 64d95896cf0e22a769066f33180b60707356160b (diff) | |
download | barebox-be2ca38aaaac1739421588a71a6fc2c601bc7604.tar.gz barebox-be2ca38aaaac1739421588a71a6fc2c601bc7604.tar.xz |
ARM: aarch64: add ENTRY_PROC macro for arm64
arm64 has no __naked__ attribute and the compiler adds a function prologue
for saving x29 and x30 to the stack for all C functions. This includes
functions defined using the ENTRY_FUNCTION macro. Therefore, the stack
needs to be setup before entering a C function, which is not possible if
the entry is a C function.
Provide a macro to implement the entry in assembly to be able to setup the
stack before entering the low level entry function.
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/include/asm/barebox-arm64.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/arm/include/asm/barebox-arm64.h b/arch/arm/include/asm/barebox-arm64.h new file mode 100644 index 0000000000..58ff7b9b36 --- /dev/null +++ b/arch/arm/include/asm/barebox-arm64.h @@ -0,0 +1,35 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +#ifndef _BAREBOX_ARM64_H_ +#define _BAREBOX_ARM64_H_ + +#include <linux/linkage.h> + +/* + * ENTRY_PROC - mark start of entry procedure + */ +#define ENTRY_PROC(name) \ + .section .text_head_entry_##name; \ + ENTRY(##name); \ + b 2f; \ + nop; \ + nop; \ + nop; \ + nop; \ + nop; \ + nop; \ + nop; \ + .asciz "barebox"; \ + .word 0xffffffff; \ + .word _barebox_image_size; \ + .rept 8; \ + .word 0x55555555; \ + .endr; \ + 2: + +/* + * ENTRY_PROC_END - mark end of entry procedure + */ +#define ENTRY_PROC_END(name) \ + END(##name) + +#endif /* _BAREBOX_ARM64_H_ */ |