[PATCH] create struct compat_timex and use it everywhere

We had a copy of the compatibility version of struct timex in each 64 bit
architecture.  This patch just creates a global one and replaces all the
usages of the old ones.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Arnd Bergmann <arnd@arndb.de>
Acked-by: Kyle McMartin <kyle@parisc-linux.org>
Acked-by: Tony Luck <tony.luck@intel.com>
Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Stephen Rothwell
2006-03-26 01:37:27 -08:00
committed by Linus Torvalds
parent eb76b3fda1
commit 88959ea968
8 changed files with 38 additions and 119 deletions

View File

@ -567,43 +567,14 @@ asmlinkage int sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *off
}
struct timex32 {
unsigned int modes; /* mode selector */
int offset; /* time offset (usec) */
int freq; /* frequency offset (scaled ppm) */
int maxerror; /* maximum error (usec) */
int esterror; /* estimated error (usec) */
int status; /* clock command/status */
int constant; /* pll time constant */
int precision; /* clock precision (usec) (read only) */
int tolerance; /* clock frequency tolerance (ppm)
* (read only)
*/
struct compat_timeval time; /* (read only) */
int tick; /* (modified) usecs between clock ticks */
int ppsfreq; /* pps frequency (scaled ppm) (ro) */
int jitter; /* pps jitter (us) (ro) */
int shift; /* interval duration (s) (shift) (ro) */
int stabil; /* pps stability (scaled ppm) (ro) */
int jitcnt; /* jitter limit exceeded (ro) */
int calcnt; /* calibration intervals (ro) */
int errcnt; /* calibration errors (ro) */
int stbcnt; /* stability limit exceeded (ro) */
int :32; int :32; int :32; int :32;
int :32; int :32; int :32; int :32;
int :32; int :32; int :32; int :32;
};
asmlinkage long sys32_adjtimex(struct timex32 __user *txc_p32)
asmlinkage long sys32_adjtimex(struct compat_timex __user *txc_p32)
{
struct timex txc;
struct timex32 t32;
struct compat_timex t32;
int ret;
extern int do_adjtimex(struct timex *txc);
if(copy_from_user(&t32, txc_p32, sizeof(struct timex32)))
if(copy_from_user(&t32, txc_p32, sizeof(struct compat_timex)))
return -EFAULT;
#undef CP
#define CP(x) txc.x = t32.x
@ -620,7 +591,7 @@ asmlinkage long sys32_adjtimex(struct timex32 __user *txc_p32)
CP(time.tv_sec); CP(time.tv_usec); CP(tick); CP(ppsfreq); CP(jitter);
CP(shift); CP(stabil); CP(jitcnt); CP(calcnt); CP(errcnt);
CP(stbcnt);
return copy_to_user(txc_p32, &t32, sizeof(struct timex32)) ? -EFAULT : ret;
return copy_to_user(txc_p32, &t32, sizeof(struct compat_timex)) ? -EFAULT : ret;
}