[v2,12/25] y2038: linux: Add __USE_TIME_BITS64 support for struct timex
Checks
Commit Message
The __USE_TIME_BITS64 is not defined internally yet.
---
sysdeps/unix/sysv/linux/bits/timex.h | 31 ++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
Comments
On Tue, 18 May 2021 17:56:00 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:
> The __USE_TIME_BITS64 is not defined internally yet.
> ---
> sysdeps/unix/sysv/linux/bits/timex.h | 31
> ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
>
> diff --git a/sysdeps/unix/sysv/linux/bits/timex.h
> b/sysdeps/unix/sysv/linux/bits/timex.h index 9b2e30f3e0..ee37694e8f
> 100644 --- a/sysdeps/unix/sysv/linux/bits/timex.h
> +++ b/sysdeps/unix/sysv/linux/bits/timex.h
> @@ -25,6 +25,36 @@
>
> struct timex
> {
> +# ifdef __USE_TIME_BITS64
> + unsigned int modes; /* mode selector */
> + int :32; /* pad */
> + long long offset; /* time offset (usec) */
> + long long freq; /* frequency offset (scaled ppm) */
> + long long maxerror; /* maximum error (usec) */
> + long long esterror; /* estimated error (usec) */
> + int status; /* clock command/status */
> + int :32; /* pad */
> + long long constant; /* pll time constant */
> + long long precision; /* clock precision (usec) (read only)
> */
> + long long tolerance; /* clock frequency tolerance (ppm)
> (ro) */
> + struct timeval time; /* (read only, except for ADJ_SETOFFSET)
> */
> + long long tick; /* (modified) usecs between clock
> ticks */
> + long long ppsfreq; /* pps frequency (scaled ppm) (ro) */
> + long long jitter; /* pps jitter (us) (ro) */
> + int shift; /* interval duration (s) (shift) (ro)
> */
> + int :32; /* pad */
> + long long stabil; /* pps stability (scaled ppm) (ro) */
> + long long jitcnt; /* jitter limit exceeded (ro) */
> + long long calcnt; /* calibration intervals (ro) */
> + long long errcnt; /* calibration errors (ro) */
> + long long stbcnt; /* stability limit exceeded (ro) */
> +
> + int tai; /* TAI offset (ro) */
> +
> + int :32; int :32; int :32; int :32;
> + int :32; int :32; int :32; int :32;
> + int :32; int :32; int :32;
> +# else
> unsigned int modes; /* mode selector */
> __syscall_slong_t offset; /* time offset (usec) */
> __syscall_slong_t freq; /* frequency offset (scaled ppm) */
> @@ -51,6 +81,7 @@ struct timex
> int :32; int :32; int :32; int :32;
> int :32; int :32; int :32; int :32;
> int :32; int :32; int :32;
> +# endif
> };
>
> /* Mode codes (timex.mode) */
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
On 5/18/21 4:56 PM, Adhemerval Zanella wrote:
> The __USE_TIME_BITS64 is not defined internally yet.
LGTM.
No regressions on x86_64, i686, ppc64le, aarch64, s390x.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
> ---
> sysdeps/unix/sysv/linux/bits/timex.h | 31 ++++++++++++++++++++++++++++
> 1 file changed, 31 insertions(+)
>
> diff --git a/sysdeps/unix/sysv/linux/bits/timex.h b/sysdeps/unix/sysv/linux/bits/timex.h
> index 9b2e30f3e0..ee37694e8f 100644
> --- a/sysdeps/unix/sysv/linux/bits/timex.h
> +++ b/sysdeps/unix/sysv/linux/bits/timex.h
> @@ -25,6 +25,36 @@
>
> struct timex
> {
Checking against Linux kernel...
> +# ifdef __USE_TIME_BITS64
> + unsigned int modes; /* mode selector */
OK.
> + int :32; /* pad */
> + long long offset; /* time offset (usec) */
> + long long freq; /* frequency offset (scaled ppm) */
> + long long maxerror; /* maximum error (usec) */
> + long long esterror; /* estimated error (usec) */
OK.
> + int status; /* clock command/status */
> + int :32; /* pad */
OK.
> + long long constant; /* pll time constant */
> + long long precision; /* clock precision (usec) (read only) */
> + long long tolerance; /* clock frequency tolerance (ppm) (ro) */
OK.
> + struct timeval time; /* (read only, except for ADJ_SETOFFSET) */
OK.
> + long long tick; /* (modified) usecs between clock ticks */
> + long long ppsfreq; /* pps frequency (scaled ppm) (ro) */
> + long long jitter; /* pps jitter (us) (ro) */
> + int shift; /* interval duration (s) (shift) (ro) */
OK.
> + int :32; /* pad */
OK.
> + long long stabil; /* pps stability (scaled ppm) (ro) */
> + long long jitcnt; /* jitter limit exceeded (ro) */
> + long long calcnt; /* calibration intervals (ro) */
> + long long errcnt; /* calibration errors (ro) */
> + long long stbcnt; /* stability limit exceeded (ro) */
OK.
> +
> + int tai; /* TAI offset (ro) */
> +
> + int :32; int :32; int :32; int :32;
> + int :32; int :32; int :32; int :32;
> + int :32; int :32; int :32;
OK. 12x
> +# else
> unsigned int modes; /* mode selector */
> __syscall_slong_t offset; /* time offset (usec) */
> __syscall_slong_t freq; /* frequency offset (scaled ppm) */
> @@ -51,6 +81,7 @@ struct timex
> int :32; int :32; int :32; int :32;
> int :32; int :32; int :32; int :32;
> int :32; int :32; int :32;
> +# endif
> };
>
> /* Mode codes (timex.mode) */
>
@@ -25,6 +25,36 @@
struct timex
{
+# ifdef __USE_TIME_BITS64
+ unsigned int modes; /* mode selector */
+ int :32; /* pad */
+ long long offset; /* time offset (usec) */
+ long long freq; /* frequency offset (scaled ppm) */
+ long long maxerror; /* maximum error (usec) */
+ long long esterror; /* estimated error (usec) */
+ int status; /* clock command/status */
+ int :32; /* pad */
+ long long constant; /* pll time constant */
+ long long precision; /* clock precision (usec) (read only) */
+ long long tolerance; /* clock frequency tolerance (ppm) (ro) */
+ struct timeval time; /* (read only, except for ADJ_SETOFFSET) */
+ long long tick; /* (modified) usecs between clock ticks */
+ long long ppsfreq; /* pps frequency (scaled ppm) (ro) */
+ long long jitter; /* pps jitter (us) (ro) */
+ int shift; /* interval duration (s) (shift) (ro) */
+ int :32; /* pad */
+ long long stabil; /* pps stability (scaled ppm) (ro) */
+ long long jitcnt; /* jitter limit exceeded (ro) */
+ long long calcnt; /* calibration intervals (ro) */
+ long long errcnt; /* calibration errors (ro) */
+ long long stbcnt; /* stability limit exceeded (ro) */
+
+ int tai; /* TAI offset (ro) */
+
+ int :32; int :32; int :32; int :32;
+ int :32; int :32; int :32; int :32;
+ int :32; int :32; int :32;
+# else
unsigned int modes; /* mode selector */
__syscall_slong_t offset; /* time offset (usec) */
__syscall_slong_t freq; /* frequency offset (scaled ppm) */
@@ -51,6 +81,7 @@ struct timex
int :32; int :32; int :32; int :32;
int :32; int :32; int :32; int :32;
int :32; int :32; int :32;
+# endif
};
/* Mode codes (timex.mode) */