[PATCH] fixup! ARM64: asm: rewrite ENTRY_FUNCTION(_WITHSTACK) fully in assembly

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Oct 24 05:11:50 PDT 2022


We have enough space before the barebox header to set up stack, insert
the optional break point and branch to the board-specific entry point.

Do that instead of jumping over the header and continuing directly
afterwards.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 arch/arm/cpu/head_64.S | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/arch/arm/cpu/head_64.S b/arch/arm/cpu/head_64.S
index 4ed4ffb05250..f934e96c6eaf 100644
--- a/arch/arm/cpu/head_64.S
+++ b/arch/arm/cpu/head_64.S
@@ -9,21 +9,11 @@
 
 .section .text_head_prologue_common, "x"
 ENTRY(__barebox_arm64_head)
-	nop
-	nop
 	nop
 	adr x9, __pbl_board_stack_top
 	ldr w9, [x9]
 	cbz x9, 1f
 	mov sp, x9
-	b 1f
-	.org 0x20
-	.asciz "barebox"
-	.word 0xffffffff
-	.word _barebox_image_size	/* image size to copy */
-	.rept 8
-	.word 0x55555555
-	.endr
 1:
 #ifdef CONFIG_PBL_BREAK
 	brk #17
@@ -33,4 +23,11 @@ ENTRY(__barebox_arm64_head)
 	nop
 #endif
 	b __pbl_board_entry
+	.org 0x20
+	.asciz "barebox"
+	.word 0xffffffff
+	.word _barebox_image_size	/* image size to copy */
+	.rept 8
+	.word 0x55555555
+	.endr
 END(__barebox_arm64_head)
-- 
2.30.2




More information about the barebox mailing list