diff options
author | Jan Glauber <jang@linux.vnet.ibm.com> | 2011-10-30 10:17:04 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2011-10-30 10:16:45 -0400 |
commit | 80376f347d70ce5fcfb98105d83624518e0911d6 (patch) | |
tree | 9592c2968b21812d1ad1a200af70e959fb74d463 /arch/s390 | |
parent | 388186bc920d9200202e4d25de66fa95b1b8fc68 (diff) |
[S390] Introduce get_clock_fast()
Add get_clock_fast() which uses the slightly faster stckf if available.
If stckf is not available fall back to stck, which has the same width.
Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/include/asm/timex.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/s390/include/asm/timex.h b/arch/s390/include/asm/timex.h index 88829a40af6f..d610bef9c5e9 100644 --- a/arch/s390/include/asm/timex.h +++ b/arch/s390/include/asm/timex.h | |||
@@ -86,6 +86,17 @@ static inline void get_clock_ext(char *clk) | |||
86 | asm volatile("stcke %0" : "=Q" (*clk) : : "cc"); | 86 | asm volatile("stcke %0" : "=Q" (*clk) : : "cc"); |
87 | } | 87 | } |
88 | 88 | ||
89 | static inline unsigned long long get_clock_fast(void) | ||
90 | { | ||
91 | unsigned long long clk; | ||
92 | |||
93 | if (test_facility(25)) | ||
94 | asm volatile(".insn s,0xb27c0000,%0" : "=Q" (clk) : : "cc"); | ||
95 | else | ||
96 | clk = get_clock(); | ||
97 | return clk; | ||
98 | } | ||
99 | |||
89 | static inline unsigned long long get_clock_xt(void) | 100 | static inline unsigned long long get_clock_xt(void) |
90 | { | 101 | { |
91 | unsigned char clk[16]; | 102 | unsigned char clk[16]; |