Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
[firefly-linux-kernel-4.4.55.git] / arch / s390 / include / asm / timex.h
index a07e699bb65c58a8e90be04132fedbcfef7e2d9d..68d9fea34b4bdf4fb212b11c6e148bf8527e254e 100644 (file)
@@ -98,4 +98,18 @@ void stck_to_timespec(unsigned long long stck, struct timespec *ts)
 
 extern u64 sched_clock_base_cc;
 
+/**
+ * get_clock_monotonic - returns current time in clock rate units
+ *
+ * The caller must ensure that preemption is disabled.
+ * The clock and sched_clock_base get changed via stop_machine.
+ * Therefore preemption must be disabled when calling this
+ * function, otherwise the returned value is not guaranteed to
+ * be monotonic.
+ */
+static inline unsigned long long get_clock_monotonic(void)
+{
+       return get_clock_xt() - sched_clock_base_cc;
+}
+
 #endif