Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1308765
| From | "Christopher S. Hall" <christopher.s.hall@intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v6 3/9] Add correlated clocksource relating aliased auxiliary and system clocks |
| Date | 2016-01-13 20:30 +0100 |
| Message-ID | <qQzhh-48x-23@gated-at.bofh.it> (permalink) |
| References | <qQz7A-44Y-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
ACKNOWLEDGMENT: The original correlated clock source and cross
timestamp code was developed by Thomas Gleixner
<tglx@linutronix.de>. It has changed considerably and any mistakes are
mine.
The timekeeping and clocksource code don't currently comprehend two
clocks that are aliases of one another. That is clocks that are
*exactly* related. The correlated_cs struct encapsulated this
relationship between a clocksource and its alias clock. Modern Intel
hardware provides an Always Running Timer (ART) which is exactly
related to TSC through a known frequency ratio. The ART is an example
of a correlated clocksource.
Signed-off-by: Christopher S. Hall <christopher.s.hall@intel.com>
---
include/linux/clocksource.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 4542293..726ca68 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -267,4 +267,18 @@ struct system_counterval_t {
struct clocksource *cs;
};
+/*
+ * struct correlated_cs - Descriptor for a clocksource correlated to another
+ * clocksource
+ * @related_cs: Pointer to the related timekeeping clocksource
+ * @convert: Conversion function to convert a timestamp from
+ * the correlated clocksource to cycles of the related
+ * timekeeping clocksource
+ */
+struct correlated_cs {
+ struct clocksource *related_cs;
+ cycle_t (*convert)(struct correlated_cs *cs,
+ cycle_t cycles);
+};
+
#endif /* _LINUX_CLOCKSOURCE_H */
--
2.1.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v6 0/9] Patchset enabling hardware based cross-timestamps for next gen Intel platforms "Christopher S. Hall" <christopher.s.hall@intel.com> - 2016-01-13 20:30 +0100
[PATCH v6 3/9] Add correlated clocksource relating aliased auxiliary and system clocks "Christopher S. Hall" <christopher.s.hall@intel.com> - 2016-01-13 20:30 +0100
Re: [PATCH v6 3/9] Add correlated clocksource relating aliased auxiliary and system clocks John Stultz <john.stultz@linaro.org> - 2016-01-15 01:30 +0100
Re: [PATCH v6 0/9] Patchset enabling hardware based cross-timestamps for next gen Intel platforms John Stultz <john.stultz@linaro.org> - 2016-01-15 01:50 +0100
csiph-web