diff options
Diffstat (limited to 'arch/s390/include/asm/timex.h')
-rw-r--r-- | arch/s390/include/asm/timex.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/arch/s390/include/asm/timex.h b/arch/s390/include/asm/timex.h index 8ad8af915032..819b94d22720 100644 --- a/arch/s390/include/asm/timex.h +++ b/arch/s390/include/asm/timex.h | |||
@@ -71,30 +71,30 @@ static inline void local_tick_enable(unsigned long long comp) | |||
71 | 71 | ||
72 | typedef unsigned long long cycles_t; | 72 | typedef unsigned long long cycles_t; |
73 | 73 | ||
74 | static inline unsigned long long get_tod_clock(void) | ||
75 | { | ||
76 | unsigned long long clk; | ||
77 | |||
78 | #ifdef CONFIG_HAVE_MARCH_Z9_109_FEATURES | ||
79 | asm volatile(".insn s,0xb27c0000,%0" : "=Q" (clk) : : "cc"); | ||
80 | #else | ||
81 | asm volatile("stck %0" : "=Q" (clk) : : "cc"); | ||
82 | #endif | ||
83 | return clk; | ||
84 | } | ||
85 | |||
86 | static inline void get_tod_clock_ext(char *clk) | 74 | static inline void get_tod_clock_ext(char *clk) |
87 | { | 75 | { |
88 | asm volatile("stcke %0" : "=Q" (*clk) : : "cc"); | 76 | asm volatile("stcke %0" : "=Q" (*clk) : : "cc"); |
89 | } | 77 | } |
90 | 78 | ||
91 | static inline unsigned long long get_tod_clock_xt(void) | 79 | static inline unsigned long long get_tod_clock(void) |
92 | { | 80 | { |
93 | unsigned char clk[16]; | 81 | unsigned char clk[16]; |
94 | get_tod_clock_ext(clk); | 82 | get_tod_clock_ext(clk); |
95 | return *((unsigned long long *)&clk[1]); | 83 | return *((unsigned long long *)&clk[1]); |
96 | } | 84 | } |
97 | 85 | ||
86 | static inline unsigned long long get_tod_clock_fast(void) | ||
87 | { | ||
88 | #ifdef CONFIG_HAVE_MARCH_Z9_109_FEATURES | ||
89 | unsigned long long clk; | ||
90 | |||
91 | asm volatile("stckf %0" : "=Q" (clk) : : "cc"); | ||
92 | return clk; | ||
93 | #else | ||
94 | return get_tod_clock(); | ||
95 | #endif | ||
96 | } | ||
97 | |||
98 | static inline cycles_t get_cycles(void) | 98 | static inline cycles_t get_cycles(void) |
99 | { | 99 | { |
100 | return (cycles_t) get_tod_clock() >> 2; | 100 | return (cycles_t) get_tod_clock() >> 2; |
@@ -125,7 +125,7 @@ extern u64 sched_clock_base_cc; | |||
125 | */ | 125 | */ |
126 | static inline unsigned long long get_tod_clock_monotonic(void) | 126 | static inline unsigned long long get_tod_clock_monotonic(void) |
127 | { | 127 | { |
128 | return get_tod_clock_xt() - sched_clock_base_cc; | 128 | return get_tod_clock() - sched_clock_base_cc; |
129 | } | 129 | } |
130 | 130 | ||
131 | /** | 131 | /** |