aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/timex.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/include/asm/timex.h')
-rw-r--r--arch/s390/include/asm/timex.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/s390/include/asm/timex.h b/arch/s390/include/asm/timex.h
index cc21e3e20fd7..68d9fea34b4b 100644
--- a/arch/s390/include/asm/timex.h
+++ b/arch/s390/include/asm/timex.h
@@ -88,6 +88,28 @@ int get_sync_clock(unsigned long long *clock);
88void init_cpu_timer(void); 88void init_cpu_timer(void);
89unsigned long long monotonic_clock(void); 89unsigned long long monotonic_clock(void);
90 90
91void tod_to_timeval(__u64, struct timespec *);
92
93static inline
94void stck_to_timespec(unsigned long long stck, struct timespec *ts)
95{
96 tod_to_timeval(stck - TOD_UNIX_EPOCH, ts);
97}
98
91extern u64 sched_clock_base_cc; 99extern u64 sched_clock_base_cc;
92 100
101/**
102 * get_clock_monotonic - returns current time in clock rate units
103 *
104 * The caller must ensure that preemption is disabled.
105 * The clock and sched_clock_base get changed via stop_machine.
106 * Therefore preemption must be disabled when calling this
107 * function, otherwise the returned value is not guaranteed to
108 * be monotonic.
109 */
110static inline unsigned long long get_clock_monotonic(void)
111{
112 return get_clock_xt() - sched_clock_base_cc;
113}
114
93#endif 115#endif