1 From bf2fd9c0c451a83aa729394255394744fc81d8a3 Mon Sep 17 00:00:00 2001
2 From: Waldemar Brodkorb <wbx@openadk.org>
3 Date: Sun, 5 Mar 2017 01:58:17 +0100
4 Subject: [PATCH] sync header with GNU libc / kernel
6 The header is not in sync with GNU libc and Linux kernel and
7 therefore produces compile errors with qemu-user (2.8.0).
9 Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
10 Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
12 include/sys/timex.h | 17 ++++++++++++-----
13 1 file changed, 12 insertions(+), 5 deletions(-)
15 diff --git a/include/sys/timex.h b/include/sys/timex.h
16 index 4cb81d2..76fefa7 100644
17 --- a/include/sys/timex.h
18 +++ b/include/sys/timex.h
20 -/* Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
21 - This file is part of the GNU C Library.
22 +/* Copyright (C) 1995-2017 Free Software Foundation, Inc.
24 The GNU C Library is free software; you can redistribute it and/or
25 modify it under the terms of the GNU Lesser General Public
30 -/* These definitions from linux/timex.h as of 2.2.0. */
31 +/* These definitions from linux/timex.h as of 3.18. */
35 struct timeval time; /* current time (ro) */
36 long int maxerror; /* maximum error (us) (ro) */
37 long int esterror; /* estimated error (us) (ro) */
38 + long int tai; /* TAI offset (ro) */
42 @@ -44,7 +44,6 @@ struct timex
43 long int tolerance; /* clock frequency tolerance (ppm) (read only) */
44 struct timeval time; /* (read only) */
45 long int tick; /* (modified) usecs between clock ticks */
47 long int ppsfreq; /* pps frequency (scaled ppm) (ro) */
48 long int jitter; /* pps jitter (us) (ro) */
49 int shift; /* interval duration (s) (shift) (ro) */
50 @@ -54,6 +53,8 @@ struct timex
51 long int errcnt; /* calibration errors (ro) */
52 long int stbcnt; /* stability limit exceeded (ro) */
54 + int tai; /* TAI offset (ro) */
57 int :32; int :32; int :32; int :32;
58 int :32; int :32; int :32; int :32;
59 @@ -83,6 +84,9 @@ struct timex
60 #define MOD_TIMECONST ADJ_TIMECONST
61 #define MOD_CLKB ADJ_TICK
62 #define MOD_CLKA ADJ_OFFSET_SINGLESHOT /* 0x8000 in original */
63 +#define MOD_TAI ADJ_TAI
64 +#define MOD_MICRO ADJ_MICRO
65 +#define MOD_NANO ADJ_NANO
68 /* Status codes (timex.status) */
69 @@ -102,9 +106,12 @@ struct timex
70 #define STA_PPSERROR 0x0800 /* PPS signal calibration error (ro) */
72 #define STA_CLOCKERR 0x1000 /* clock hardware fault (ro) */
73 +#define STA_NANO 0x2000 /* resolution (0 = us, 1 = ns) (ro) */
74 +#define STA_MODE 0x4000 /* mode (0 = PLL, 1 = FLL) (ro) */
75 +#define STA_CLK 0x8000 /* clock source (0 = A, 1 = B) (ro) */
77 #define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \
78 - STA_PPSERROR | STA_CLOCKERR) /* read-only bits */
79 + STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK)
81 /* Clock states (time_state) */
82 #define TIME_OK 0 /* clock synchronized, no leap second */