aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/timex.h
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2021-02-07 22:00:22 +0100
committerVasily Gorbik <gor@linux.ibm.com>2021-02-13 17:17:54 +0100
commite4101be56c85effa4509b35a208482f888e79cfc (patch)
treed599ea3db0647ffa92468dcffc19e6fc735d529e /arch/s390/include/asm/timex.h
parents390,alpha: switch to 64-bit ino_t (diff)
downloadlinux-dev-e4101be56c85effa4509b35a208482f888e79cfc.tar.xz
linux-dev-e4101be56c85effa4509b35a208482f888e79cfc.zip
s390/time: introduce union tod_clock
Introduce union tod_clock which is supposed to be used to decode and access various fields of the result of STORE CLOCK EXTENDED. 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.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/s390/include/asm/timex.h b/arch/s390/include/asm/timex.h
index 63bf3bd6e83f..271a1e12cc73 100644
--- a/arch/s390/include/asm/timex.h
+++ b/arch/s390/include/asm/timex.h
@@ -21,6 +21,25 @@
extern u64 clock_comparator_max;
+union tod_clock {
+ __uint128_t val;
+ struct {
+ __uint128_t ei : 8; /* epoch index */
+ __uint128_t tod : 64; /* bits 0-63 of tod clock */
+ __uint128_t : 40;
+ __uint128_t pf : 16; /* programmable field */
+ };
+ struct {
+ __uint128_t eitod : 72; /* epoch index + bits 0-63 tod clock */
+ __uint128_t : 56;
+ };
+ struct {
+ __uint128_t us : 60; /* micro-seconds */
+ __uint128_t sus : 12; /* sub-microseconds */
+ __uint128_t : 56;
+ };
+} __packed;
+
/* Inline functions for clock register access. */
static inline int set_tod_clock(__u64 time)
{