Commit | Line | Data |
---|---|---|
3bbcbb94 GW |
1 | \ 1\ 1\ 1\ 1 |
2 | Received: from louie.udel.edu by huey.udel.edu id aa02110; 24 Feb 94 18:54 EST | |
3 | Received: from faui45.informatik.uni-erlangen.de by louie.udel.edu id aa13897; | |
4 | 24 Feb 94 18:53 EST | |
5 | Received: from faui43.informatik.uni-erlangen.de by uni-erlangen.de with SMTP; | |
6 | id AA27796 (5.65c-6/7.3v-FAU); Fri, 25 Feb 1994 00:53:32 +0100 | |
7 | Received: from faui45x.informatik.uni-erlangen.de by immd4.informatik.uni-erlangen.de with SMTP; | |
8 | id AA16114 (5.65c-6/7.3m-FAU); Fri, 25 Feb 1994 00:53:31 +0100 | |
9 | From: Frank Kardel <Frank.Kardel@informatik.uni-erlangen.de> | |
10 | Message-Id: <199402242353.AA16114@faui43.informatik.uni-erlangen.de> | |
11 | Subject: patches (parse pps/pll control) | |
12 | To: mills@udel.edu | |
13 | Date: Fri, 25 Feb 94 0:52:59 MET | |
14 | X-Mailer: ELM [version 2.3 PL11] | |
15 | ||
16 | Hi, here are some patches. | |
17 | ||
18 | pps pll control is nor supported by parse. | |
19 | pps output variable are readable via mode 6 messages. | |
20 | ||
21 | diff -c v3/parse/parsestreams.c:1.1.1.10 v3/parse/parsestreams.c:3.19 | |
22 | *** v3/parse/parsestreams.c:1.1.1.10 Fri Feb 25 00:44:41 1994 | |
23 | --- v3/parse/parsestreams.c Fri Feb 25 00:44:41 1994 | |
24 | *************** | |
25 | *** 1,7 **** | |
26 | /* | |
27 | ! * /src/NTP/REPOSITORY/v3/parse/parsestreams.c,v 3.17 1994/02/20 15:18:02 kardel Exp | |
28 | * | |
29 | ! * parsestreams.c,v 3.17 1994/02/20 15:18:02 kardel Exp | |
30 | * | |
31 | * STREAMS module for reference clocks | |
32 | * (SunOS4.x) | |
33 | --- 1,7 ---- | |
34 | /* | |
35 | ! * /src/NTP/REPOSITORY/v3/parse/parsestreams.c,v 3.19 1994/02/24 16:33:54 kardel Exp | |
36 | * | |
37 | ! * parsestreams.c,v 3.19 1994/02/24 16:33:54 kardel Exp | |
38 | * | |
39 | * STREAMS module for reference clocks | |
40 | * (SunOS4.x) | |
41 | *************** | |
42 | *** 16,22 **** | |
43 | */ | |
44 | ||
45 | #ifndef lint | |
46 | ! static char rcsid[] = "parsestreams.c,v 3.17 1994/02/20 15:18:02 kardel Exp"; | |
47 | #endif | |
48 | ||
49 | #include "sys/types.h" | |
50 | --- 16,22 ---- | |
51 | */ | |
52 | ||
53 | #ifndef lint | |
54 | ! static char rcsid[] = "parsestreams.c,v 3.19 1994/02/24 16:33:54 kardel Exp"; | |
55 | #endif | |
56 | ||
57 | #include "sys/types.h" | |
58 | *************** | |
59 | *** 195,201 **** | |
60 | } | |
61 | else | |
62 | { | |
63 | ! static char revision[] = "3.17"; | |
64 | char *s, *S, *t; | |
65 | ||
66 | strncpy(ifm->f_name, mname, FMNAMESZ); | |
67 | --- 195,201 ---- | |
68 | } | |
69 | else | |
70 | { | |
71 | ! static char revision[] = "3.19"; | |
72 | char *s, *S, *t; | |
73 | ||
74 | strncpy(ifm->f_name, mname, FMNAMESZ); | |
75 | *************** | |
76 | *** 1076,1081 **** | |
77 | --- 1076,1086 ---- | |
78 | ||
79 | #define MAXDEPTH 50 /* maximum allowed stream crawl */ | |
80 | ||
81 | + #ifdef PPS_SYNC | |
82 | + extern hardpps(); | |
83 | + extern struct timeval time; | |
84 | + #endif | |
85 | + | |
86 | /* | |
87 | * take external status interrupt (only CD interests us) | |
88 | */ | |
89 | *************** | |
90 | *** 1087,1101 **** | |
91 | register queue_t *q; | |
92 | register unsigned char zsstatus; | |
93 | register int loopcheck; | |
94 | - register unsigned char cdstate; | |
95 | register char *dname; | |
96 | ||
97 | /* | |
98 | * pick up current state | |
99 | */ | |
100 | zsstatus = zsaddr->zscc_control; | |
101 | ||
102 | ! if (za->za_rr0 ^ (cdstate = zsstatus & ZSRR0_CD)) | |
103 | { | |
104 | timestamp_t cdevent; | |
105 | register int status; | |
106 | --- 1092,1109 ---- | |
107 | register queue_t *q; | |
108 | register unsigned char zsstatus; | |
109 | register int loopcheck; | |
110 | register char *dname; | |
111 | + #ifdef PPS_SYNC | |
112 | + register int s; | |
113 | + register long usec; | |
114 | + #endif | |
115 | ||
116 | /* | |
117 | * pick up current state | |
118 | */ | |
119 | zsstatus = zsaddr->zscc_control; | |
120 | ||
121 | ! if ((za->za_rr0 ^ zsstatus) & (ZSRR0_CD|ZSRR0_SYNC)) | |
122 | { | |
123 | timestamp_t cdevent; | |
124 | register int status; | |
125 | *************** | |
126 | *** 1103,1129 **** | |
127 | /* | |
128 | * CONDITIONAL external measurement support | |
129 | */ | |
130 | ! SET_LED(cdstate); /* | |
131 | * inconsistent with upper SET_LED, but this | |
132 | * is for oscilloscope business anyway and we | |
133 | * are just interested in edge delays in the | |
134 | * lower us range | |
135 | */ | |
136 | ! | |
137 | /* | |
138 | * time stamp | |
139 | */ | |
140 | uniqtime(&cdevent.tv); | |
141 | ! | |
142 | ! TIMEVAL_USADD(&cdevent.tv, xsdelay); | |
143 | ! | |
144 | ! q = za->za_ttycommon.t_readq; | |
145 | ||
146 | /* | |
147 | * logical state | |
148 | */ | |
149 | ! status = cd_invert ? cdstate == 0 : cdstate != 0; | |
150 | ||
151 | /* | |
152 | * ok - now the hard part - find ourself | |
153 | */ | |
154 | --- 1111,1155 ---- | |
155 | /* | |
156 | * CONDITIONAL external measurement support | |
157 | */ | |
158 | ! SET_LED(zsstatus & (ZSRR0_CD|ZSRR0_SYNC)); /* | |
159 | * inconsistent with upper SET_LED, but this | |
160 | * is for oscilloscope business anyway and we | |
161 | * are just interested in edge delays in the | |
162 | * lower us range | |
163 | */ | |
164 | ! #ifdef PPS_SYNC | |
165 | ! s = splclock(); | |
166 | ! usec = time.tv_usec; | |
167 | ! #endif | |
168 | /* | |
169 | * time stamp | |
170 | */ | |
171 | uniqtime(&cdevent.tv); | |
172 | ! | |
173 | ! #ifdef PPS_SYNC | |
174 | ! splx(s); | |
175 | ! #endif | |
176 | ||
177 | /* | |
178 | * logical state | |
179 | */ | |
180 | ! status = cd_invert ? (zsstatus & (ZSRR0_CD|ZSRR0_SYNC)) == 0 : (zsstatus & (ZSRR0_CD|ZSRR0_SYNC)) != 0; | |
181 | ||
182 | + #ifdef PPS_SYNC | |
183 | + if (status) | |
184 | + { | |
185 | + usec = cdevent.tv.tv_usec - usec; | |
186 | + if (usec < 0) | |
187 | + usec += 1000000; | |
188 | + | |
189 | + hardpps(&cdevent.tv, usec); | |
190 | + } | |
191 | + #endif | |
192 | + | |
193 | + TIMEVAL_USADD(&cdevent.tv, xsdelay); | |
194 | + | |
195 | + q = za->za_ttycommon.t_readq; | |
196 | + | |
197 | /* | |
198 | * ok - now the hard part - find ourself | |
199 | */ | |
200 | *************** | |
201 | *** 1179,1188 **** | |
202 | /* | |
203 | * only pretend that CD has been handled | |
204 | */ | |
205 | ! za->za_rr0 = za->za_rr0 & ~ZSRR0_CD | zsstatus & ZSRR0_CD; | |
206 | ZSDELAY(2); | |
207 | ||
208 | ! if (!((za->za_rr0 ^ zsstatus) & ~ZSRR0_CD)) | |
209 | { | |
210 | /* | |
211 | * all done - kill status indication and return | |
212 | --- 1205,1214 ---- | |
213 | /* | |
214 | * only pretend that CD has been handled | |
215 | */ | |
216 | ! za->za_rr0 = za->za_rr0 & ~(ZSRR0_CD|ZSRR0_SYNC) | zsstatus & (ZSRR0_CD|ZSRR0_SYNC); | |
217 | ZSDELAY(2); | |
218 | ||
219 | ! if (!((za->za_rr0 ^ zsstatus) & ~(ZSRR0_CD|ZSRR0_SYNC))) | |
220 | { | |
221 | /* | |
222 | * all done - kill status indication and return | |
223 | *************** | |
224 | *** 1260,1265 **** | |
225 | --- 1286,1297 ---- | |
226 | * History: | |
227 | * | |
228 | * parsestreams.c,v | |
229 | + * Revision 3.19 1994/02/24 16:33:54 kardel | |
230 | + * CD events can also be posted on sync flag | |
231 | + * | |
232 | + * Revision 3.18 1994/02/24 14:12:58 kardel | |
233 | + * initial PPS_SYNC support version | |
234 | + * | |
235 | * Revision 3.17 1994/02/20 15:18:02 kardel | |
236 | * rcs id cleanup | |
237 | * | |
238 | diff -c v3/xntpd/ntp_loopfilter.c:1.1.1.33 v3/xntpd/ntp_loopfilter.c:3.40 | |
239 | *** v3/xntpd/ntp_loopfilter.c:1.1.1.33 Fri Feb 25 00:46:20 1994 | |
240 | --- v3/xntpd/ntp_loopfilter.c Fri Feb 25 00:46:21 1994 | |
241 | *************** | |
242 | *** 522,529 **** | |
243 | --- 522,545 ---- | |
244 | ntv.maxerror = sys_rootdispersion + sys_rootdelay / 2; | |
245 | ntv.esterror = sys_rootdispersion; | |
246 | ntv.time_constant = time_constant; | |
247 | + ntv.shift = 0; | |
248 | (void)ntp_adjtime(&ntv); | |
249 | drift_comp = ntv.frequency; | |
250 | + if (ntv.shift != 0) { | |
251 | + char buf[128]; | |
252 | + (void) sprintf(buf, "pps_freq=%s", fptoa(ntv.ybar, 3)); | |
253 | + set_sys_var(buf, strlen(buf)+1, RO|DEF); | |
254 | + (void) sprintf(buf, "pps_disp=%s", fptoa(ntv.disp, 3)); | |
255 | + set_sys_var(buf, strlen(buf)+1, RO|DEF); | |
256 | + (void) sprintf(buf, "pps_interval=%ld",1 << ntv.shift); | |
257 | + set_sys_var(buf, strlen(buf)+1, RO); | |
258 | + (void) sprintf(buf, "pps_intervals=%ld", ntv.calcnt); | |
259 | + set_sys_var(buf, strlen(buf)+1, RO); | |
260 | + (void) sprintf(buf, "pps_jitterexceeded=%ld", ntv.jitcnt); | |
261 | + set_sys_var(buf, strlen(buf)+1, RO); | |
262 | + (void) sprintf(buf, "pps_dispersionexceeded=%ld", ntv.discnt); | |
263 | + set_sys_var(buf, strlen(buf)+1, RO); | |
264 | + } | |
265 | #endif /* KERNEL_PLL */ | |
266 | } else { | |
267 | if (offset < 0) { | |
268 | *************** | |
269 | *** 725,730 **** | |
270 | --- 741,748 ---- | |
271 | "loop_config: skew compensation %s too large", | |
272 | fptoa(tmp, 5)); | |
273 | } else { | |
274 | + char var[40]; | |
275 | + | |
276 | drift_comp = tmp; | |
277 | ||
278 | #if defined(KERNEL_PLL) | |
279 | *************** | |
280 | *** 751,756 **** | |
281 | --- 769,778 ---- | |
282 | syslog(LOG_NOTICE, | |
283 | "%susing kernel phase-lock loop", | |
284 | (pll_control) ? "" : "Not "); | |
285 | + (void)sprintf(var, "kernel_pll=%s", pll_control ? "true" : "false"); | |
286 | + | |
287 | + set_sys_var(var, strlen(var)+1, RO); | |
288 | + | |
289 | #if DEBUG | |
290 | if (debug) | |
291 | printf("pll_control %d\n", pll_control); | |
292 | -- | |
293 | Frank Kardel (kardel@informatik.uni-erlangen.de) | |
294 | All SCSI disks will from now on be required to send an email | |
295 | notice 24 hours prior to complete hardware failure! | |
296 | \ 1\ 1\ 1\ 1 |