|
@@ -137,18 +137,40 @@ extern u64 ktime_get_boot_fast_ns(void);
|
|
|
extern u64 ktime_get_real_fast_ns(void);
|
|
|
|
|
|
/*
|
|
|
- * timespec64 interfaces utilizing the ktime based ones
|
|
|
+ * timespec64/time64_t interfaces utilizing the ktime based ones
|
|
|
+ * for API completeness, these could be implemented more efficiently
|
|
|
+ * if needed.
|
|
|
*/
|
|
|
static inline void ktime_get_boottime_ts64(struct timespec64 *ts)
|
|
|
{
|
|
|
*ts = ktime_to_timespec64(ktime_get_boottime());
|
|
|
}
|
|
|
|
|
|
+static inline void ktime_get_coarse_boottime_ts64(struct timespec64 *ts)
|
|
|
+{
|
|
|
+ *ts = ktime_to_timespec64(ktime_get_coarse_boottime());
|
|
|
+}
|
|
|
+
|
|
|
+static inline time64_t ktime_get_boottime_seconds(void)
|
|
|
+{
|
|
|
+ return ktime_divns(ktime_get_coarse_boottime(), NSEC_PER_SEC);
|
|
|
+}
|
|
|
+
|
|
|
static inline void ktime_get_clocktai_ts64(struct timespec64 *ts)
|
|
|
{
|
|
|
*ts = ktime_to_timespec64(ktime_get_clocktai());
|
|
|
}
|
|
|
|
|
|
+static inline void ktime_get_coarse_clocktai_ts64(struct timespec64 *ts)
|
|
|
+{
|
|
|
+ *ts = ktime_to_timespec64(ktime_get_coarse_clocktai());
|
|
|
+}
|
|
|
+
|
|
|
+static inline time64_t ktime_get_clocktai_seconds(void)
|
|
|
+{
|
|
|
+ return ktime_divns(ktime_get_coarse_clocktai(), NSEC_PER_SEC);
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
* RTC specific
|
|
|
*/
|