]> granicus.if.org Git - strace/commitdiff
sparc64: implement printer for sparc64-specific struct timex
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 10 May 2019 22:27:59 +0000 (22:27 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 10 May 2019 22:27:59 +0000 (22:27 +0000)
According to Linux kernel commit v5.1-rc1~160^2~2^2~8, sparc64 is the
only architecture on Linux that has a 'timeval' definition with a 32-bit
tv_usec but a 64-bit tv_sec.

* defs.h [SPARC64] (print_sparc64_timex): New prototype.
* kernel_timex.h [SPARC64] (kernel_sparc64_timex_t): New type.
* print_timex.c [SPARC64] (print_sparc64_timex): New function.

defs.h
kernel_timex.h
print_timex.c

diff --git a/defs.h b/defs.h
index 1cb7a7559fdb08b31456321446e961aa42c8eeed..a3263369023ffa4fcaffdca0614d68b536375dc3 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -1131,6 +1131,10 @@ extern int print_timespec64_utime_pair(struct tcb *, kernel_ulong_t);
 extern int print_itimerspec64(struct tcb *, kernel_ulong_t);
 extern int print_timex64(struct tcb *, kernel_ulong_t);
 
+# ifdef SPARC64
+extern int print_sparc64_timex(struct tcb *, kernel_ulong_t);
+# endif
+
 # ifdef ALPHA
 typedef struct {
        int tv_sec, tv_usec;
index ea77e1da203861778b92260c4fd0402a306215ec..6eff047f6b8e91c642ef214c2bde055dd165ec85 100644 (file)
@@ -38,6 +38,40 @@ typedef struct {
        int pad3[11];
 } kernel_timex64_t;
 
+#ifdef SPARC64
+
+typedef struct {
+       unsigned int modes;
+       int pad0;
+       long long offset;
+       long long freq;
+       long long maxerror;
+       long long esterror;
+       int status;
+       int pad1;
+       long long constant;
+       long long precision;
+       long long tolerance;
+       struct {
+               long long tv_sec;
+               int tv_usec;
+       } time;
+       long long tick;
+       long long ppsfreq;
+       long long jitter;
+       int shift;
+       int pad2;
+       long long stabil;
+       long long jitcnt;
+       long long calcnt;
+       long long errcnt;
+       long long stbcnt;
+       int tai;
+       int pad3[11];
+} kernel_sparc64_timex_t;
+
+#endif /* SPARC64 */
+
 # if HAVE_ARCH_TIME32_SYSCALLS
 
 typedef struct {
index 9c0f094135b09a27ebc195df44112a52976d5bb4..98d135250a59bc096f532878fdaddc53033226d6 100644 (file)
@@ -72,4 +72,14 @@ MPERS_PRINTER_DECL(int, print_timex,
 
 # endif /* HAVE_ARCH_TIME32_SYSCALLS */
 
+# ifdef SPARC64
+
+#  define PRINT_TIMEX print_sparc64_timex
+#  define TIMEX_T kernel_sparc64_timex_t
+#  include "print_timex.h"
+#  undef TIMEX_T
+#  undef PRINT_TIMEX
+
+# endif /* SPARC64 */
+
 #endif /* !IN_MPERS */