diff options
Diffstat (limited to 'kernel/time')
-rw-r--r-- | kernel/time/timekeeping.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 88c81026e003..07a3f1420c27 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -509,3 +509,19 @@ void monotonic_to_bootbased(struct timespec *ts) | |||
509 | { | 509 | { |
510 | ts->tv_sec += total_sleep_time; | 510 | ts->tv_sec += total_sleep_time; |
511 | } | 511 | } |
512 | |||
513 | struct timespec current_kernel_time(void) | ||
514 | { | ||
515 | struct timespec now; | ||
516 | unsigned long seq; | ||
517 | |||
518 | do { | ||
519 | seq = read_seqbegin(&xtime_lock); | ||
520 | |||
521 | now = xtime; | ||
522 | } while (read_seqretry(&xtime_lock, seq)); | ||
523 | |||
524 | return now; | ||
525 | } | ||
526 | |||
527 | EXPORT_SYMBOL(current_kernel_time); | ||