blob: e574b4bc499ab956511e54379803b1ed4088eb06 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_LINUX_TIMEX_H
20#define _UAPI_LINUX_TIMEX_H
21#include <linux/time.h>
22#define NTP_API 4
Ben Cheng655a7c02013-10-16 16:09:24 -070023struct timex {
Tao Baod7db5942015-01-28 10:07:51 -080024 unsigned int modes;
25 __kernel_long_t offset;
26 __kernel_long_t freq;
Tao Baod7db5942015-01-28 10:07:51 -080027 __kernel_long_t maxerror;
28 __kernel_long_t esterror;
29 int status;
30 __kernel_long_t constant;
Tao Baod7db5942015-01-28 10:07:51 -080031 __kernel_long_t precision;
32 __kernel_long_t tolerance;
33 struct timeval time;
34 __kernel_long_t tick;
Tao Baod7db5942015-01-28 10:07:51 -080035 __kernel_long_t ppsfreq;
36 __kernel_long_t jitter;
37 int shift;
38 __kernel_long_t stabil;
Tao Baod7db5942015-01-28 10:07:51 -080039 __kernel_long_t jitcnt;
40 __kernel_long_t calcnt;
41 __kernel_long_t errcnt;
42 __kernel_long_t stbcnt;
Tao Baod7db5942015-01-28 10:07:51 -080043 int tai;
44 int : 32;
45 int : 32;
46 int : 32;
Tao Baod7db5942015-01-28 10:07:51 -080047 int : 32;
48 int : 32;
49 int : 32;
50 int : 32;
Tao Baod7db5942015-01-28 10:07:51 -080051 int : 32;
52 int : 32;
53 int : 32;
54 int : 32;
Ben Cheng655a7c02013-10-16 16:09:24 -070055};
56#define ADJ_OFFSET 0x0001
57#define ADJ_FREQUENCY 0x0002
58#define ADJ_MAXERROR 0x0004
Ben Cheng655a7c02013-10-16 16:09:24 -070059#define ADJ_ESTERROR 0x0008
60#define ADJ_STATUS 0x0010
61#define ADJ_TIMECONST 0x0020
62#define ADJ_TAI 0x0080
Ben Cheng655a7c02013-10-16 16:09:24 -070063#define ADJ_SETOFFSET 0x0100
64#define ADJ_MICRO 0x1000
65#define ADJ_NANO 0x2000
66#define ADJ_TICK 0x4000
Ben Cheng655a7c02013-10-16 16:09:24 -070067#define ADJ_OFFSET_SINGLESHOT 0x8001
68#define ADJ_OFFSET_SS_READ 0xa001
69#define MOD_OFFSET ADJ_OFFSET
70#define MOD_FREQUENCY ADJ_FREQUENCY
Ben Cheng655a7c02013-10-16 16:09:24 -070071#define MOD_MAXERROR ADJ_MAXERROR
72#define MOD_ESTERROR ADJ_ESTERROR
73#define MOD_STATUS ADJ_STATUS
74#define MOD_TIMECONST ADJ_TIMECONST
Ben Cheng655a7c02013-10-16 16:09:24 -070075#define MOD_TAI ADJ_TAI
76#define MOD_MICRO ADJ_MICRO
77#define MOD_NANO ADJ_NANO
78#define STA_PLL 0x0001
Ben Cheng655a7c02013-10-16 16:09:24 -070079#define STA_PPSFREQ 0x0002
80#define STA_PPSTIME 0x0004
81#define STA_FLL 0x0008
82#define STA_INS 0x0010
Ben Cheng655a7c02013-10-16 16:09:24 -070083#define STA_DEL 0x0020
84#define STA_UNSYNC 0x0040
85#define STA_FREQHOLD 0x0080
86#define STA_PPSSIGNAL 0x0100
Ben Cheng655a7c02013-10-16 16:09:24 -070087#define STA_PPSJITTER 0x0200
88#define STA_PPSWANDER 0x0400
89#define STA_PPSERROR 0x0800
90#define STA_CLOCKERR 0x1000
Ben Cheng655a7c02013-10-16 16:09:24 -070091#define STA_NANO 0x2000
92#define STA_MODE 0x4000
93#define STA_CLK 0x8000
Tao Baod7db5942015-01-28 10:07:51 -080094#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK)
Ben Cheng655a7c02013-10-16 16:09:24 -070095#define TIME_OK 0
96#define TIME_INS 1
97#define TIME_DEL 2
98#define TIME_OOP 3
Ben Cheng655a7c02013-10-16 16:09:24 -070099#define TIME_WAIT 4
100#define TIME_ERROR 5
101#define TIME_BAD TIME_ERROR
102#endif