diff mbox series

[U-Boot] exynos: Leave the compiler to choose the register to avoid possible r0 corruption

Message ID 20190104082319.9277-1-guillaume.gardet@free.fr
State Accepted
Commit df1ff4d6ba591a5fcb9549e895b23c781d8fda6d
Headers show
Series [U-Boot] exynos: Leave the compiler to choose the register to avoid possible r0 corruption | expand

Commit Message

Guillaume GARDET Jan. 4, 2019, 8:23 a.m. UTC
Reported-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>

Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Tom Rini <trini@konsulko.com>
---
 arch/arm/mach-exynos/include/mach/system.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Minkyu Kang Jan. 7, 2019, 12:39 a.m. UTC | #1
Hi,

On 04/01/19 17:23, Guillaume GARDET wrote:
> Reported-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
> 
> Cc: Albert Aribaud <albert.u.boot@aribaud.net>
> Cc: Minkyu Kang <mk7.kang@samsung.com>
> Cc: Tom Rini <trini@konsulko.com>
> ---
>  arch/arm/mach-exynos/include/mach/system.h | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-exynos/include/mach/system.h b/arch/arm/mach-exynos/include/mach/system.h
> index 81fa9800b4..48f13c7648 100644
> --- a/arch/arm/mach-exynos/include/mach/system.h
> +++ b/arch/arm/mach-exynos/include/mach/system.h
> @@ -58,8 +58,7 @@ struct exynos5_sysreg {
>  /* Move 0xd3 value to CPSR register to enable SVC mode */
>  #define svc32_mode_en() __asm__ __volatile__				\
>  			("@ I&F disable, Mode: 0x13 - SVC\n\t"		\
> -			 "mov     r0, #0x13|0xC0\n\t"			\
> -			 "msr     cpsr_c, r0\n\t" : : )
> +			 "msr     cpsr_c, %0\n\t" : : "r"(0x13|0xC0))
>  
>  /* Set program counter with the given value */
>  #define set_pc(x) __asm__ __volatile__ ("mov     pc, %0\n\t" : : "r"(x))
> 

applied to u-boot-samsung.

Thanks,
Minkyu Kang.
diff mbox series

Patch

diff --git a/arch/arm/mach-exynos/include/mach/system.h b/arch/arm/mach-exynos/include/mach/system.h
index 81fa9800b4..48f13c7648 100644
--- a/arch/arm/mach-exynos/include/mach/system.h
+++ b/arch/arm/mach-exynos/include/mach/system.h
@@ -58,8 +58,7 @@  struct exynos5_sysreg {
 /* Move 0xd3 value to CPSR register to enable SVC mode */
 #define svc32_mode_en() __asm__ __volatile__				\
 			("@ I&F disable, Mode: 0x13 - SVC\n\t"		\
-			 "mov     r0, #0x13|0xC0\n\t"			\
-			 "msr     cpsr_c, r0\n\t" : : )
+			 "msr     cpsr_c, %0\n\t" : : "r"(0x13|0xC0))
 
 /* Set program counter with the given value */
 #define set_pc(x) __asm__ __volatile__ ("mov     pc, %0\n\t" : : "r"(x))