0004-sync-header-with-GNU-libc-kernel.patch 2.9 KB

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