summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@kernel.org>2026-05-29 23:00:28 +0300
committerThomas Gleixner <tglx@kernel.org>2026-06-04 12:04:16 +0300
commit6c14771816435a7ecf52d981a341e2de21463268 (patch)
tree1cd15d81bf001f9ef15256340b82aa7832e276b9 /include/linux
parent23c1bfa9f8dbefe0be1fa32aaf235c08cb24bd78 (diff)
downloadlinux-6c14771816435a7ecf52d981a341e2de21463268.tar.xz
timekeeping: Add system_counterval_t to struct system_device_crosststamp
An upcoming extension to the PTP IOCTL requires to return the system counter value and the clocksource ID to user space. get_device_system_crosststamp() has this information already. Extend struct system_device_crosststamp with a system_counterval_t member and fill in the data. Signed-off-by: Thomas Gleixner <tglx@kernel.org> Tested-by: David Woodhouse <dwmw@amazon.co.uk> Tested-by: Arthur Kiyanovski <akiyano@amazon.com> Reviewed-by: David Woodhouse <dwmw@amazon.co.uk> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://patch.msgid.link/20260529195557.429406675@kernel.org
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/timekeeping.h28
1 files changed, 15 insertions, 13 deletions
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h
index eb64c90c4127..3867db65f391 100644
--- a/include/linux/timekeeping.h
+++ b/include/linux/timekeeping.h
@@ -297,19 +297,6 @@ struct system_time_snapshot {
};
/**
- * struct system_device_crosststamp - system/device cross-timestamp
- * (synchronized capture)
- * @device: Device time
- * @sys_realtime: Realtime simultaneous with device time
- * @sys_monoraw: Monotonic raw simultaneous with device time
- */
-struct system_device_crosststamp {
- ktime_t device;
- ktime_t sys_realtime;
- ktime_t sys_monoraw;
-};
-
-/**
* struct system_counterval_t - system counter value with the ID of the
* corresponding clocksource
* @cycles: System counter value
@@ -325,6 +312,21 @@ struct system_counterval_t {
bool use_nsecs;
};
+/**
+ * struct system_device_crosststamp - system/device cross-timestamp
+ * (synchronized capture)
+ * @device: Device time
+ * @sys_counter: Clocksource counter value simultaneous with device time
+ * @sys_realtime: Realtime simultaneous with device time
+ * @sys_monoraw: Monotonic raw simultaneous with device time
+ */
+struct system_device_crosststamp {
+ ktime_t device;
+ struct system_counterval_t sys_counter;
+ ktime_t sys_realtime;
+ ktime_t sys_monoraw;
+};
+
extern bool ktime_real_to_base_clock(ktime_t treal,
enum clocksource_ids base_id, u64 *cycles);
extern bool timekeeping_clocksource_has_base(enum clocksource_ids id);