提交 c0015f91 编写于 作者: J Jan Glauber 提交者: Heiko Carstens

[S390] switch sched_clock to store-clock-extended.

Add get_clock_xt to read an 8 byte clock value using store clock
extended (STCKE) and use get_clock_xt for sched_clock. STCKE should
be faster than STCK on newer machines.
Signed-off-by: NJan Glauber <jan.glauber@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
上级 2f7c8bd6
...@@ -66,7 +66,7 @@ static u64 xtime_cc; ...@@ -66,7 +66,7 @@ static u64 xtime_cc;
*/ */
unsigned long long sched_clock(void) unsigned long long sched_clock(void)
{ {
return ((get_clock() - jiffies_timer_cc) * 125) >> 9; return ((get_clock_xt() - jiffies_timer_cc) * 125) >> 9;
} }
/* /*
......
...@@ -62,16 +62,18 @@ static inline unsigned long long get_clock (void) ...@@ -62,16 +62,18 @@ static inline unsigned long long get_clock (void)
return clk; return clk;
} }
static inline void get_clock_extended(void *dest) static inline unsigned long long get_clock_xt(void)
{ {
typedef struct { unsigned long long clk[2]; } __clock_t; unsigned char clk[16];
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
asm volatile("stcke %0" : "=Q" (*((__clock_t *)dest)) : : "cc"); asm volatile("stcke %0" : "=Q" (clk) : : "cc");
#else /* __GNUC__ */ #else /* __GNUC__ */
asm volatile("stcke 0(%1)" : "=m" (*((__clock_t *)dest)) asm volatile("stcke 0(%1)" : "=m" (clk)
: "a" ((__clock_t *)dest) : "cc"); : "a" (clk) : "cc");
#endif /* __GNUC__ */ #endif /* __GNUC__ */
return *((unsigned long long *)&clk[1]);
} }
static inline cycles_t get_cycles(void) static inline cycles_t get_cycles(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册