[PATCH 1/8] ARM: add missing volatile in get_cr()

Sascha Hauer s.hauer at pengutronix.de
Mon Aug 8 02:46:36 EDT 2011


Without it, the compiler optimizes away subsequent reads of the
control register.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 arch/arm/include/asm/system.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 77d6305..1d67492 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -59,7 +59,7 @@
 static inline unsigned int get_cr(void)
 {
 	unsigned int val;
-	asm("mrc p15, 0, %0, c1, c0, 0  @ get CR" : "=r" (val) : : "cc");
+	asm volatile ("mrc p15, 0, %0, c1, c0, 0  @ get CR" : "=r" (val) : : "cc");
 	return val;
 }
 
-- 
1.7.5.4




More information about the barebox mailing list