File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -221,6 +221,24 @@ void read_persistent_clock64(struct timespec64 *ts)
221
221
ext_to_timespec64 (clk , ts );
222
222
}
223
223
224
+ void __init read_persistent_wall_and_boot_offset (struct timespec64 * wall_time ,
225
+ struct timespec64 * boot_offset )
226
+ {
227
+ unsigned char clk [STORE_CLOCK_EXT_SIZE ];
228
+ struct timespec64 boot_time ;
229
+ __u64 delta ;
230
+
231
+ delta = initial_leap_seconds + TOD_UNIX_EPOCH ;
232
+ memcpy (clk , tod_clock_base , STORE_CLOCK_EXT_SIZE );
233
+ * (__u64 * )& clk [1 ] -= delta ;
234
+ if (* (__u64 * )& clk [1 ] > delta )
235
+ clk [0 ]-- ;
236
+ ext_to_timespec64 (clk , & boot_time );
237
+
238
+ read_persistent_clock64 (wall_time );
239
+ * boot_offset = timespec64_sub (* wall_time , boot_time );
240
+ }
241
+
224
242
void read_boot_clock64 (struct timespec64 * ts )
225
243
{
226
244
unsigned char clk [STORE_CLOCK_EXT_SIZE ];
You can’t perform that action at this time.
0 commit comments