[PATCH 2/5] ARM: at91: Merge sama5_boot_xload() asm code
Alexander Shiyan
eagle.alexander923 at gmail.com
Tue Mar 18 00:43:24 PDT 2025
This merges the sama5_boot_xload() assembler code to prevent
the r4 register from being used in the second line of asm volatile().
Signed-off-by: Alexander Shiyan <eagle.alexander923 at gmail.com>
---
include/mach/at91/sama5_bootsource.h | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/include/mach/at91/sama5_bootsource.h b/include/mach/at91/sama5_bootsource.h
index 2fb65ce10f..aeda1b4114 100644
--- a/include/mach/at91/sama5_bootsource.h
+++ b/include/mach/at91/sama5_bootsource.h
@@ -56,8 +56,13 @@ extern unsigned long at91_bootsource;
static inline void __noreturn sama5_boot_xload(void __noreturn (*bb)(void), u32 r4)
{
- asm volatile("mov r4, %0" : : "r"(r4) : );
- asm volatile("bx %0" : : "r"(bb) : );
+ asm volatile (
+ "mov r4, %0\n"
+ "bx %1\n"
+ :
+ : "r"(r4), "r"(bb)
+ : "r4"
+ );
__builtin_unreachable();
}
--
2.39.1
More information about the barebox
mailing list