aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/timekeeping.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/time/timekeeping.c')
-rw-r--r--kernel/time/timekeeping.c21
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}
848EXPORT_SYMBOL(get_seconds); 848EXPORT_SYMBOL(get_seconds);
849 849
850struct timespec __current_kernel_time(void)
851{
852 return xtime_cache;
853}
850 854
851struct timespec current_kernel_time(void) 855struct 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}
864EXPORT_SYMBOL(current_kernel_time); 868EXPORT_SYMBOL(current_kernel_time);
869
870struct 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}