Skip to contentSkip to conversation

s390: get_clock inline assembly.

PATCH In review Martin Schwidefsky 1 participant 1 message Jul 18, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 4/6 s390: get_clock inline assembly.

From: Andreas Krebbel <[email protected]>

[S390] get_clock inline assembly.

Add missing volatile to the get_clock / get_cycles inline assemblies to avoid that consecutive calls get optimized away.

---

 include/asm-s390/timex.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
include/asm-s390/timex.h +2 -2
diff -urpN linux-2.6/include/asm-s390/timex.h linux-2.6-patched/include/asm-s390/timex.h
@@ -19,7 +19,7 @@ static inline cycles_t get_cycles(void)
 {
 	cycles_t cycles;
 
-	__asm__("stck 0(%1)" : "=m" (cycles) : "a" (&cycles) : "cc");
+	__asm__ __volatile__ ("stck 0(%1)" : "=m" (cycles) : "a" (&cycles) : "cc");
 	return cycles >> 2;
 }
 
@@ -27,7 +27,7 @@ static inline unsigned long long get_clo
 {
 	unsigned long long clk;
 
-	__asm__("stck 0(%1)" : "=m" (clk) : "a" (&clk) : "cc");
+	__asm__ __volatile__ ("stck 0(%1)" : "=m" (clk) : "a" (&clk) : "cc");
 	return clk;
 }