From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 02/17] ARM: Make ENTRY_FUNCTION more robust
Date: Tue, 26 Nov 2013 17:45:52 +0100 [thread overview]
Message-ID: <1385484367-15366-3-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1385484367-15366-1-git-send-email-s.hauer@pengutronix.de>
An entry function should begin with a exception header. For this to work
properly the entry function should not contain any code which gcc might
put before the header. To make this sure change the ENTRY_FUNCTION macro
so that it generates one function which only contains the exception header
and a second function which contains the original body of the entry function.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/dfi-fs700-m60/lowlevel.c | 8 ++------
arch/arm/boards/dmo-mx6-realq7/lowlevel.c | 4 +---
arch/arm/boards/ebv-socrates/lowlevel.c | 6 ++----
arch/arm/boards/efika-mx-smartbook/lowlevel.c | 4 +---
arch/arm/boards/freescale-mx51-pdk/lowlevel.c | 4 +---
arch/arm/boards/freescale-mx53-loco/lowlevel.c | 4 +---
arch/arm/boards/freescale-mx53-vmx53/lowlevel.c | 4 +---
arch/arm/boards/freescale-mx6-sabrelite/lowlevel.c | 4 +---
arch/arm/boards/gk802/lowlevel.c | 4 +---
arch/arm/boards/phytec-pfla02/lowlevel.c | 8 ++------
arch/arm/boards/solidrun-cubox/lowlevel.c | 4 +---
arch/arm/boards/terasic-sockit/lowlevel.c | 8 ++------
arch/arm/boards/toradex-colibri-t20-iris/entry.c | 4 +---
arch/arm/boards/toshiba-ac100/entry.c | 4 +---
arch/arm/boards/tqma6x/lowlevel.c | 8 ++------
arch/arm/include/asm/barebox-arm.h | 16 +++++++++++++---
16 files changed, 33 insertions(+), 61 deletions(-)
diff --git a/arch/arm/boards/dfi-fs700-m60/lowlevel.c b/arch/arm/boards/dfi-fs700-m60/lowlevel.c
index 725c58d..2995bd4 100644
--- a/arch/arm/boards/dfi-fs700-m60/lowlevel.c
+++ b/arch/arm/boards/dfi-fs700-m60/lowlevel.c
@@ -61,12 +61,10 @@ static inline void early_uart_init_6s(void)
extern char __dtb_imx6q_dfi_fs700_m60_6q_start[];
-ENTRY_FUNCTION(start_imx6q_dfi_fs700_m60_6q)(void)
+ENTRY_FUNCTION(start_imx6q_dfi_fs700_m60_6q, r0, r1, r2)
{
uint32_t fdt;
- __barebox_arm_head();
-
arm_cpu_lowlevel_init();
arm_setup_stack(0x00940000 - 8);
@@ -80,13 +78,11 @@ ENTRY_FUNCTION(start_imx6q_dfi_fs700_m60_6q)(void)
extern char __dtb_imx6dl_dfi_fs700_m60_6s_start[];
-ENTRY_FUNCTION(start_imx6dl_dfi_fs700_m60_6s)(void)
+ENTRY_FUNCTION(start_imx6dl_dfi_fs700_m60_6s, r0, r1, r2)
{
uint32_t fdt;
int i;
- __barebox_arm_head();
-
arm_cpu_lowlevel_init();
arm_setup_stack(0x00920000 - 8);
diff --git a/arch/arm/boards/dmo-mx6-realq7/lowlevel.c b/arch/arm/boards/dmo-mx6-realq7/lowlevel.c
index 240116d..f47575e 100644
--- a/arch/arm/boards/dmo-mx6-realq7/lowlevel.c
+++ b/arch/arm/boards/dmo-mx6-realq7/lowlevel.c
@@ -140,12 +140,10 @@ static void sdram_init(void)
extern char __dtb_imx6q_dmo_realq7_start[];
-ENTRY_FUNCTION(start_imx6_realq7)(void)
+ENTRY_FUNCTION(start_imx6_realq7, r0, r1, r2)
{
uint32_t fdt;
- __barebox_arm_head();
-
arm_cpu_lowlevel_init();
arm_setup_stack(0x00940000 - 8);
diff --git a/arch/arm/boards/ebv-socrates/lowlevel.c b/arch/arm/boards/ebv-socrates/lowlevel.c
index d2f02e0..e93ae38 100644
--- a/arch/arm/boards/ebv-socrates/lowlevel.c
+++ b/arch/arm/boards/ebv-socrates/lowlevel.c
@@ -45,7 +45,7 @@ static inline void ledoff(void)
extern char __dtb_socfpga_cyclone5_socrates_start[];
-ENTRY_FUNCTION(start_socfpga_socrates)(void)
+ENTRY_FUNCTION(start_socfpga_socrates, r0, r1, r2)
{
uint32_t fdt;
@@ -87,10 +87,8 @@ static noinline void socrates_entry(void)
barebox_arm_entry(0x0, SZ_1G, 0);
}
-ENTRY_FUNCTION(start_socfpga_socrates_xload)(void)
+ENTRY_FUNCTION(start_socfpga_socrates_xload, r0, r1, r2)
{
- __barebox_arm_head();
-
arm_cpu_lowlevel_init();
arm_setup_stack(0xffff0000 + SZ_64K - SZ_4K - 16);
diff --git a/arch/arm/boards/efika-mx-smartbook/lowlevel.c b/arch/arm/boards/efika-mx-smartbook/lowlevel.c
index 5a56861..72c8b00 100644
--- a/arch/arm/boards/efika-mx-smartbook/lowlevel.c
+++ b/arch/arm/boards/efika-mx-smartbook/lowlevel.c
@@ -6,12 +6,10 @@
extern char __dtb_imx51_genesi_efika_sb_start[];
-ENTRY_FUNCTION(start_imx51_genesi_efikasb)(void)
+ENTRY_FUNCTION(start_imx51_genesi_efikasb, r0, r1, r2)
{
uint32_t fdt;
- __barebox_arm_head();
-
arm_cpu_lowlevel_init();
arm_setup_stack(0x20000000 - 16);
imx51_init_lowlevel(800);
diff --git a/arch/arm/boards/freescale-mx51-pdk/lowlevel.c b/arch/arm/boards/freescale-mx51-pdk/lowlevel.c
index 8c1acb4..f606011 100644
--- a/arch/arm/boards/freescale-mx51-pdk/lowlevel.c
+++ b/arch/arm/boards/freescale-mx51-pdk/lowlevel.c
@@ -5,12 +5,10 @@
extern char __dtb_imx51_babbage_start[];
-ENTRY_FUNCTION(start_imx51_babbage)(void)
+ENTRY_FUNCTION(start_imx51_babbage, r0, r1, r2)
{
uint32_t fdt;
- __barebox_arm_head();
-
arm_cpu_lowlevel_init();
fdt = (uint32_t)__dtb_imx51_babbage_start - get_runtime_offset();
diff --git a/arch/arm/boards/freescale-mx53-loco/lowlevel.c b/arch/arm/boards/freescale-mx53-loco/lowlevel.c
index d920524..7556a2e 100644
--- a/arch/arm/boards/freescale-mx53-loco/lowlevel.c
+++ b/arch/arm/boards/freescale-mx53-loco/lowlevel.c
@@ -5,12 +5,10 @@
extern char __dtb_imx53_qsb_start[];
-ENTRY_FUNCTION(start_imx53_loco)(void)
+ENTRY_FUNCTION(start_imx53_loco, r0, r1, r2)
{
uint32_t fdt;
- __barebox_arm_head();
-
arm_cpu_lowlevel_init();
fdt = (uint32_t)__dtb_imx53_qsb_start - get_runtime_offset();
diff --git a/arch/arm/boards/freescale-mx53-vmx53/lowlevel.c b/arch/arm/boards/freescale-mx53-vmx53/lowlevel.c
index 5dc23fd..ba356cd 100644
--- a/arch/arm/boards/freescale-mx53-vmx53/lowlevel.c
+++ b/arch/arm/boards/freescale-mx53-vmx53/lowlevel.c
@@ -5,12 +5,10 @@
extern char __dtb_imx53_voipac_bsb_start[];
-ENTRY_FUNCTION(start_imx53_vmx53)(void)
+ENTRY_FUNCTION(start_imx53_vmx53, r0, r1, r2)
{
uint32_t fdt;
- __barebox_arm_head();
-
arm_cpu_lowlevel_init();
fdt = (uint32_t)__dtb_imx53_voipac_bsb_start - get_runtime_offset();
diff --git a/arch/arm/boards/freescale-mx6-sabrelite/lowlevel.c b/arch/arm/boards/freescale-mx6-sabrelite/lowlevel.c
index a68e09a..b36a39c 100644
--- a/arch/arm/boards/freescale-mx6-sabrelite/lowlevel.c
+++ b/arch/arm/boards/freescale-mx6-sabrelite/lowlevel.c
@@ -5,12 +5,10 @@
extern char __dtb_imx6q_sabrelite_start[];
-ENTRY_FUNCTION(start_imx6_sabrelite)(void)
+ENTRY_FUNCTION(start_imx6_sabrelite, r0, r1, r2)
{
uint32_t fdt;
- __barebox_arm_head();
-
arm_cpu_lowlevel_init();
fdt = (uint32_t)__dtb_imx6q_sabrelite_start - get_runtime_offset();
diff --git a/arch/arm/boards/gk802/lowlevel.c b/arch/arm/boards/gk802/lowlevel.c
index 95b218d..e159ddb 100644
--- a/arch/arm/boards/gk802/lowlevel.c
+++ b/arch/arm/boards/gk802/lowlevel.c
@@ -5,12 +5,10 @@
extern char __dtb_imx6q_gk802_start[];
-ENTRY_FUNCTION(start_imx6_gk802)(void)
+ENTRY_FUNCTION(start_imx6_gk802, r0, r1, r2)
{
uint32_t fdt;
- __barebox_arm_head();
-
arm_cpu_lowlevel_init();
fdt = (uint32_t)__dtb_imx6q_gk802_start - get_runtime_offset();
diff --git a/arch/arm/boards/phytec-pfla02/lowlevel.c b/arch/arm/boards/phytec-pfla02/lowlevel.c
index 6596e92..6422bc4 100644
--- a/arch/arm/boards/phytec-pfla02/lowlevel.c
+++ b/arch/arm/boards/phytec-pfla02/lowlevel.c
@@ -55,12 +55,10 @@ static inline void setup_uart(void)
extern char __dtb_imx6q_phytec_pbab01_start[];
-ENTRY_FUNCTION(start_phytec_pbab01_1gib)(void)
+ENTRY_FUNCTION(start_phytec_pbab01_1gib, r0, r1, r2)
{
uint32_t fdt;
- __barebox_arm_head();
-
arm_cpu_lowlevel_init();
arm_setup_stack(0x00920000 - 8);
@@ -73,12 +71,10 @@ ENTRY_FUNCTION(start_phytec_pbab01_1gib)(void)
barebox_arm_entry(0x10000000, SZ_1G, fdt);
}
-ENTRY_FUNCTION(start_phytec_pbab01_2gib)(void)
+ENTRY_FUNCTION(start_phytec_pbab01_2gib, r0, r1, r2)
{
uint32_t fdt;
- __barebox_arm_head();
-
arm_cpu_lowlevel_init();
arm_setup_stack(0x00920000 - 8);
diff --git a/arch/arm/boards/solidrun-cubox/lowlevel.c b/arch/arm/boards/solidrun-cubox/lowlevel.c
index fdf5a7e..1fcecb5 100644
--- a/arch/arm/boards/solidrun-cubox/lowlevel.c
+++ b/arch/arm/boards/solidrun-cubox/lowlevel.c
@@ -23,12 +23,10 @@
extern char __dtb_dove_cubox_start[];
-ENTRY_FUNCTION(start_solidrun_cubox)(void)
+ENTRY_FUNCTION(start_solidrun_cubox, r0, r1, r2)
{
uint32_t fdt;
- __barebox_arm_head();
-
arm_cpu_lowlevel_init();
fdt = (uint32_t)__dtb_dove_cubox_start - get_runtime_offset();
diff --git a/arch/arm/boards/terasic-sockit/lowlevel.c b/arch/arm/boards/terasic-sockit/lowlevel.c
index 8a1e0ce..0a4a923 100644
--- a/arch/arm/boards/terasic-sockit/lowlevel.c
+++ b/arch/arm/boards/terasic-sockit/lowlevel.c
@@ -45,12 +45,10 @@ static inline void ledoff(int led)
extern char __dtb_socfpga_cyclone5_sockit_start[];
-ENTRY_FUNCTION(start_socfpga_sockit)(void)
+ENTRY_FUNCTION(start_socfpga_sockit, r0, r1, r2)
{
uint32_t fdt;
- __barebox_arm_head();
-
arm_cpu_lowlevel_init();
fdt = (uint32_t)__dtb_socfpga_cyclone5_sockit_start - get_runtime_offset();
@@ -87,10 +85,8 @@ static noinline void sockit_entry(void)
barebox_arm_entry(0x0, SZ_1G, 0);
}
-ENTRY_FUNCTION(start_socfpga_sockit_xload)(void)
+ENTRY_FUNCTION(start_socfpga_sockit_xload, r0, r1, r2)
{
- __barebox_arm_head();
-
arm_cpu_lowlevel_init();
arm_setup_stack(0xffff0000 + SZ_64K - SZ_4K - 16);
diff --git a/arch/arm/boards/toradex-colibri-t20-iris/entry.c b/arch/arm/boards/toradex-colibri-t20-iris/entry.c
index 30a13e0..886613f 100644
--- a/arch/arm/boards/toradex-colibri-t20-iris/entry.c
+++ b/arch/arm/boards/toradex-colibri-t20-iris/entry.c
@@ -22,12 +22,10 @@
extern char __dtb_tegra20_colibri_iris_start[];
-ENTRY_FUNCTION(start_toradex_colibri_t20_iris)(void)
+ENTRY_FUNCTION(start_toradex_colibri_t20_iris, r0, r1, r2)
{
uint32_t fdt;
- __barebox_arm_head();
-
tegra_cpu_lowlevel_setup();
fdt = (uint32_t)__dtb_tegra20_colibri_iris_start - get_runtime_offset();
diff --git a/arch/arm/boards/toshiba-ac100/entry.c b/arch/arm/boards/toshiba-ac100/entry.c
index 372d596..45fa56a 100644
--- a/arch/arm/boards/toshiba-ac100/entry.c
+++ b/arch/arm/boards/toshiba-ac100/entry.c
@@ -22,12 +22,10 @@
extern char __dtb_tegra20_paz00_start[];
-ENTRY_FUNCTION(start_toshiba_ac100)(void)
+ENTRY_FUNCTION(start_toshiba_ac100, r0, r1, r2)
{
uint32_t fdt;
- __barebox_arm_head();
-
tegra_cpu_lowlevel_setup();
fdt = (uint32_t)__dtb_tegra20_paz00_start - get_runtime_offset();
diff --git a/arch/arm/boards/tqma6x/lowlevel.c b/arch/arm/boards/tqma6x/lowlevel.c
index 8a16abb..a09a2f5 100644
--- a/arch/arm/boards/tqma6x/lowlevel.c
+++ b/arch/arm/boards/tqma6x/lowlevel.c
@@ -41,12 +41,10 @@ static inline void setup_uart(void)
extern char __dtb_imx6q_mba6x_start[];
extern char __dtb_imx6dl_mba6x_start[];
-ENTRY_FUNCTION(start_imx6q_mba6x)(void)
+ENTRY_FUNCTION(start_imx6q_mba6x, r0, r1, r2)
{
uint32_t fdt;
- __barebox_arm_head();
-
arm_cpu_lowlevel_init();
arm_setup_stack(0x00920000 - 8);
@@ -64,12 +62,10 @@ ENTRY_FUNCTION(start_imx6q_mba6x)(void)
barebox_arm_entry(0x10000000, SZ_1G, fdt);
}
-ENTRY_FUNCTION(start_imx6dl_mba6x)(void)
+ENTRY_FUNCTION(start_imx6dl_mba6x, r0, r1, r2)
{
uint32_t fdt;
- __barebox_arm_head();
-
arm_cpu_lowlevel_init();
arm_setup_stack(0x00920000 - 8);
diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h
index 622bd13..faf9afa 100644
--- a/arch/arm/include/asm/barebox-arm.h
+++ b/arch/arm/include/asm/barebox-arm.h
@@ -79,8 +79,18 @@ static inline unsigned long arm_barebox_image_place(unsigned long endmem)
return endmem;
}
-#define ENTRY_FUNCTION(name) \
- void __naked __section(.text_head_entry_##name) \
- name
+#define ENTRY_FUNCTION(name, arg0, arg1, arg2) \
+ static void __##name(uint32_t, uint32_t, uint32_t); \
+ \
+ void __naked __section(.text_head_entry_##name) name \
+ (uint32_t r0, uint32_t r1, uint32_t r2) \
+ { \
+ __barebox_arm_head(); \
+ __##name(r0, r1, r2); \
+ } \
+ static void __naked noinline __##name \
+ (uint32_t arg0, uint32_t arg1, uint32_t arg2)
+
+
#endif /* _BAREBOX_ARM_H_ */
--
1.8.4.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2013-11-26 16:46 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-26 16:45 [PATCH] AM33xx devicetree support Sascha Hauer
2013-11-26 16:45 ` [PATCH 01/17] ARM: Make multi images startup process simpler Sascha Hauer
2013-11-26 16:45 ` Sascha Hauer [this message]
2013-11-26 16:45 ` [PATCH 03/17] ARM: Add base am335x-phytec-phycore devicetree file Sascha Hauer
2013-11-26 16:45 ` [PATCH 04/17] ARM: am335x phytec phyCORE: Switch to devicetree probe support Sascha Hauer
2013-11-27 3:20 ` Alexander Aring
2013-11-27 7:43 ` Sascha Hauer
2013-12-10 14:22 ` Jan Weitzel
2013-12-10 14:24 ` Sascha Hauer
2013-12-11 8:33 ` Jan Weitzel
2013-11-26 16:45 ` [PATCH 05/17] ARM: am33xx Phytec phyCORE: initialize debug UART Sascha Hauer
2013-11-26 16:45 ` [PATCH 06/17] ARM: am33xx Phytec phyCORE: Switch to multiimage support Sascha Hauer
2013-11-26 16:45 ` [PATCH 07/17] ARM: am33xx Phytec phyCORE: update defconfig Sascha Hauer
2013-11-26 16:45 ` [PATCH 08/17] ARM: dts: Add am33xx beaglebone(black) dts files Sascha Hauer
2013-11-26 16:45 ` [PATCH 09/17] ARM: am33xx: beaglebone: remove mlo_large_defconfig Sascha Hauer
2013-11-26 16:46 ` [PATCH 10/17] ARM: beaglebone: Add memory to devicetrees Sascha Hauer
2013-11-26 16:46 ` [PATCH 11/17] ARM: beaglebone: Switch to devicetree and multiimage Sascha Hauer
2013-11-26 16:46 ` [PATCH 12/17] ARM: am335x Phytec phyCORE: Move partition descriptions to devicetree Sascha Hauer
2013-11-26 16:46 ` [PATCH 13/17] ARM: OMAP: Safe boot info in fixed SRAM address Sascha Hauer
2013-11-26 16:46 ` [PATCH 14/17] ARM: am335x Phytec phyCORE: configure environment from devicetree Sascha Hauer
2013-11-26 16:46 ` [PATCH 15/17] ARM: beaglebone: configure console " Sascha Hauer
2013-11-26 16:46 ` [PATCH 16/17] ARM: OMAP: introduce multiboard support and move am33xx boards to it Sascha Hauer
2013-11-26 16:46 ` [PATCH 17/17] ARM: OMAP: consolidate am335x mlo defconfigs Sascha Hauer
2014-02-25 11:12 ` Carlos Fernández
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=1385484367-15366-3-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@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