From: "H.J. Lu" <hjl.tools@gmail.com>
To: "H. Peter Anvin" <hpa@zytor.com>, LKML <linux-kernel@vger.kernel.org>
Cc: "H.J. Lu" <hjl.tools@gmail.com>
Subject: [PATCH 1/8] Use __kernel_long_t in struct timex
Date: Fri, 27 Dec 2013 09:25:05 -0800 [thread overview]
Message-ID: <1388165112-6545-2-git-send-email-hjl.tools@gmail.com> (raw)
In-Reply-To: <1388165112-6545-1-git-send-email-hjl.tools@gmail.com>
X32 adjtimex system call is the same as x86-64 adjtimex system call,
which uses 64-bit integer for long in struct timex. But x32 long is
32 bit. This patch replaces long in struct timex with __kernel_long_t
if __BITS_PER_LONG == 64.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
---
include/uapi/linux/timex.h | 46 ++++++++++++++++++++++++++++++++++++++--------
1 file changed, 38 insertions(+), 8 deletions(-)
diff --git a/include/uapi/linux/timex.h b/include/uapi/linux/timex.h
index a7ea81f..98314e9 100644
--- a/include/uapi/linux/timex.h
+++ b/include/uapi/linux/timex.h
@@ -63,28 +63,58 @@
*/
struct timex {
unsigned int modes; /* mode selector */
+#if __BITS_PER_LONG == 64
+ __kernel_long_t offset; /* time offset (usec) */
+ __kernel_long_t freq; /* frequency offset (scaled ppm) */
+ __kernel_long_t maxerror;/* maximum error (usec) */
+ __kernel_long_t esterror;/* estimated error (usec) */
+#else
long offset; /* time offset (usec) */
long freq; /* frequency offset (scaled ppm) */
long maxerror; /* maximum error (usec) */
long esterror; /* estimated error (usec) */
+#endif
int status; /* clock command/status */
+#if __BITS_PER_LONG == 64
+ __kernel_long_t constant;/* pll time constant */
+ __kernel_long_t precision;/* clock precision (usec) (read only) */
+ __kernel_long_t tolerance;/* clock frequency tolerance (ppm)
+ * (read only)
+ */
+#else
long constant; /* pll time constant */
long precision; /* clock precision (usec) (read only) */
long tolerance; /* clock frequency tolerance (ppm)
* (read only)
*/
+#endif
struct timeval time; /* (read only, except for ADJ_SETOFFSET) */
+#if __BITS_PER_LONG == 64
+ __kernel_long_t tick; /* (modified) usecs between clock ticks */
+
+ __kernel_long_t ppsfreq;/* pps frequency (scaled ppm) (ro) */
+ __kernel_long_t jitter; /* pps jitter (us) (ro) */
+#else
long tick; /* (modified) usecs between clock ticks */
- long ppsfreq; /* pps frequency (scaled ppm) (ro) */
- long jitter; /* pps jitter (us) (ro) */
+ long ppsfreq; /* pps frequency (scaled ppm) (ro) */
+ long jitter; /* pps jitter (us) (ro) */
+#endif
int shift; /* interval duration (s) (shift) (ro) */
- long stabil; /* pps stability (scaled ppm) (ro) */
- long jitcnt; /* jitter limit exceeded (ro) */
- long calcnt; /* calibration intervals (ro) */
- long errcnt; /* calibration errors (ro) */
- long stbcnt; /* stability limit exceeded (ro) */
-
+#if __BITS_PER_LONG == 64
+ __kernel_long_t stabil; /* pps stability (scaled ppm) (ro) */
+ __kernel_long_t jitcnt; /* jitter limit exceeded (ro) */
+ __kernel_long_t calcnt; /* calibration intervals (ro) */
+ __kernel_long_t errcnt; /* calibration errors (ro) */
+ __kernel_long_t stbcnt; /* stability limit exceeded (ro) */
+
+#else
+ long stabil; /* pps stability (scaled ppm) (ro) */
+ long jitcnt; /* jitter limit exceeded (ro) */
+ long calcnt; /* calibration intervals (ro) */
+ long errcnt; /* calibration errors (ro) */
+ long stbcnt; /* stability limit exceeded (ro) */
+#endif
int tai; /* TAI offset (ro) */
int :32; int :32; int :32; int :32;
--
1.8.4.2
next prev parent reply other threads:[~2013-12-27 17:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-27 17:25 [PATCH 0/8] Update kernel uabi header files for x32 H.J. Lu
2013-12-27 17:25 ` H.J. Lu [this message]
2013-12-27 22:06 ` [PATCH 1/8] Use __kernel_long_t in struct timex H. Peter Anvin
2014-01-21 16:58 ` Catalin Marinas
2014-01-21 17:03 ` H. Peter Anvin
2014-01-21 17:12 ` Catalin Marinas
2013-12-27 17:25 ` [PATCH 2/8] Use __kernel_long_t/__kernel_ulong_t in <linux/resource.h> H.J. Lu
2013-12-27 17:25 ` [PATCH 3/8] Use __kernel_ulong_t in uapi struct ipc64_perm H.J. Lu
2013-12-27 17:25 ` [PATCH 4/8] Use __kernel_long_t in struct msgbuf H.J. Lu
2013-12-27 17:25 ` [PATCH 5/8] Use __kernel_ulong_t in struct msqid64_ds H.J. Lu
2013-12-27 17:25 ` [PATCH 6/8] Use __kernel_ulong_t in x86 struct semid64_ds H.J. Lu
2014-01-21 17:10 ` Catalin Marinas
2014-01-21 18:06 ` H.J. Lu
2014-01-22 14:57 ` Catalin Marinas
2014-01-22 15:20 ` H. Peter Anvin
2013-12-27 17:25 ` [PATCH 7/8] Use __kernel_ulong_t in shmid64_ds/shminfo64/shm_info H.J. Lu
2013-12-27 17:25 ` [PATCH 8/8] Use __kernel_long_t in struct mq_attr H.J. Lu
2013-12-27 22:14 [PATCH 0/8] Update kernel uabi header files for x32 H.J. Lu
2013-12-27 22:14 ` [PATCH 1/8] Use __kernel_long_t in struct timex H.J. Lu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1388165112-6545-2-git-send-email-hjl.tools@gmail.com \
--to=hjl.tools@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome