From 059b848b8a3b3c849b6677b807331ececb47e662 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Wed, 27 Sep 2023 03:44:36 +0900 Subject: [PATCH] core_arch: Fix ARMv6 CP15 barrier --- .../crates/core_arch/src/arm_shared/barrier/cp15.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/library/stdarch/crates/core_arch/src/arm_shared/barrier/cp15.rs b/library/stdarch/crates/core_arch/src/arm_shared/barrier/cp15.rs index 6faae0fee0ba..fe540a7d8dc7 100644 --- a/library/stdarch/crates/core_arch/src/arm_shared/barrier/cp15.rs +++ b/library/stdarch/crates/core_arch/src/arm_shared/barrier/cp15.rs @@ -11,7 +11,8 @@ impl super::super::sealed::Dmb for SY { #[inline(always)] unsafe fn __dmb(&self) { asm!( - "mcr p15, 0, r0, c7, c10, 5", + "mcr p15, 0, {}, c7, c10, 5", + in(reg) 0_u32, options(preserves_flags, nostack) ) } @@ -21,7 +22,8 @@ impl super::super::sealed::Dsb for SY { #[inline(always)] unsafe fn __dsb(&self) { asm!( - "mcr p15, 0, r0, c7, c10, 4", + "mcr p15, 0, {}, c7, c10, 4", + in(reg) 0_u32, options(preserves_flags, nostack) ) } @@ -31,7 +33,8 @@ impl super::super::sealed::Isb for SY { #[inline(always)] unsafe fn __isb(&self) { asm!( - "mcr p15, 0, r0, c7, c5, 4", + "mcr p15, 0, {}, c7, c5, 4", + in(reg) 0_u32, options(preserves_flags, nostack) ) }