1commit 36bde5e96ff85d2c13436014a738d11611178fc9 2Author: zhaoxc0502 <zhaoxc0502@thundersoft.com> 3Date: Thu Jun 16 17:14:03 2022 +0800 4 5 linux_kernel 6 7 Change-Id: I86d70a3d88e61dd224c878c5c9c33defffaf0102 8 9diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c 10index cc4dc2857..917c0993b 100644 11--- a/kernel/time/timekeeping.c 12+++ b/kernel/time/timekeeping.c 13@@ -1288,6 +1288,22 @@ int get_device_system_crosststamp(int (*get_time_fn) 14 } 15 EXPORT_SYMBOL_GPL(get_device_system_crosststamp); 16 17+/** 18+ * do_gettimeofday - Returns the time of day in a timeval 19+ * @tv: pointer to the timeval to be set 20+ * 21+ * NOTE: Users should be converted to using getnstimeofday() 22+ */ 23+void do_gettimeofday(struct old_timeval32 *tv) 24+{ 25+ struct timespec64 now; 26+ 27+ ktime_get_real_ts64(&now); 28+ tv->tv_sec = now.tv_sec; 29+ tv->tv_usec = now.tv_nsec/1000; 30+} 31+EXPORT_SYMBOL(do_gettimeofday); 32+ 33 /** 34 * do_settimeofday64 - Sets the time of day. 35 * @ts: pointer to the timespec64 variable containing the new time 36