From: Michael Tretter <m.tretter@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Michael Tretter <m.tretter@pengutronix.de>
Subject: [PATCH v2 3/4] ARM: aarch64: add ENTRY_PROC macro for arm64
Date: Wed, 28 Nov 2018 12:20:52 +0100 [thread overview]
Message-ID: <20181128112053.6027-4-m.tretter@pengutronix.de> (raw)
In-Reply-To: <20181128112053.6027-1-m.tretter@pengutronix.de>
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>
---
arch/arm/include/asm/barebox-arm64.h | 34 ++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
create mode 100644 arch/arm/include/asm/barebox-arm64.h
diff --git a/arch/arm/include/asm/barebox-arm64.h b/arch/arm/include/asm/barebox-arm64.h
new file mode 100644
index 0000000000..e7eda22128
--- /dev/null
+++ b/arch/arm/include/asm/barebox-arm64.h
@@ -0,0 +1,34 @@
+#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_ */
--
2.19.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2018-11-28 11:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-28 11:20 [PATCH v2 0/4] Xilinx Zynq Ultrascale+ MPSoC support Michael Tretter
2018-11-28 11:20 ` [PATCH v2 1/4] ARM: lib64: .gitignore barebox.lds Michael Tretter
2018-11-28 11:20 ` [PATCH v2 2/4] ARM: aarch64: compile with general-regs-only Michael Tretter
2018-11-28 11:20 ` Michael Tretter [this message]
2018-11-28 11:20 ` [PATCH v2 4/4] ARM: zynqmp: add support for Xilinx ZCU104 board Michael Tretter
2018-11-28 13:13 ` [PATCH v2 0/4] Xilinx Zynq Ultrascale+ MPSoC support Antony Pavlov
2018-11-29 8:14 ` Sascha Hauer
2018-11-29 9:50 ` Roland Hieber
2018-11-29 10:37 ` Sascha Hauer
2018-12-07 10:11 ` [PATCH v3 " Michael Tretter
2018-12-07 10:11 ` [PATCH v3 1/4] ARM: lib64: .gitignore barebox.lds Michael Tretter
2018-12-07 10:11 ` [PATCH v3 2/4] ARM: aarch64: compile with general-regs-only Michael Tretter
2018-12-07 10:11 ` [PATCH v3 3/4] ARM: aarch64: add ENTRY_PROC macro for arm64 Michael Tretter
2018-12-07 10:11 ` [PATCH v3 4/4] ARM: zynqmp: add support for Xilinx ZCU104 board Michael Tretter
2018-12-10 9:13 ` [PATCH v3 0/4] Xilinx Zynq Ultrascale+ MPSoC support Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181128112053.6027-4-m.tretter@pengutronix.de \
--to=m.tretter@pengutronix.de \
--cc=20181123133553.24761-1-m.tretter@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox