diff options
Diffstat (limited to 'kernel/time/timekeeping.c')
-rw-r--r-- | kernel/time/timekeeping.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 15e06defca55..03cbeb34d141 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -847,6 +847,10 @@ unsigned long get_seconds(void) | |||
847 | } | 847 | } |
848 | EXPORT_SYMBOL(get_seconds); | 848 | EXPORT_SYMBOL(get_seconds); |
849 | 849 | ||
850 | struct timespec __current_kernel_time(void) | ||
851 | { | ||
852 | return xtime_cache; | ||
853 | } | ||
850 | 854 | ||
851 | struct timespec current_kernel_time(void) | 855 | struct timespec current_kernel_time(void) |
852 | { | 856 | { |
@@ -862,3 +866,20 @@ struct timespec current_kernel_time(void) | |||
862 | return now; | 866 | return now; |
863 | } | 867 | } |
864 | EXPORT_SYMBOL(current_kernel_time); | 868 | EXPORT_SYMBOL(current_kernel_time); |
869 | |||
870 | struct timespec get_monotonic_coarse(void) | ||
871 | { | ||
872 | struct timespec now, mono; | ||
873 | unsigned long seq; | ||
874 | |||
875 | do { | ||
876 | seq = read_seqbegin(&xtime_lock); | ||
877 | |||
878 | now = xtime_cache; | ||
879 | mono = wall_to_monotonic; | ||
880 | } while (read_seqretry(&xtime_lock, seq)); | ||
881 | |||
882 | set_normalized_timespec(&now, now.tv_sec + mono.tv_sec, | ||
883 | now.tv_nsec + mono.tv_nsec); | ||
884 | return now; | ||
885 | } | ||