aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/timex.h
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2021-02-08 16:19:27 +0100
committerVasily Gorbik <gor@linux.ibm.com>2021-02-13 17:17:55 +0100
commit7ef37dd7bb00b94e027f63ef626a3a1c58474da9 (patch)
tree68ffc56317c142e8ff249ae27a74bc5cfb1c06b4 /arch/s390/include/asm/timex.h
parents390/crypto: use store_tod_clock_ext() (diff)
downloadlinux-dev-7ef37dd7bb00b94e027f63ef626a3a1c58474da9.tar.xz
linux-dev-7ef37dd7bb00b94e027f63ef626a3a1c58474da9.zip
s390/time: remove get_tod_clock_ext()
Remove get_tod_clock_ext() and the STORE_CLOCK_EXT_SIZE define. This enforces all users of the existing low level functions to use a union tod_clock. This way there is now a compile time check for the correct time and therefore also if the size of the argument matches what will be written to by the STORE CLOCK EXTENDED instruction. Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/timex.h')
-rw-r--r--arch/s390/include/asm/timex.h15
1 files changed, 3 insertions, 12 deletions
diff --git a/arch/s390/include/asm/timex.h b/arch/s390/include/asm/timex.h
index dbd7b44bc9da..c4e23e925665 100644
--- a/arch/s390/include/asm/timex.h
+++ b/arch/s390/include/asm/timex.h
@@ -17,8 +17,6 @@
/* The value of the TOD clock for 1.1.1970. */
#define TOD_UNIX_EPOCH 0x7d91048bca000000ULL
-#define STORE_CLOCK_EXT_SIZE 16 /* stcke writes 16 bytes */
-
extern u64 clock_comparator_max;
union tod_clock {
@@ -173,19 +171,12 @@ static inline void local_tick_enable(unsigned long long comp)
typedef unsigned long long cycles_t;
-static inline void get_tod_clock_ext(char *clk)
-{
- typedef struct { char _[STORE_CLOCK_EXT_SIZE]; } addrtype;
-
- asm volatile("stcke %0" : "=Q" (*(addrtype *) clk) : : "cc");
-}
-
static inline unsigned long long get_tod_clock(void)
{
- char clk[STORE_CLOCK_EXT_SIZE];
+ union tod_clock clk;
- get_tod_clock_ext(clk);
- return *((unsigned long long *)&clk[1]);
+ store_tod_clock_ext(&clk);
+ return clk.tod;
}
static inline unsigned long long get_tod_clock_fast(void)