summaryrefslogtreecommitdiffstats
path: root/arch/arm/lib
diff options
context:
space:
mode:
authorTrent Piepho <tpiepho@kymetacorp.com>2015-12-03 01:24:56 +0000
committerSascha Hauer <s.hauer@pengutronix.de>2015-12-04 08:15:23 +0100
commitde7a09bb4326fd9f014303a45e3ad5a729ac3a3c (patch)
tree89a1af10769eac300fdae00b1928991cfab1cd1f /arch/arm/lib
parentacc017737f8ec65740be798e8daea257eb86f0aa (diff)
downloadbarebox-de7a09bb4326fd9f014303a45e3ad5a729ac3a3c.tar.gz
barebox-de7a09bb4326fd9f014303a45e3ad5a729ac3a3c.tar.xz
ARM: Remove kernel booting call for thumb2 mode
The asm code to do the actual call into the kernel (or another barebox) when compiled in thumb2 mode isn't necessary. gcc generates a perfectly good calling sequence from a normal function pointer call. If it didn't, the code in bootstrap_boot() that uses a function pointer to jump to the 2nd stage barebox from an xloader wouldn't work. It appears to be allowed that the call to kernel() could return, as neither start_linux() nor kernel() are marked noreturn, and there is code after calls to start_linux(). The asm code has a bug in this case, as it uses bx and not blx, and thus doesn't set the link register. Since it's a tail call, this would be okay, but only if the LR value from the start of start_linux() (and the callee-saved registers) are restored beforehand, which isn't done. The gcc generated call sequence will do this. Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/lib')
-rw-r--r--arch/arm/lib/armlinux.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c
index 16879f8e59..47b9bd33ed 100644
--- a/arch/arm/lib/armlinux.c
+++ b/arch/arm/lib/armlinux.c
@@ -277,17 +277,5 @@ void start_linux(void *adr, int swap, unsigned long initrd_address,
__asm__ __volatile__("mcr p15, 0, %0, c1, c0" :: "r" (reg));
}
-#ifdef CONFIG_THUMB2_BAREBOX
- __asm__ __volatile__ (
- "mov r0, #0\n"
- "mov r1, %0\n"
- "mov r2, %1\n"
- "bx %2\n"
- :
- : "r" (architecture), "r" (params), "r" (kernel)
- : "r0", "r1", "r2"
- );
-#else
kernel(0, architecture, params);
-#endif
}