~ubuntu-branches/debian/squeeze/ntp/squeeze-201010051545

« back to all changes in this revision

Viewing changes to ntpd/ntp_loopfilter.c

  • Committer: Bazaar Package Importer
  • Author(s): Kurt Roeckx
  • Date: 2009-11-26 22:16:37 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20091126221637-lbtdp0ax1yg9t0bx
Tags: 1:4.2.4p7+dfsg-4
* Use uname -s instead of dpkg-architecture to found the kernel we're
  running on.  dpkg-architecture is part of dpkg-dev. (Closes: #558145)
* Make the package fail to build on hurd since it does not provided
  the needed system calls for ntpd to work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
137
137
#ifdef KERNEL_PLL
138
138
struct timex ntv;               /* kernel API parameters */
139
139
int     pll_status;             /* status bits for kernel pll */
 
140
int     pll_nano;               /* nanosecond kernel switch */
140
141
#endif /* KERNEL_PLL */
141
142
 
142
143
/*
567
568
                        struct tm *tm = NULL;
568
569
                        time_t tstamp;
569
570
 
570
 
#ifdef STA_NANO
571
 
                        ntv.modes = MOD_BITS | MOD_NANO;
572
 
#else /* STA_NANO */
573
 
                        ntv.modes = MOD_BITS;
574
 
#endif /* STA_NANO */
 
571
                        if (pll_nano)
 
572
                                ntv.modes = MOD_BITS | MOD_NANO;
 
573
                        else
 
574
                                ntv.modes = MOD_BITS;
575
575
                        if (clock_offset < 0)
576
576
                                dtemp = -.5;
577
577
                        else
578
578
                                dtemp = .5;
579
 
#ifdef STA_NANO
580
 
                        ntv.offset = (int32)(clock_offset * 1e9 +
581
 
                            dtemp);
582
 
                        ntv.constant = sys_poll;
583
 
#else /* STA_NANO */
584
 
                        ntv.offset = (int32)(clock_offset * 1e6 +
585
 
                            dtemp);
586
 
                        ntv.constant = sys_poll - 4;
587
 
#endif /* STA_NANO */
 
579
                        if (pll_nano) {
 
580
                                ntv.offset = (int32)(clock_offset * 1e9 +
 
581
                                    dtemp);
 
582
                                ntv.constant = sys_poll;
 
583
                        } else {
 
584
                                ntv.offset = (int32)(clock_offset * 1e6 +
 
585
                                    dtemp);
 
586
                                ntv.constant = sys_poll - 4;
 
587
                        }
588
588
 
589
589
                        /*
590
590
                         * The frequency is set directly only if
654
654
                                    ntv.status);
655
655
                }
656
656
                pll_status = ntv.status;
657
 
#ifdef STA_NANO
658
 
                clock_offset = ntv.offset / 1e9;
659
 
#else /* STA_NANO */
660
 
                clock_offset = ntv.offset / 1e6;
661
 
#endif /* STA_NANO */
 
657
                if (pll_nano)
 
658
                        clock_offset = ntv.offset / 1e9;
 
659
                else
 
660
                        clock_offset = ntv.offset / 1e6;
662
661
                clock_frequency = ntv.freq / 65536e6;
663
662
                flladj = plladj = 0;
664
663
 
667
666
                 */
668
667
                if (ntv.status & STA_PPSTIME) {
669
668
                        pps_control = current_time;
670
 
#ifdef STA_NANO
671
 
                        clock_jitter = ntv.jitter / 1e9;
672
 
#else /* STA_NANO */
673
 
                        clock_jitter = ntv.jitter / 1e6;
674
 
#endif /* STA_NANO */
 
669
                        if (pll_nano)
 
670
                                clock_jitter = ntv.jitter / 1e9;
 
671
                        else
 
672
                                clock_jitter = ntv.jitter / 1e6;
675
673
                }
676
674
        } else {
677
675
#endif /* KERNEL_PLL */
932
930
                pll_status = ntv.status;
933
931
                if (pll_control) {
934
932
#ifdef STA_NANO
 
933
                        if (pll_status & STA_NANO)
 
934
                                pll_nano = 1;
935
935
                        if (pll_status & STA_CLK)
936
936
                                ext_enable = 1;
937
937
#endif /* STA_NANO */