提交 0de02de7 编写于 作者: A Alexander Graf 提交者: Tom Rini

arm: Fix setjmp (again)

Commit e6777248 (arm: Fix setjmp) added code to fix compilation of the setjmp
code path with thumv1. Unfortunately it missed a constraint that the adr
instruction can only refer to 4 byte aligned offsets.

So this patch adds the required alignment hooks to make compilation
work again even when setjmp doesn't happen to be 4 byte aligned.
Signed-off-by: NAlexander Graf <agraf@suse.de>
Tested-by: NTom Rini <trini@konsulko.com>
上级 59d07ee0
......@@ -43,6 +43,7 @@ static inline int setjmp(jmp_buf jmp)
#else
asm volatile(
#ifdef CONFIG_SYS_THUMB_BUILD
".align 2\n"
"adr r0, jmp_target\n"
"add r0, r0, $1\n"
#else
......@@ -52,7 +53,8 @@ static inline int setjmp(jmp_buf jmp)
"mov r2, sp\n"
"stm r1!, {r0, r2, r4, r5, r6, r7}\n"
"b 2f\n"
"jmp_target: "
".align 2\n"
"jmp_target: \n"
"mov %0, #1\n"
"2:\n"
: "+l" (r)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册