diff options
Diffstat (limited to 'kernel/time/timekeeping.c')
-rw-r--r-- | kernel/time/timekeeping.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index b53da5ecbea2..5d76e09ddd3d 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -184,18 +184,6 @@ static void timekeeping_update(bool clearntp) | |||
184 | } | 184 | } |
185 | 185 | ||
186 | 186 | ||
187 | void timekeeping_leap_insert(int leapsecond) | ||
188 | { | ||
189 | unsigned long flags; | ||
190 | |||
191 | write_seqlock_irqsave(&timekeeper.lock, flags); | ||
192 | timekeeper.xtime.tv_sec += leapsecond; | ||
193 | timekeeper.wall_to_monotonic.tv_sec -= leapsecond; | ||
194 | timekeeping_update(false); | ||
195 | write_sequnlock_irqrestore(&timekeeper.lock, flags); | ||
196 | |||
197 | } | ||
198 | |||
199 | /** | 187 | /** |
200 | * timekeeping_forward_now - update clock to the current time | 188 | * timekeeping_forward_now - update clock to the current time |
201 | * | 189 | * |
@@ -969,9 +957,11 @@ static cycle_t logarithmic_accumulation(cycle_t offset, int shift) | |||
969 | 957 | ||
970 | timekeeper.xtime_nsec += timekeeper.xtime_interval << shift; | 958 | timekeeper.xtime_nsec += timekeeper.xtime_interval << shift; |
971 | while (timekeeper.xtime_nsec >= nsecps) { | 959 | while (timekeeper.xtime_nsec >= nsecps) { |
960 | int leap; | ||
972 | timekeeper.xtime_nsec -= nsecps; | 961 | timekeeper.xtime_nsec -= nsecps; |
973 | timekeeper.xtime.tv_sec++; | 962 | timekeeper.xtime.tv_sec++; |
974 | second_overflow(); | 963 | leap = second_overflow(timekeeper.xtime.tv_sec); |
964 | timekeeper.xtime.tv_sec += leap; | ||
975 | } | 965 | } |
976 | 966 | ||
977 | /* Accumulate raw time */ | 967 | /* Accumulate raw time */ |
@@ -1082,9 +1072,11 @@ static void update_wall_time(void) | |||
1082 | * xtime.tv_nsec isn't larger then NSEC_PER_SEC | 1072 | * xtime.tv_nsec isn't larger then NSEC_PER_SEC |
1083 | */ | 1073 | */ |
1084 | if (unlikely(timekeeper.xtime.tv_nsec >= NSEC_PER_SEC)) { | 1074 | if (unlikely(timekeeper.xtime.tv_nsec >= NSEC_PER_SEC)) { |
1075 | int leap; | ||
1085 | timekeeper.xtime.tv_nsec -= NSEC_PER_SEC; | 1076 | timekeeper.xtime.tv_nsec -= NSEC_PER_SEC; |
1086 | timekeeper.xtime.tv_sec++; | 1077 | timekeeper.xtime.tv_sec++; |
1087 | second_overflow(); | 1078 | leap = second_overflow(timekeeper.xtime.tv_sec); |
1079 | timekeeper.xtime.tv_sec += leap; | ||
1088 | } | 1080 | } |
1089 | 1081 | ||
1090 | timekeeping_update(false); | 1082 | timekeeping_update(false); |