| .. | .. |
|---|
| 48 | 48 | } |
|---|
| 49 | 49 | |
|---|
| 50 | 50 | static notrace long clock_gettime_fallback(clockid_t _clkid, |
|---|
| 51 | | - struct timespec *_ts) |
|---|
| 51 | + struct __kernel_old_timespec *_ts) |
|---|
| 52 | 52 | { |
|---|
| 53 | | - register struct timespec *ts asm("$r1") = _ts; |
|---|
| 53 | + register struct __kernel_old_timespec *ts asm("$r1") = _ts; |
|---|
| 54 | 54 | register clockid_t clkid asm("$r0") = _clkid; |
|---|
| 55 | 55 | register long ret asm("$r0"); |
|---|
| 56 | 56 | |
|---|
| .. | .. |
|---|
| 63 | 63 | return ret; |
|---|
| 64 | 64 | } |
|---|
| 65 | 65 | |
|---|
| 66 | | -static notrace int do_realtime_coarse(struct timespec *ts, |
|---|
| 66 | +static notrace int do_realtime_coarse(struct __kernel_old_timespec *ts, |
|---|
| 67 | 67 | struct vdso_data *vdata) |
|---|
| 68 | 68 | { |
|---|
| 69 | 69 | u32 seq; |
|---|
| .. | .. |
|---|
| 78 | 78 | return 0; |
|---|
| 79 | 79 | } |
|---|
| 80 | 80 | |
|---|
| 81 | | -static notrace int do_monotonic_coarse(struct timespec *ts, |
|---|
| 81 | +static notrace int do_monotonic_coarse(struct __kernel_old_timespec *ts, |
|---|
| 82 | 82 | struct vdso_data *vdata) |
|---|
| 83 | 83 | { |
|---|
| 84 | | - struct timespec tomono; |
|---|
| 85 | 84 | u32 seq; |
|---|
| 85 | + u64 ns; |
|---|
| 86 | 86 | |
|---|
| 87 | 87 | do { |
|---|
| 88 | 88 | seq = vdso_read_begin(vdata); |
|---|
| 89 | 89 | |
|---|
| 90 | | - ts->tv_sec = vdata->xtime_coarse_sec; |
|---|
| 91 | | - ts->tv_nsec = vdata->xtime_coarse_nsec; |
|---|
| 92 | | - |
|---|
| 93 | | - tomono.tv_sec = vdata->wtm_clock_sec; |
|---|
| 94 | | - tomono.tv_nsec = vdata->wtm_clock_nsec; |
|---|
| 90 | + ts->tv_sec = vdata->xtime_coarse_sec + vdata->wtm_clock_sec; |
|---|
| 91 | + ns = vdata->xtime_coarse_nsec + vdata->wtm_clock_nsec; |
|---|
| 95 | 92 | |
|---|
| 96 | 93 | } while (vdso_read_retry(vdata, seq)); |
|---|
| 97 | 94 | |
|---|
| 98 | | - ts->tv_sec += tomono.tv_sec; |
|---|
| 99 | | - timespec_add_ns(ts, tomono.tv_nsec); |
|---|
| 95 | + ts->tv_sec += __iter_div_u64_rem(ns, NSEC_PER_SEC, &ns); |
|---|
| 96 | + ts->tv_nsec = ns; |
|---|
| 97 | + |
|---|
| 100 | 98 | return 0; |
|---|
| 101 | 99 | } |
|---|
| 102 | 100 | |
|---|
| .. | .. |
|---|
| 115 | 113 | return ((u64) cycle_delta & vdso->cs_mask) * vdso->cs_mult; |
|---|
| 116 | 114 | } |
|---|
| 117 | 115 | |
|---|
| 118 | | -static notrace int do_realtime(struct timespec *ts, struct vdso_data *vdata) |
|---|
| 116 | +static notrace int do_realtime(struct __kernel_old_timespec *ts, struct vdso_data *vdata) |
|---|
| 119 | 117 | { |
|---|
| 120 | 118 | unsigned count; |
|---|
| 121 | 119 | u64 ns; |
|---|
| .. | .. |
|---|
| 133 | 131 | return 0; |
|---|
| 134 | 132 | } |
|---|
| 135 | 133 | |
|---|
| 136 | | -static notrace int do_monotonic(struct timespec *ts, struct vdso_data *vdata) |
|---|
| 134 | +static notrace int do_monotonic(struct __kernel_old_timespec *ts, struct vdso_data *vdata) |
|---|
| 137 | 135 | { |
|---|
| 138 | | - struct timespec tomono; |
|---|
| 139 | | - u64 nsecs; |
|---|
| 136 | + u64 ns; |
|---|
| 140 | 137 | u32 seq; |
|---|
| 141 | 138 | |
|---|
| 142 | 139 | do { |
|---|
| 143 | 140 | seq = vdso_read_begin(vdata); |
|---|
| 144 | 141 | |
|---|
| 145 | 142 | ts->tv_sec = vdata->xtime_clock_sec; |
|---|
| 146 | | - nsecs = vdata->xtime_clock_nsec; |
|---|
| 147 | | - nsecs += vgetsns(vdata); |
|---|
| 148 | | - nsecs >>= vdata->cs_shift; |
|---|
| 143 | + ns = vdata->xtime_clock_nsec; |
|---|
| 144 | + ns += vgetsns(vdata); |
|---|
| 145 | + ns >>= vdata->cs_shift; |
|---|
| 149 | 146 | |
|---|
| 150 | | - tomono.tv_sec = vdata->wtm_clock_sec; |
|---|
| 151 | | - tomono.tv_nsec = vdata->wtm_clock_nsec; |
|---|
| 147 | + ts->tv_sec += vdata->wtm_clock_sec; |
|---|
| 148 | + ns += vdata->wtm_clock_nsec; |
|---|
| 152 | 149 | |
|---|
| 153 | 150 | } while (vdso_read_retry(vdata, seq)); |
|---|
| 154 | 151 | |
|---|
| 155 | | - ts->tv_sec += tomono.tv_sec; |
|---|
| 156 | | - ts->tv_nsec = 0; |
|---|
| 157 | | - timespec_add_ns(ts, nsecs + tomono.tv_nsec); |
|---|
| 152 | + ts->tv_sec += __iter_div_u64_rem(ns, NSEC_PER_SEC, &ns); |
|---|
| 153 | + ts->tv_nsec = ns; |
|---|
| 154 | + |
|---|
| 158 | 155 | return 0; |
|---|
| 159 | 156 | } |
|---|
| 160 | 157 | |
|---|
| 161 | | -notrace int __vdso_clock_gettime(clockid_t clkid, struct timespec *ts) |
|---|
| 158 | +notrace int __vdso_clock_gettime(clockid_t clkid, struct __kernel_old_timespec *ts) |
|---|
| 162 | 159 | { |
|---|
| 163 | 160 | struct vdso_data *vdata; |
|---|
| 164 | 161 | int ret = -1; |
|---|
| .. | .. |
|---|
| 191 | 188 | } |
|---|
| 192 | 189 | |
|---|
| 193 | 190 | static notrace int clock_getres_fallback(clockid_t _clk_id, |
|---|
| 194 | | - struct timespec *_res) |
|---|
| 191 | + struct __kernel_old_timespec *_res) |
|---|
| 195 | 192 | { |
|---|
| 196 | 193 | register clockid_t clk_id asm("$r0") = _clk_id; |
|---|
| 197 | | - register struct timespec *res asm("$r1") = _res; |
|---|
| 194 | + register struct __kernel_old_timespec *res asm("$r1") = _res; |
|---|
| 198 | 195 | register int ret asm("$r0"); |
|---|
| 199 | 196 | |
|---|
| 200 | 197 | asm volatile ("movi $r15, %3\n" |
|---|
| .. | .. |
|---|
| 206 | 203 | return ret; |
|---|
| 207 | 204 | } |
|---|
| 208 | 205 | |
|---|
| 209 | | -notrace int __vdso_clock_getres(clockid_t clk_id, struct timespec *res) |
|---|
| 206 | +notrace int __vdso_clock_getres(clockid_t clk_id, struct __kernel_old_timespec *res) |
|---|
| 210 | 207 | { |
|---|
| 211 | 208 | struct vdso_data *vdata = __get_datapage(); |
|---|
| 212 | 209 | |
|---|
| .. | .. |
|---|
| 230 | 227 | return 0; |
|---|
| 231 | 228 | } |
|---|
| 232 | 229 | |
|---|
| 233 | | -static notrace inline int gettimeofday_fallback(struct timeval *_tv, |
|---|
| 230 | +static notrace inline int gettimeofday_fallback(struct __kernel_old_timeval *_tv, |
|---|
| 234 | 231 | struct timezone *_tz) |
|---|
| 235 | 232 | { |
|---|
| 236 | | - register struct timeval *tv asm("$r0") = _tv; |
|---|
| 233 | + register struct __kernel_old_timeval *tv asm("$r0") = _tv; |
|---|
| 237 | 234 | register struct timezone *tz asm("$r1") = _tz; |
|---|
| 238 | 235 | register int ret asm("$r0"); |
|---|
| 239 | 236 | |
|---|
| .. | .. |
|---|
| 246 | 243 | return ret; |
|---|
| 247 | 244 | } |
|---|
| 248 | 245 | |
|---|
| 249 | | -notrace int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz) |
|---|
| 246 | +notrace int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz) |
|---|
| 250 | 247 | { |
|---|
| 251 | | - struct timespec ts; |
|---|
| 248 | + struct __kernel_old_timespec ts; |
|---|
| 252 | 249 | struct vdso_data *vdata; |
|---|
| 253 | 250 | int ret; |
|---|
| 254 | 251 | |
|---|