| .. | .. |
|---|
| 159 | 159 | return ktime_to_ns(ktime_get_real()); |
|---|
| 160 | 160 | } |
|---|
| 161 | 161 | |
|---|
| 162 | | -static inline u64 ktime_get_boot_ns(void) |
|---|
| 162 | +static inline u64 ktime_get_boottime_ns(void) |
|---|
| 163 | 163 | { |
|---|
| 164 | 164 | return ktime_to_ns(ktime_get_boottime()); |
|---|
| 165 | 165 | } |
|---|
| 166 | 166 | |
|---|
| 167 | | -static inline u64 ktime_get_tai_ns(void) |
|---|
| 167 | +static inline u64 ktime_get_clocktai_ns(void) |
|---|
| 168 | 168 | { |
|---|
| 169 | 169 | return ktime_to_ns(ktime_get_clocktai()); |
|---|
| 170 | 170 | } |
|---|
| .. | .. |
|---|
| 223 | 223 | extern void timekeeping_inject_sleeptime64(const struct timespec64 *delta); |
|---|
| 224 | 224 | |
|---|
| 225 | 225 | /* |
|---|
| 226 | + * struct ktime_timestanps - Simultaneous mono/boot/real timestamps |
|---|
| 227 | + * @mono: Monotonic timestamp |
|---|
| 228 | + * @boot: Boottime timestamp |
|---|
| 229 | + * @real: Realtime timestamp |
|---|
| 230 | + */ |
|---|
| 231 | +struct ktime_timestamps { |
|---|
| 232 | + u64 mono; |
|---|
| 233 | + u64 boot; |
|---|
| 234 | + u64 real; |
|---|
| 235 | +}; |
|---|
| 236 | + |
|---|
| 237 | +/** |
|---|
| 226 | 238 | * struct system_time_snapshot - simultaneous raw/real time capture with |
|---|
| 227 | | - * counter value |
|---|
| 239 | + * counter value |
|---|
| 228 | 240 | * @cycles: Clocksource counter value to produce the system times |
|---|
| 229 | 241 | * @real: Realtime system time |
|---|
| 230 | 242 | * @raw: Monotonic raw system time |
|---|
| .. | .. |
|---|
| 239 | 251 | u8 cs_was_changed_seq; |
|---|
| 240 | 252 | }; |
|---|
| 241 | 253 | |
|---|
| 242 | | -/* |
|---|
| 254 | +/** |
|---|
| 243 | 255 | * struct system_device_crosststamp - system/device cross-timestamp |
|---|
| 244 | | - * (syncronized capture) |
|---|
| 256 | + * (synchronized capture) |
|---|
| 245 | 257 | * @device: Device time |
|---|
| 246 | 258 | * @sys_realtime: Realtime simultaneous with device time |
|---|
| 247 | 259 | * @sys_monoraw: Monotonic raw simultaneous with device time |
|---|
| .. | .. |
|---|
| 252 | 264 | ktime_t sys_monoraw; |
|---|
| 253 | 265 | }; |
|---|
| 254 | 266 | |
|---|
| 255 | | -/* |
|---|
| 267 | +/** |
|---|
| 256 | 268 | * struct system_counterval_t - system counter value with the pointer to the |
|---|
| 257 | | - * corresponding clocksource |
|---|
| 269 | + * corresponding clocksource |
|---|
| 258 | 270 | * @cycles: System counter value |
|---|
| 259 | 271 | * @cs: Clocksource corresponding to system counter value. Used by |
|---|
| 260 | | - * timekeeping code to verify comparibility of two cycle values |
|---|
| 272 | + * timekeeping code to verify comparibility of two cycle values |
|---|
| 261 | 273 | */ |
|---|
| 262 | 274 | struct system_counterval_t { |
|---|
| 263 | 275 | u64 cycles; |
|---|
| .. | .. |
|---|
| 280 | 292 | */ |
|---|
| 281 | 293 | extern void ktime_get_snapshot(struct system_time_snapshot *systime_snapshot); |
|---|
| 282 | 294 | |
|---|
| 295 | +/* NMI safe mono/boot/realtime timestamps */ |
|---|
| 296 | +extern void ktime_get_fast_timestamps(struct ktime_timestamps *snap); |
|---|
| 297 | + |
|---|
| 283 | 298 | /* |
|---|
| 284 | 299 | * Persistent clock related interfaces |
|---|
| 285 | 300 | */ |
|---|
| .. | .. |
|---|
| 289 | 304 | void read_persistent_wall_and_boot_offset(struct timespec64 *wall_clock, |
|---|
| 290 | 305 | struct timespec64 *boot_offset); |
|---|
| 291 | 306 | extern int update_persistent_clock64(struct timespec64 now); |
|---|
| 292 | | - |
|---|
| 293 | | -/* |
|---|
| 294 | | - * deprecated aliases, don't use in new code |
|---|
| 295 | | - */ |
|---|
| 296 | | -#define getnstimeofday64(ts) ktime_get_real_ts64(ts) |
|---|
| 297 | | -#define get_monotonic_boottime64(ts) ktime_get_boottime_ts64(ts) |
|---|
| 298 | | -#define getrawmonotonic64(ts) ktime_get_raw_ts64(ts) |
|---|
| 299 | | -#define timekeeping_clocktai64(ts) ktime_get_clocktai_ts64(ts) |
|---|
| 300 | | - |
|---|
| 301 | | -static inline struct timespec64 current_kernel_time64(void) |
|---|
| 302 | | -{ |
|---|
| 303 | | - struct timespec64 ts; |
|---|
| 304 | | - |
|---|
| 305 | | - ktime_get_coarse_real_ts64(&ts); |
|---|
| 306 | | - |
|---|
| 307 | | - return ts; |
|---|
| 308 | | -} |
|---|
| 309 | | - |
|---|
| 310 | | -static inline struct timespec64 get_monotonic_coarse64(void) |
|---|
| 311 | | -{ |
|---|
| 312 | | - struct timespec64 ts; |
|---|
| 313 | | - |
|---|
| 314 | | - ktime_get_coarse_ts64(&ts); |
|---|
| 315 | | - |
|---|
| 316 | | - return ts; |
|---|
| 317 | | -} |
|---|
| 318 | 307 | |
|---|
| 319 | 308 | #endif |
|---|