diff options
Diffstat (limited to 'arch/s390/include/asm/timex.h')
-rw-r--r-- | arch/s390/include/asm/timex.h | 22 |
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); | |||
88 | void init_cpu_timer(void); | 88 | void init_cpu_timer(void); |
89 | unsigned long long monotonic_clock(void); | 89 | unsigned long long monotonic_clock(void); |
90 | 90 | ||
91 | void tod_to_timeval(__u64, struct timespec *); | ||
92 | |||
93 | static inline | ||
94 | void stck_to_timespec(unsigned long long stck, struct timespec *ts) | ||
95 | { | ||
96 | tod_to_timeval(stck - TOD_UNIX_EPOCH, ts); | ||
97 | } | ||
98 | |||
91 | extern u64 sched_clock_base_cc; | 99 | extern 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 | */ | ||
110 | static inline unsigned long long get_clock_monotonic(void) | ||
111 | { | ||
112 | return get_clock_xt() - sched_clock_base_cc; | ||
113 | } | ||
114 | |||
93 | #endif | 115 | #endif |