|
@@ -99,7 +99,7 @@ static time64_t ntp_next_leap_sec = TIME64_MAX;
|
|
static int pps_valid; /* signal watchdog counter */
|
|
static int pps_valid; /* signal watchdog counter */
|
|
static long pps_tf[3]; /* phase median filter */
|
|
static long pps_tf[3]; /* phase median filter */
|
|
static long pps_jitter; /* current jitter (ns) */
|
|
static long pps_jitter; /* current jitter (ns) */
|
|
-static struct timespec pps_fbase; /* beginning of the last freq interval */
|
|
|
|
|
|
+static struct timespec64 pps_fbase; /* beginning of the last freq interval */
|
|
static int pps_shift; /* current interval duration (s) (shift) */
|
|
static int pps_shift; /* current interval duration (s) (shift) */
|
|
static int pps_intcnt; /* interval counter */
|
|
static int pps_intcnt; /* interval counter */
|
|
static s64 pps_freq; /* frequency offset (scaled ns/s) */
|
|
static s64 pps_freq; /* frequency offset (scaled ns/s) */
|
|
@@ -773,13 +773,13 @@ int __do_adjtimex(struct timex *txc, struct timespec64 *ts, s32 *time_tai)
|
|
* pps_normtime.nsec has a range of ( -NSEC_PER_SEC / 2, NSEC_PER_SEC / 2 ]
|
|
* pps_normtime.nsec has a range of ( -NSEC_PER_SEC / 2, NSEC_PER_SEC / 2 ]
|
|
* while timespec.tv_nsec has a range of [0, NSEC_PER_SEC) */
|
|
* while timespec.tv_nsec has a range of [0, NSEC_PER_SEC) */
|
|
struct pps_normtime {
|
|
struct pps_normtime {
|
|
- __kernel_time_t sec; /* seconds */
|
|
|
|
|
|
+ s64 sec; /* seconds */
|
|
long nsec; /* nanoseconds */
|
|
long nsec; /* nanoseconds */
|
|
};
|
|
};
|
|
|
|
|
|
/* normalize the timestamp so that nsec is in the
|
|
/* normalize the timestamp so that nsec is in the
|
|
( -NSEC_PER_SEC / 2, NSEC_PER_SEC / 2 ] interval */
|
|
( -NSEC_PER_SEC / 2, NSEC_PER_SEC / 2 ] interval */
|
|
-static inline struct pps_normtime pps_normalize_ts(struct timespec ts)
|
|
|
|
|
|
+static inline struct pps_normtime pps_normalize_ts(struct timespec64 ts)
|
|
{
|
|
{
|
|
struct pps_normtime norm = {
|
|
struct pps_normtime norm = {
|
|
.sec = ts.tv_sec,
|
|
.sec = ts.tv_sec,
|
|
@@ -861,7 +861,7 @@ static long hardpps_update_freq(struct pps_normtime freq_norm)
|
|
pps_errcnt++;
|
|
pps_errcnt++;
|
|
pps_dec_freq_interval();
|
|
pps_dec_freq_interval();
|
|
printk_deferred(KERN_ERR
|
|
printk_deferred(KERN_ERR
|
|
- "hardpps: PPSERROR: interval too long - %ld s\n",
|
|
|
|
|
|
+ "hardpps: PPSERROR: interval too long - %lld s\n",
|
|
freq_norm.sec);
|
|
freq_norm.sec);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
@@ -948,7 +948,7 @@ static void hardpps_update_phase(long error)
|
|
* This code is based on David Mills's reference nanokernel
|
|
* This code is based on David Mills's reference nanokernel
|
|
* implementation. It was mostly rewritten but keeps the same idea.
|
|
* implementation. It was mostly rewritten but keeps the same idea.
|
|
*/
|
|
*/
|
|
-void __hardpps(const struct timespec *phase_ts, const struct timespec *raw_ts)
|
|
|
|
|
|
+void __hardpps(const struct timespec64 *phase_ts, const struct timespec64 *raw_ts)
|
|
{
|
|
{
|
|
struct pps_normtime pts_norm, freq_norm;
|
|
struct pps_normtime pts_norm, freq_norm;
|
|
|
|
|
|
@@ -969,7 +969,7 @@ void __hardpps(const struct timespec *phase_ts, const struct timespec *raw_ts)
|
|
}
|
|
}
|
|
|
|
|
|
/* ok, now we have a base for frequency calculation */
|
|
/* ok, now we have a base for frequency calculation */
|
|
- freq_norm = pps_normalize_ts(timespec_sub(*raw_ts, pps_fbase));
|
|
|
|
|
|
+ freq_norm = pps_normalize_ts(timespec64_sub(*raw_ts, pps_fbase));
|
|
|
|
|
|
/* check that the signal is in the range
|
|
/* check that the signal is in the range
|
|
* [1s - MAXFREQ us, 1s + MAXFREQ us], otherwise reject it */
|
|
* [1s - MAXFREQ us, 1s + MAXFREQ us], otherwise reject it */
|