.. | .. |
---|
62 | 62 | #include <linux/types.h> |
---|
63 | 63 | #include <linux/param.h> |
---|
64 | 64 | |
---|
| 65 | +unsigned long random_get_entropy_fallback(void); |
---|
| 66 | + |
---|
65 | 67 | #include <asm/timex.h> |
---|
66 | 68 | |
---|
67 | 69 | #ifndef random_get_entropy |
---|
.. | .. |
---|
74 | 76 | * |
---|
75 | 77 | * By default we use get_cycles() for this purpose, but individual |
---|
76 | 78 | * 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(). |
---|
77 | 81 | */ |
---|
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 |
---|
79 | 87 | #endif |
---|
80 | 88 | |
---|
81 | 89 | /* |
---|
.. | .. |
---|
151 | 159 | #define NTP_INTERVAL_FREQ (HZ) |
---|
152 | 160 | #define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ) |
---|
153 | 161 | |
---|
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 | + |
---|
155 | 165 | extern void hardpps(const struct timespec64 *, const struct timespec64 *); |
---|
156 | 166 | |
---|
157 | 167 | int read_current_timer(unsigned long *timer_val); |
---|