Merge branches 'work.misc' and 'work.dcache' of git://git.kernel.org/pub/scm/linux...
[sfrench/cifs-2.6.git] / arch / s390 / kernel / time.c
index cf561160ea887f9b6395e1d5ec30f9ee02aba77d..e8766beee5ad86c3a6ed212ef9d1b91e6e4578f4 100644 (file)
@@ -221,17 +221,22 @@ void read_persistent_clock64(struct timespec64 *ts)
        ext_to_timespec64(clk, ts);
 }
 
-void read_boot_clock64(struct timespec64 *ts)
+void __init read_persistent_wall_and_boot_offset(struct timespec64 *wall_time,
+                                                struct timespec64 *boot_offset)
 {
        unsigned char clk[STORE_CLOCK_EXT_SIZE];
+       struct timespec64 boot_time;
        __u64 delta;
 
        delta = initial_leap_seconds + TOD_UNIX_EPOCH;
-       memcpy(clk, tod_clock_base, 16);
-       *(__u64 *) &clk[1] -= delta;
-       if (*(__u64 *) &clk[1] > delta)
+       memcpy(clk, tod_clock_base, STORE_CLOCK_EXT_SIZE);
+       *(__u64 *)&clk[1] -= delta;
+       if (*(__u64 *)&clk[1] > delta)
                clk[0]--;
-       ext_to_timespec64(clk, ts);
+       ext_to_timespec64(clk, &boot_time);
+
+       read_persistent_clock64(wall_time);
+       *boot_offset = timespec64_sub(*wall_time, boot_time);
 }
 
 static u64 read_tod_clock(struct clocksource *cs)