Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140924843
D35934.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
977 B
Referenced Files
None
Subscribers
None
D35934.id.diff
View Options
Index: sys/kern/kern_tc.c
===================================================================
--- sys/kern/kern_tc.c
+++ sys/kern/kern_tc.c
@@ -1781,7 +1781,7 @@
struct timecounter *captc;
uint64_t capth_scale;
struct bintime bt;
- struct timespec ts, *tsp, *osp;
+ struct timespec *tsp, *osp;
u_int tcount, *pcount;
int foff;
pps_seq_t *pseq;
@@ -1881,7 +1881,7 @@
#ifdef PPS_SYNC
if (fhard) {
- uint64_t scale;
+ uint64_t nsec;
/*
* Feed the NTP PLL/FLL.
@@ -1891,14 +1891,10 @@
tcount = pps->capcount - pps->ppscount[2];
pps->ppscount[2] = pps->capcount;
tcount &= captc->tc_counter_mask;
- scale = (uint64_t)1 << 63;
- scale /= captc->tc_frequency;
- scale *= 2;
- bt.sec = 0;
- bt.frac = 0;
- bintime_addx(&bt, scale * tcount);
- bintime2timespec(&bt, &ts);
- hardpps(tsp, ts.tv_nsec + 1000000000 * ts.tv_sec);
+ nsec = 1000000000;
+ nsec *= tcount;
+ nsec /= captc->tc_frequency;
+ hardpps(tsp, (long)nsec);
}
#endif
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 30, 5:14 PM (8 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27388933
Default Alt Text
D35934.id.diff (977 B)
Attached To
Mode
D35934: pps: Simplify the nsec calculation in pps_event()
Attached
Detach File
Event Timeline
Log In to Comment