s390/timex: Move union tod_clock type to separate header

Move union tod_clock type to separate header file. This is preparation
for upcoming changes in order to avoid header dependency problems.

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Acked-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
This commit is contained in:
Heiko Carstens 2026-05-13 16:01:26 +02:00 committed by Alexander Gordeev
parent a53fcff8fc
commit fe47b8b1c0
2 changed files with 31 additions and 19 deletions

View File

@ -12,6 +12,7 @@
#include <linux/preempt.h>
#include <linux/time64.h>
#include <asm/tod_types.h>
#include <asm/lowcore.h>
#include <asm/machine.h>
#include <asm/asm.h>
@ -21,25 +22,6 @@
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)
{

View File

@ -0,0 +1,30 @@
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_S390_TOD_TYPES_H
#define _ASM_S390_TOD_TYPES_H
#include <linux/types.h>
#ifndef __ASSEMBLER__
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;
#endif
#endif