June 2025 | ||||||
Mo | Tu | We | Th | Fr | Sa | Su |
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 1 | 2 | 3 | 4 | 5 | 6 |
001: /* Copyright (C) 1995-1997,1999,2007,2009,2011 Free Software Foundation, Inc. 002: This file is part of the GNU C Library. 003: 004: The GNU C Library is free software; you can redistribute it and/or 005: modify it under the terms of the GNU Lesser General Public 006: License as published by the Free Software Foundation; either 007: version 2.1 of the License, or (at your option) any later version. 008: 009: The GNU C Library is distributed in the hope that it will be useful, 010: but WITHOUT ANY WARRANTY; without even the implied warranty of 011: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012: Lesser General Public License for more details. 013: 014: You should have received a copy of the GNU Lesser General Public 015: License along with the GNU C Library; if not, write to the Free 016: Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 017: 02111-1307 USA. */ 018: 019: #ifndef _BITS_TIMEX_H 020: #define _BITS_TIMEX_H 1 021: 022: /* These definitions from linux/timex.h as of 2.6.30. */ 023: 024: struct timex 025: { 026: unsigned int modes; /* mode selector */ 027: long int offset; /* time offset (usec) */ 028: long int freq; /* frequency offset (scaled ppm) */ 029: long int maxerror; /* maximum error (usec) */ 030: long int esterror; /* estimated error (usec) */ 031: int status; /* clock command/status */ 032: long int constant; /* pll time constant */ 033: long int precision; /* clock precision (usec) (read only) */ 034: long int tolerance; /* clock frequency tolerance (ppm) (read only) */ 035: struct timeval time; /* (read only) */ 036: long int tick; /* (modified) usecs between clock ticks */ 037: 038: long int ppsfreq; /* pps frequency (scaled ppm) (ro) */ 039: long int jitter; /* pps jitter (us) (ro) */ 040: int shift; /* interval duration (s) (shift) (ro) */ 041: long int stabil; /* pps stability (scaled ppm) (ro) */ 042: long int jitcnt; /* jitter limit exceeded (ro) */ 043: long int calcnt; /* calibration intervals (ro) */ 044: long int errcnt; /* calibration errors (ro) */ 045: long int stbcnt; /* stability limit exceeded (ro) */ 046: 047: int tai; /* TAI offset (ro) */ 048: 049: /* ??? */ 050: int :32; int :32; int :32; int :32; 051: int :32; int :32; int :32; int :32; 052: int :32; int :32; int :32; 053: }; 054: 055: /* Mode codes (timex.mode) */ 056: #define ADJ_OFFSET 0x0001 /* time offset */ 057: #define ADJ_FREQUENCY 0x0002 /* frequency offset */ 058: #define ADJ_MAXERROR 0x0004 /* maximum time error */ 059: #define ADJ_ESTERROR 0x0008 /* estimated time error */ 060: #define ADJ_STATUS 0x0010 /* clock status */ 061: #define ADJ_TIMECONST 0x0020 /* pll time constant */ 062: #define ADJ_TAI 0x0080 /* set TAI offset */ 063: #define ADJ_MICRO 0x1000 /* select microsecond resolution */ 064: #define ADJ_NANO 0x2000 /* select nanosecond resolution */ 065: #define ADJ_TICK 0x4000 /* tick value */ 066: #define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */ 067: #define ADJ_OFFSET_SS_READ 0xa001 /* read-only adjtime */ 068: 069: /* xntp 3.4 compatibility names */ 070: #define MOD_OFFSET ADJ_OFFSET 071: #define MOD_FREQUENCY ADJ_FREQUENCY 072: #define MOD_MAXERROR ADJ_MAXERROR 073: #define MOD_ESTERROR ADJ_ESTERROR 074: #define MOD_STATUS ADJ_STATUS 075: #define MOD_TIMECONST ADJ_TIMECONST 076: #define MOD_CLKB ADJ_TICK 077: #define MOD_CLKA ADJ_OFFSET_SINGLESHOT /* 0x8000 in original */ 078: #define MOD_TAI ADJ_TAI 079: #define MOD_MICRO ADJ_MICRO 080: #define MOD_NANO ADJ_NANO 081: 082: 083: /* Status codes (timex.status) */ 084: #define STA_PLL 0x0001 /* enable PLL updates (rw) */ 085: #define STA_PPSFREQ 0x0002 /* enable PPS freq discipline (rw) */ 086: #define STA_PPSTIME 0x0004 /* enable PPS time discipline (rw) */ 087: #define STA_FLL 0x0008 /* select frequency-lock mode (rw) */ 088: 089: #define STA_INS 0x0010 /* insert leap (rw) */ 090: #define STA_DEL 0x0020 /* delete leap (rw) */ 091: #define STA_UNSYNC 0x0040 /* clock unsynchronized (rw) */ 092: #define STA_FREQHOLD 0x0080 /* hold frequency (rw) */ 093: 094: #define STA_PPSSIGNAL 0x0100 /* PPS signal present (ro) */ 095: #define STA_PPSJITTER 0x0200 /* PPS signal jitter exceeded (ro) */ 096: #define STA_PPSWANDER 0x0400 /* PPS signal wander exceeded (ro) */ 097: #define STA_PPSERROR 0x0800 /* PPS signal calibration error (ro) */ 098: 099: #define STA_CLOCKERR 0x1000 /* clock hardware fault (ro) */ 100: #define STA_NANO 0x2000 /* resolution (0 = us, 1 = ns) (ro) */ 101: #define STA_MODE 0x4000 /* mode (0 = PLL, 1 = FLL) (ro) */ 102: #define STA_CLK 0x8000 /* clock source (0 = A, 1 = B) (ro) */ 103: 104: /* Read-only bits */ 105: #define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \ 106: STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK) 107: 108: #endif /* bits/timex.h */ 109: