summaryrefslogtreecommitdiff
path: root/src/arch/arm/include
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2014-01-13 13:24:30 -0800
committerMarc Jones <marc.jones@se-eng.com>2014-11-09 01:37:13 +0100
commit25a282dabc5fb656a1402c26920974d129ef7917 (patch)
treeac8c5e7638a59d0b1daced8746eb1704eefed092 /src/arch/arm/include
parenta38ccfdee1404211dbf3c43edf7b5b686a3a05fd (diff)
arm: Thumb ALL the things!
This patch switches every last part of Coreboot on ARM over to Thumb mode: libpayload, the internal libgcc, and assorted assembly files. In combination with the respective depthcharge patch, this will switch to Thumb mode right after the entry point of the bootblock and not switch back to ARM until the final assembly stub that jumps to the kernel. The required changes to make this work include some new headers and Makefile flags to handle assembly files (using the unified syntax and the same helper macros as Linux), modifying our custom-written libgcc code for 64-bit division to support Thumb (removing some stale old files that were never really used for clarity), and flipping the general CFLAGS to Thumb (some more cleanup there as well while I'm at it). BUG=None TEST=Snow and Nyan still boot. Original-Change-Id: I80c04281e3adbf74f9f477486a96b9fafeb455b3 Original-Signed-off-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/182212 Original-Reviewed-by: Gabe Black <gabeblack@chromium.org> (cherry picked from commit 5f65c17cbfae165a95354146ae79e06c512c2c5a) Conflicts: payloads/libpayload/include/arm/arch/asm.h src/arch/arm/Makefile.inc src/arch/arm/armv7/Makefile.inc *** There is an issue with what to do with ramstage-S-ccopts, and *** will need to be covered in additional ARM cleanup patches. Change-Id: I80c04281e3adbf74f9f477486a96b9fafeb455b3 Signed-off-by: Marc Jones <marc.jones@se-eng.com> Reviewed-on: http://review.coreboot.org/6930 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/arch/arm/include')
-rw-r--r--src/arch/arm/include/arch/asm.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/arch/arm/include/arch/asm.h b/src/arch/arm/include/arch/asm.h
index 5f3e55f135..a57ce4dafa 100644
--- a/src/arch/arm/include/arch/asm.h
+++ b/src/arch/arm/include/arch/asm.h
@@ -20,19 +20,20 @@
#ifndef __ARM_ASM_H
#define __ARM_ASM_H
-#if defined __arm__
-# define ARM(x...) x
-# define THUMB(x...)
-# define W(instr) instr
-#elif defined __thumb__
+/* __arm__ is defined regardless of Thumb mode, so need to order this right */
+#if defined __thumb2__
# define ARM(x...)
# define THUMB(x...) x
# define W(instr) instr.w
# if __COREBOOT_ARM_ARCH__ < 7
# error thumb mode has not been tested with ARM < v7!
# endif
+#elif defined __thumb__
+# error You are not compiling Thumb2, this won't work!
#else
-# error Not in ARM or thumb mode!
+# define ARM(x...) x
+# define THUMB(x...)
+# define W(instr) instr
#endif
#define ALIGN .align 0
@@ -49,4 +50,10 @@
#define END(name) \
.size name, .-name
+/* Everything should go into the text section by default. */
+ .text
+
+/* Thumb code uses the (new) unified assembly syntax. */
+THUMB( .syntax unified )
+
#endif /* __ARM_ASM_H */