From 28c034e69e6610602ef592b89476ce48e7ce58e8 Mon Sep 17 00:00:00 2001 From: Jonathan Brandmeyer Date: Tue, 9 Oct 2018 15:01:43 -0600 Subject: Zinger: lift function call out of assembly This function call doesn't need to be a tail-call for correctness. Changes in LTO increase the jump distance to this target beyond the +/- 2 kB range supported by 'b' in ARMv6-M. BUG=chromium:851727 BRANCH=none TEST=buildall Signed-off-by: Jonathan Brandmeyer Change-Id: Ia45d00aea8f496213e4dfd33febf85b9494ef22d Reviewed-on: https://chromium-review.googlesource.com/1272175 Commit-Ready: Jonathan Brandmeyer Tested-by: Jonathan Brandmeyer Reviewed-by: Jonathan Brandmeyer --- board/zinger/runtime.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'board/zinger') diff --git a/board/zinger/runtime.c b/board/zinger/runtime.c index 11b1643d30..0caaa146fd 100644 --- a/board/zinger/runtime.c +++ b/board/zinger/runtime.c @@ -260,16 +260,17 @@ void system_reset(int flags) void exception_panic(void) __attribute__((naked)); void exception_panic(void) { - asm volatile( #ifdef CONFIG_DEBUG_PRINTF + asm volatile( "mov r0, %0\n" + /* TODO: Should this be SP_process instead of SP_main? */ "mov r3, sp\n" "ldr r1, [r3, #6*4]\n" /* retrieve exception PC */ "ldr r2, [r3, #5*4]\n" /* retrieve exception LR */ "bl debug_printf\n" -#endif - "b cpu_reset\n" : : "r"("PANIC PC=%08x LR=%08x\n\n")); +#endif + cpu_reset(); } void panic_reboot(void) -- cgit v1.2.1