From 99140b4e1213aad44726e8e42d92e19cecea45f0 Mon Sep 17 00:00:00 2001 From: Jan Glauber Date: Mon, 24 Oct 2011 11:47:53 +0200 Subject: [PATCH] [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 Signed-off-by: Martin Schwidefsky --- arch/s390/include/asm/timex.h | 11 +++++++++++ 1 file changed, 11 insertions(+) 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) asm volatile("stcke %0" : "=Q" (*clk) : : "cc"); } +static inline unsigned long long get_clock_fast(void) +{ + unsigned long long clk; + + if (test_facility(25)) + asm volatile(".insn s,0xb27c0000,%0" : "=Q" (clk) : : "cc"); + else + clk = get_clock(); + return clk; +} + static inline unsigned long long get_clock_xt(void) { unsigned char clk[16]; -- 2.39.5