summaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/barebox-arm.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-11-26 10:17:00 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-12-10 14:35:33 +0100
commit0644d1da7f547ba1b49ca95553ba65695ce9a3c3 (patch)
tree17088ff15ef3eb381bc989f6e863316699f828d5 /arch/arm/include/asm/barebox-arm.h
parent509f62209907d6cc4c8d4b4e95aff91c7684f5db (diff)
downloadbarebox-0644d1da7f547ba1b49ca95553ba65695ce9a3c3.tar.gz
barebox-0644d1da7f547ba1b49ca95553ba65695ce9a3c3.tar.xz
ARM: Make ENTRY_FUNCTION more robust
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>
Diffstat (limited to 'arch/arm/include/asm/barebox-arm.h')
-rw-r--r--arch/arm/include/asm/barebox-arm.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h
index 622bd13622..faf9afaab9 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_ */