[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ntp-hackers
Subject:    Re: [ntp:hackers] clock.c / Solaris
From:       "David L. Mills" <mills () udel ! edu>
Date:       2001-12-07 17:11:06
[Download RAW message or body]

Bill,

The code implements a type-II phase-lock loop with pole at zero and
extra poll for stability. The code is so old I don't have a listing that
reveals the defined parameter values. It is ten years old and predates
even the microkernel code in Digipaq Tru64 for the last several years
and the latest nanokernel code now in FreeBSD and Linux. I really don't
want to mess with this rickety old code, which in fact does perform as
expected in what tests I can mount. Much better to toss it in favor of
the late model, which has been running for a couple of years. See the
nanokernel.tar.gz distribution via www.ntp.org.

Dave

Bill Watson - Solaris Sustaining Engineering wrote:
> 
> Currently in Solaris in clock.c we have the following code. I have a
> customer who informs me this is incorrect and the lines starting with ???
> should be removed. Can you please confirm if they are correct and I
> should get them removed ?
> 
>         /*
>          * Compute the phase adjustment for the next second. In
>          * PLL mode, the offset is reduced by a fixed factor
>          * times the time constant. In FLL mode the offset is
>          * used directly. In either mode, the maximum phase
>          * adjustment for each second is clamped so as to spread
>          * the adjustment over not more than the number of
>          * seconds between updates.
>          */
>         if (time_offset == 0)
>                 time_adj = 0;
>         else if (time_offset < 0) {
>                 lltemp = -time_offset;
>                 if (!(time_status & STA_FLL)) {
> ???                     if ((1 << time_constant) >= SCALE_KG)
> ???                             lltemp *= (1 << time_constant) /
> ???                                 SCALE_KG;
> ???                     else
>                                 lltemp = (lltemp / SCALE_KG) >>
>                                     time_constant;
>                 }
>                 if (lltemp > (MAXPHASE / MINSEC) * SCALE_UPDATE)
>                         lltemp = (MAXPHASE / MINSEC) * SCALE_UPDATE;
>                 time_offset += lltemp;
>                 time_adj = -(lltemp * SCALE_PHASE) / hz / SCALE_UPDATE;
>         } else {
>                 lltemp = time_offset;
>                 if (!(time_status & STA_FLL)) {
> ???                     if ((1 << time_constant) >= SCALE_KG)
> ???                             lltemp *= (1 << time_constant) /
> ???                                 SCALE_KG;
> ???                     else
>                                 lltemp = (lltemp / SCALE_KG) >>
>                                     time_constant;
>                 }
>                 if (lltemp > (MAXPHASE / MINSEC) * SCALE_UPDATE)
>                         lltemp = (MAXPHASE / MINSEC) * SCALE_UPDATE;
>                 time_offset -= lltemp;
>                 time_adj = (lltemp * SCALE_PHASE) / hz / SCALE_UPDATE;
>         }
> 
> Also I was looking for the download of the clock.c stuff on www.ntp.org
> but could not find it any more. Is it still there ?
> 
> Regards
> 
> Bill.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic