hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/include/linux/timex.h
....@@ -62,6 +62,8 @@
6262 #include <linux/types.h>
6363 #include <linux/param.h>
6464
65
+unsigned long random_get_entropy_fallback(void);
66
+
6567 #include <asm/timex.h>
6668
6769 #ifndef random_get_entropy
....@@ -74,8 +76,14 @@
7476 *
7577 * By default we use get_cycles() for this purpose, but individual
7678 * architectures may override this in their asm/timex.h header file.
79
+ * If a given arch does not have get_cycles(), then we fallback to
80
+ * using random_get_entropy_fallback().
7781 */
78
-#define random_get_entropy() get_cycles()
82
+#ifdef get_cycles
83
+#define random_get_entropy() ((unsigned long)get_cycles())
84
+#else
85
+#define random_get_entropy() random_get_entropy_fallback()
86
+#endif
7987 #endif
8088
8189 /*
....@@ -151,7 +159,9 @@
151159 #define NTP_INTERVAL_FREQ (HZ)
152160 #define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ)
153161
154
-extern int do_adjtimex(struct timex *);
162
+extern int do_adjtimex(struct __kernel_timex *);
163
+extern int do_clock_adjtime(const clockid_t which_clock, struct __kernel_timex * ktx);
164
+
155165 extern void hardpps(const struct timespec64 *, const struct timespec64 *);
156166
157167 int read_current_timer(unsigned long *timer_val);