aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Glauber <jan.glauber@de.ibm.com>2008-04-17 01:46:16 -0400
committerHeiko Carstens <heiko.carstens@de.ibm.com>2008-04-17 01:47:02 -0400
commitc0015f91d8414f55d2debfe9984a04b98b48f087 (patch)
tree114cfd865dda4b1c5860391c219a1b34dc74eacb
parent2f7c8bd6dc6540aa3275c0ad9f657401985c00e9 (diff)
[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: Jan Glauber <jan.glauber@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
-rw-r--r--arch/s390/kernel/time.c2
-rw-r--r--include/asm-s390/timex.h12
2 files changed, 8 insertions, 6 deletions
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index cb232c155360..925f9dc0b0a0 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -66,7 +66,7 @@ static u64 xtime_cc;
66 */ 66 */
67unsigned long long sched_clock(void) 67unsigned long long sched_clock(void)
68{ 68{
69 return ((get_clock() - jiffies_timer_cc) * 125) >> 9; 69 return ((get_clock_xt() - jiffies_timer_cc) * 125) >> 9;
70} 70}
71 71
72/* 72/*
diff --git a/include/asm-s390/timex.h b/include/asm-s390/timex.h
index 98229db24314..6dd7eecbb8e4 100644
--- a/include/asm-s390/timex.h
+++ b/include/asm-s390/timex.h
@@ -62,16 +62,18 @@ static inline unsigned long long get_clock (void)
62 return clk; 62 return clk;
63} 63}
64 64
65static inline void get_clock_extended(void *dest) 65static inline unsigned long long get_clock_xt(void)
66{ 66{
67 typedef struct { unsigned long long clk[2]; } __clock_t; 67 unsigned char clk[16];
68 68
69#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) 69#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
70 asm volatile("stcke %0" : "=Q" (*((__clock_t *)dest)) : : "cc"); 70 asm volatile("stcke %0" : "=Q" (clk) : : "cc");
71#else /* __GNUC__ */ 71#else /* __GNUC__ */
72 asm volatile("stcke 0(%1)" : "=m" (*((__clock_t *)dest)) 72 asm volatile("stcke 0(%1)" : "=m" (clk)
73 : "a" ((__clock_t *)dest) : "cc"); 73 : "a" (clk) : "cc");
74#endif /* __GNUC__ */ 74#endif /* __GNUC__ */
75
76 return *((unsigned long long *)&clk[1]);
75} 77}
76 78
77static inline cycles_t get_cycles(void) 79static inline cycles_t get_cycles(void)