Skip to content

Commit

Permalink
[S390] get_clock inline assembly.
Browse files Browse the repository at this point in the history
Add missing volatile to the get_clock / get_cycles inline assemblies
to avoid that consecutive calls get optimized away.

Signed-off-by: Andreas Krebbel <krebbel1@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Andreas Krebbel authored and Martin Schwidefsky committed Jul 17, 2006
1 parent 13ffa92 commit 53ba5e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/asm-s390/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ 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;
}

static inline unsigned long long get_clock (void)
{
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;
}

Expand Down

0 comments on commit 53ba5e0

Please sign in to comment.