This patch introduces time keeping variables to track the nextOne other thing, I'd rather you break this patch set up logically as:
mini-epoch between the UTC and TAI timescales. A leap second occurs
one second before a mini-epoch. When no leap second is pending, then
the epoch is set to the far future, LONG_MAX.
This code will become useful later on for providing correct time
surrounding a leap second.
Signed-off-by: Richard Cochran<richardcochran@xxxxxxxxx>
---
kernel/time/timekeeping.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index d66b213..ac04de4 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -70,6 +70,19 @@ struct timekeeper {
/* The raw monotonic time for the CLOCK_MONOTONIC_RAW posix clock. */
struct timespec raw_time;
+ /* The current TAI - UTC offset */
+ time_t tai_offset;
+ /* The UTC time of the next leap second epoch */
+ time_t utc_epoch;
+ /* Tracks where we stand with regard to leap the second epoch. */
+ enum {
+ LEAP_IDLE,
+ LEAP_INS_PENDING,
+ LEAP_INS_DONE,
+ LEAP_DEL_PENDING,
+ LEAP_DEL_DONE,
+ } leap_state;
+