* Re: [PATCH][COMPAT] outstanding compatibility changes 3/4 sparc
2003-02-12 4:36 ` [PATCH][COMPAT] outstanding compatibility changes 3/4 sparc Stephen Rothwell
@ 2003-02-12 4:26 ` David S. Miller
0 siblings, 0 replies; 5+ messages in thread
From: David S. Miller @ 2003-02-12 4:26 UTC (permalink / raw)
To: sfr; +Cc: torvalds, linux-kernel
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Wed, 12 Feb 2003 15:36:49 +1100
These are the outstanding compatibility patches I have for sparc64 against
2.5.60. I am not sure whether you dropped these deliberately or not.
Definitely not on purpse, I'll apply this.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH][COMPAT] outstanding compatibility changes 1/4 parisc
@ 2003-02-12 4:29 Stephen Rothwell
2003-02-12 4:33 ` [PATCH][COMPAT] outstanding compatibility changes 2/4 parisc Stephen Rothwell
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Stephen Rothwell @ 2003-02-12 4:29 UTC (permalink / raw)
To: Linus; +Cc: LKML, matthew
Hi Linus,
At Linux Conf AU, Willy asked me to send any further parisc compatibility
changes directly to you, so this is what I have outstanding. Basically,
it is just the uses of compat_sigset_t that seemed to have been missed in
the previous merges.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN 2.5.60/arch/parisc/kernel/binfmt_elf32.c 2.5.60-32bit.1/arch/parisc/kernel/binfmt_elf32.c
--- 2.5.60/arch/parisc/kernel/binfmt_elf32.c 2003-01-15 11:20:31.000000000 +1100
+++ 2.5.60-32bit.1/arch/parisc/kernel/binfmt_elf32.c 2003-02-11 12:21:29.000000000 +1100
@@ -19,7 +19,7 @@
#include <linux/module.h>
#include <linux/config.h>
#include <linux/elfcore.h>
-#include <linux/compat.h>
+#include <linux/compat.h> /* struct compat_timeval */
#define elf_prstatus elf_prstatus32
struct elf_prstatus32
diff -ruN 2.5.60/arch/parisc/kernel/signal.c 2.5.60-32bit.1/arch/parisc/kernel/signal.c
--- 2.5.60/arch/parisc/kernel/signal.c 2003-02-11 09:39:14.000000000 +1100
+++ 2.5.60-32bit.1/arch/parisc/kernel/signal.c 2003-02-11 12:21:29.000000000 +1100
@@ -25,6 +25,7 @@
#include <linux/ptrace.h>
#include <linux/unistd.h>
#include <linux/stddef.h>
+#include <linux/compat.h>
#include <asm/ucontext.h>
#include <asm/rt_sigframe.h>
#include <asm/uaccess.h>
@@ -97,13 +98,13 @@
sigset_t saveset, newset;
#ifdef __LP64__
/* XXX FIXME -- assumes 32-bit user app! */
- sigset_t32 newset32;
+ compat_sigset_t newset32;
/* XXX: Don't preclude handling different sized sigset_t's. */
- if (sigsetsize != sizeof(sigset_t32))
+ if (sigsetsize != sizeof(compat_sigset_t))
return -EINVAL;
- if (copy_from_user(&newset32, (sigset_t32 *)unewset, sizeof(newset32)))
+ if (copy_from_user(&newset32, (compat_sigset_t *)unewset, sizeof(newset32)))
return -EFAULT;
newset.sig[0] = newset32.sig[0] | ((unsigned long)newset32.sig[1] << 32);
diff -ruN 2.5.60/arch/parisc/kernel/signal32.c 2.5.60-32bit.1/arch/parisc/kernel/signal32.c
--- 2.5.60/arch/parisc/kernel/signal32.c 2003-02-11 09:39:14.000000000 +1100
+++ 2.5.60-32bit.1/arch/parisc/kernel/signal32.c 2003-02-11 12:21:29.000000000 +1100
@@ -18,22 +18,22 @@
};
static inline void
-sigset_32to64(sigset_t *s64, sigset_t32 *s32)
+sigset_32to64(sigset_t *s64, compat_sigset_t *s32)
{
s64->sig[0] = s32->sig[0] | ((unsigned long)s32->sig[1] << 32);
}
static inline void
-sigset_64to32(sigset_t32 *s32, sigset_t *s64)
+sigset_64to32(compat_sigset_t *s32, sigset_t *s64)
{
s32->sig[0] = s64->sig[0] & 0xffffffffUL;
s32->sig[1] = (s64->sig[0] >> 32) & 0xffffffffUL;
}
static int
-put_sigset32(sigset_t32 *up, sigset_t *set, size_t sz)
+put_sigset32(compat_sigset_t *up, sigset_t *set, size_t sz)
{
- sigset_t32 s;
+ compat_sigset_t s;
if (sz != sizeof *set) panic("put_sigset32()");
sigset_64to32(&s, set);
@@ -42,9 +42,9 @@
}
static int
-get_sigset32(sigset_t32 *up, sigset_t *set, size_t sz)
+get_sigset32(compat_sigset_t *up, sigset_t *set, size_t sz)
{
- sigset_t32 s;
+ compat_sigset_t s;
int r;
if (sz != sizeof *set) panic("put_sigset32()");
@@ -56,7 +56,7 @@
return r;
}
-int sys32_rt_sigprocmask(int how, sigset_t32 *set, sigset_t32 *oset,
+int sys32_rt_sigprocmask(int how, compat_sigset_t *set, compat_sigset_t *oset,
unsigned int sigsetsize)
{
extern long sys_rt_sigprocmask(int how,
@@ -78,7 +78,7 @@
}
-int sys32_rt_sigpending(sigset_t32 *uset, unsigned int sigsetsize)
+int sys32_rt_sigpending(compat_sigset_t *uset, unsigned int sigsetsize)
{
int ret;
sigset_t set;
diff -ruN 2.5.60/arch/parisc/kernel/sys32.h 2.5.60-32bit.1/arch/parisc/kernel/sys32.h
--- 2.5.60/arch/parisc/kernel/sys32.h 2003-01-15 11:20:31.000000000 +1100
+++ 2.5.60-32bit.1/arch/parisc/kernel/sys32.h 2003-02-11 12:21:29.000000000 +1100
@@ -14,15 +14,10 @@
typedef __u32 __sighandler_t32;
-#include <linux/signal.h>
-typedef struct {
- unsigned int sig[_NSIG_WORDS * 2];
-} sigset_t32;
-
struct sigaction32 {
__sighandler_t32 sa_handler;
unsigned int sa_flags;
- sigset_t32 sa_mask; /* mask last for extensibility */
+ compat_sigset_t sa_mask; /* mask last for extensibility */
};
#endif
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH][COMPAT] outstanding compatibility changes 2/4 parisc
2003-02-12 4:29 [PATCH][COMPAT] outstanding compatibility changes 1/4 parisc Stephen Rothwell
@ 2003-02-12 4:33 ` Stephen Rothwell
2003-02-12 4:36 ` [PATCH][COMPAT] outstanding compatibility changes 3/4 sparc Stephen Rothwell
2003-02-12 4:40 ` [PATCH][COMPAT] outstanding compatibility changes 4/4 x86_64 Stephen Rothwell
2 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2003-02-12 4:33 UTC (permalink / raw)
To: Ralf Baechle; +Cc: torvalds, linux-kernel
Hi Ralf,
Here are the outstanding compatibility patches I have for mips64 against
2.5.60. Will you merge these, or should I just send them to Linus?
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN 2.5.60/arch/mips64/kernel/ioctl32.c 2.5.60-32bit.1/arch/mips64/kernel/ioctl32.c
--- 2.5.60/arch/mips64/kernel/ioctl32.c 2003-01-15 11:20:31.000000000 +1100
+++ 2.5.60-32bit.1/arch/mips64/kernel/ioctl32.c 2003-02-11 12:21:29.000000000 +1100
@@ -116,13 +116,13 @@
struct ifmap32 ifru_map;
char ifru_slave[IFNAMSIZ]; /* Just fits the size */
char ifru_newname[IFNAMSIZ];
- __kernel_caddr_t32 ifru_data;
+ compat_caddr_t ifru_data;
} ifr_ifru;
};
struct ifconf32 {
int ifc_len; /* size of buffer */
- __kernel_caddr_t32 ifcbuf;
+ compat_caddr_t ifcbuf;
};
#ifdef CONFIG_NET
@@ -433,8 +433,8 @@
__u32 mt_dsreg;
__u32 mt_gstat;
__u32 mt_erreg;
- __kernel_daddr_t32 mt_fileno;
- __kernel_daddr_t32 mt_blkno;
+ compat_daddr_t mt_fileno;
+ compat_daddr_t mt_blkno;
};
#define MTIOCGET32 _IOR('m', 2, struct mtget32)
diff -ruN 2.5.60/arch/mips64/kernel/linux32.c 2.5.60-32bit.1/arch/mips64/kernel/linux32.c
--- 2.5.60/arch/mips64/kernel/linux32.c 2003-01-02 15:13:45.000000000 +1100
+++ 2.5.60-32bit.1/arch/mips64/kernel/linux32.c 2003-02-11 12:21:29.000000000 +1100
@@ -41,9 +41,9 @@
* Revalidate the inode. This is required for proper NFS attribute caching.
*/
-static int cp_new_stat32(struct kstat *stat, struct stat32 *statbuf)
+int cp_compat_stat(struct kstat *stat, struct compat_stat *statbuf)
{
- struct stat32 tmp;
+ struct compat_stat tmp;
memset(&tmp, 0, sizeof(tmp));
tmp.st_dev = stat->dev;
@@ -62,39 +62,6 @@
return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
}
-asmlinkage int sys32_newstat(char * filename, struct stat32 *statbuf)
-{
- struct kstat stat;
- int error = vfs_stat(filename, &stat);
-
- if (!error)
- error = cp_new_stat32(&stat, statbuf);
-
- return error;
-}
-
-asmlinkage int sys32_newlstat(char * filename, struct stat32 *statbuf)
-{
- struct kstat stat;
- int error = vfs_lstat(filename, &stat);
-
- if (!error)
- error = cp_new_stat32(&stat, statbuf);
-
- return error;
-}
-
-asmlinkage long sys32_newfstat(unsigned int fd, struct stat32 * statbuf)
-{
- struct kstat stat;
- int error = vfs_fstat(fd, &stat);
-
- if (!error)
- error = cp_new_stat32(&stat, statbuf);
-
- return error;
-}
-
asmlinkage int sys_mmap2(void) {return 0;}
asmlinkage long sys_truncate(const char * path, unsigned long length);
@@ -480,7 +447,7 @@
}
asmlinkage int
-sys32_wait4(__kernel_pid_t32 pid, unsigned int * stat_addr, int options,
+sys32_wait4(compat_pid_t pid, unsigned int * stat_addr, int options,
struct rusage32 * ru)
{
if (!ru)
@@ -502,7 +469,7 @@
}
asmlinkage int
-sys32_waitpid(__kernel_pid_t32 pid, unsigned int *stat_addr, int options)
+sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr, int options)
{
return sys32_wait4(pid, stat_addr, options, NULL);
}
@@ -557,72 +524,6 @@
return ret;
}
-struct statfs32 {
- int f_type;
- int f_bsize;
- int f_frsize;
- int f_blocks;
- int f_bfree;
- int f_files;
- int f_ffree;
- int f_bavail;
- __kernel_fsid_t32 f_fsid;
- int f_namelen;
- int f_spare[6];
-};
-
-static inline int
-put_statfs (struct statfs32 *ubuf, struct statfs *kbuf)
-{
- int err;
-
- err = put_user (kbuf->f_type, &ubuf->f_type);
- err |= __put_user (kbuf->f_bsize, &ubuf->f_bsize);
- err |= __put_user (kbuf->f_blocks, &ubuf->f_blocks);
- err |= __put_user (kbuf->f_bfree, &ubuf->f_bfree);
- err |= __put_user (kbuf->f_bavail, &ubuf->f_bavail);
- err |= __put_user (kbuf->f_files, &ubuf->f_files);
- err |= __put_user (kbuf->f_ffree, &ubuf->f_ffree);
- err |= __put_user (kbuf->f_namelen, &ubuf->f_namelen);
- err |= __put_user (kbuf->f_fsid.val[0], &ubuf->f_fsid.val[0]);
- err |= __put_user (kbuf->f_fsid.val[1], &ubuf->f_fsid.val[1]);
- return err;
-}
-
-extern asmlinkage int sys_statfs(const char * path, struct statfs * buf);
-
-asmlinkage int
-sys32_statfs(const char * path, struct statfs32 *buf)
-{
- int ret;
- struct statfs s;
- mm_segment_t old_fs = get_fs();
-
- set_fs (KERNEL_DS);
- ret = sys_statfs((const char *)path, &s);
- set_fs (old_fs);
- if (put_statfs(buf, &s))
- return -EFAULT;
- return ret;
-}
-
-extern asmlinkage int sys_fstatfs(unsigned int fd, struct statfs * buf);
-
-asmlinkage int
-sys32_fstatfs(unsigned int fd, struct statfs32 *buf)
-{
- int ret;
- struct statfs s;
- mm_segment_t old_fs = get_fs();
-
- set_fs (KERNEL_DS);
- ret = sys_fstatfs(fd, &s);
- set_fs (old_fs);
- if (put_statfs(buf, &s))
- return -EFAULT;
- return ret;
-}
-
extern asmlinkage int
sys_getrusage(int who, struct rusage *ru);
@@ -1110,7 +1011,7 @@
struct timespec *interval);
asmlinkage int
-sys32_sched_rr_get_interval(__kernel_pid_t32 pid, struct compat_timespec *interval)
+sys32_sched_rr_get_interval(compat_pid_t pid, struct compat_timespec *interval)
{
struct timespec t;
int ret;
@@ -1119,42 +1020,12 @@
set_fs (KERNEL_DS);
ret = sys_sched_rr_get_interval(pid, &t);
set_fs (old_fs);
- if (put_user (t.tv_sec, &interval->tv_sec) ||
- __put_user (t.tv_nsec, &interval->tv_nsec))
+ if (put_compat_timespec(&t, interval))
return -EFAULT;
return ret;
}
-struct tms32 {
- int tms_utime;
- int tms_stime;
- int tms_cutime;
- int tms_cstime;
-};
-
-extern asmlinkage long sys_times(struct tms * tbuf);
-asmlinkage long sys32_times(struct tms32 *tbuf)
-{
- struct tms t;
- long ret;
- mm_segment_t old_fs = get_fs();
- int err;
-
- set_fs(KERNEL_DS);
- ret = sys_times(tbuf ? &t : NULL);
- set_fs(old_fs);
- if (tbuf) {
- err = put_user (t.tms_utime, &tbuf->tms_utime);
- err |= __put_user (t.tms_stime, &tbuf->tms_stime);
- err |= __put_user (t.tms_cutime, &tbuf->tms_cutime);
- err |= __put_user (t.tms_cstime, &tbuf->tms_cstime);
- if (err)
- ret = -EFAULT;
- }
- return ret;
-}
-
extern asmlinkage int sys_setsockopt(int fd, int level, int optname,
char *optval, int optlen);
@@ -1197,39 +1068,6 @@
return sys_setsockopt(fd, level, optname, optval, optlen);
}
-struct flock32 {
- short l_type;
- short l_whence;
- __kernel_off_t32 l_start;
- __kernel_off_t32 l_len;
- __kernel_pid_t32 l_pid;
- short __unused;
-};
-
-static inline int get_flock(struct flock *kfl, struct flock32 *ufl)
-{
- int err;
-
- err = get_user(kfl->l_type, &ufl->l_type);
- err |= __get_user(kfl->l_whence, &ufl->l_whence);
- err |= __get_user(kfl->l_start, &ufl->l_start);
- err |= __get_user(kfl->l_len, &ufl->l_len);
- err |= __get_user(kfl->l_pid, &ufl->l_pid);
- return err;
-}
-
-static inline int put_flock(struct flock *kfl, struct flock32 *ufl)
-{
- int err;
-
- err = __put_user(kfl->l_type, &ufl->l_type);
- err |= __put_user(kfl->l_whence, &ufl->l_whence);
- err |= __put_user(kfl->l_start, &ufl->l_start);
- err |= __put_user(kfl->l_len, &ufl->l_len);
- err |= __put_user(kfl->l_pid, &ufl->l_pid);
- return err;
-}
-
extern asmlinkage long
sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg);
@@ -1245,12 +1083,12 @@
mm_segment_t old_fs;
long ret;
- if (get_flock(&f, (struct flock32 *)arg))
+ if (get_compat_flock(&f, (struct compat_flock *)arg))
return -EFAULT;
old_fs = get_fs(); set_fs (KERNEL_DS);
ret = sys_fcntl(fd, cmd, (unsigned long)&f);
set_fs (old_fs);
- if (put_flock(&f, (struct flock32 *)arg))
+ if (put_compat_flock(&f, (struct compat_flock *)arg))
return -EFAULT;
return ret;
}
@@ -1279,11 +1117,11 @@
struct ipc_perm32
{
key_t key;
- __kernel_uid_t32 uid;
- __kernel_gid_t32 gid;
- __kernel_uid_t32 cuid;
- __kernel_gid_t32 cgid;
- __kernel_mode_t32 mode;
+ compat_uid_t uid;
+ compat_gid_t gid;
+ compat_uid_t cuid;
+ compat_gid_t cgid;
+ compat_mode_t mode;
unsigned short seq;
};
@@ -1311,8 +1149,8 @@
unsigned short msg_cbytes;
unsigned short msg_qnum;
unsigned short msg_qbytes;
- __kernel_ipc_pid_t32 msg_lspid;
- __kernel_ipc_pid_t32 msg_lrpid;
+ compat_ipc_pid_t msg_lspid;
+ compat_ipc_pid_t msg_lrpid;
};
struct shmid_ds32 {
@@ -1321,8 +1159,8 @@
compat_time_t shm_atime;
compat_time_t shm_dtime;
compat_time_t shm_ctime;
- __kernel_ipc_pid_t32 shm_cpid;
- __kernel_ipc_pid_t32 shm_lpid;
+ compat_ipc_pid_t shm_cpid;
+ compat_ipc_pid_t shm_lpid;
unsigned short shm_nattch;
};
@@ -1685,11 +1523,11 @@
struct sysctl_args32
{
- __kernel_caddr_t32 name;
+ compat_caddr_t name;
int nlen;
- __kernel_caddr_t32 oldval;
- __kernel_caddr_t32 oldlenp;
- __kernel_caddr_t32 newval;
+ compat_caddr_t oldval;
+ compat_caddr_t oldlenp;
+ compat_caddr_t newval;
compat_size_t newlen;
unsigned int __unused[4];
};
diff -ruN 2.5.60/arch/mips64/kernel/scall_o32.S 2.5.60-32bit.1/arch/mips64/kernel/scall_o32.S
--- 2.5.60/arch/mips64/kernel/scall_o32.S 2002-12-16 14:49:47.000000000 +1100
+++ 2.5.60-32bit.1/arch/mips64/kernel/scall_o32.S 2003-02-11 12:21:29.000000000 +1100
@@ -276,7 +276,7 @@
sys sys_rmdir 1 /* 4040 */
sys sys_dup 1
sys sys_pipe 0
- sys sys32_times 1
+ sys compat_sys_times 1
sys sys_ni_syscall 0
sys sys_brk 1 /* 4045 */
sys sys_setgid 1
@@ -306,7 +306,7 @@
sys sys_setreuid 2 /* 4070 */
sys sys_setregid 2
sys sys32_sigsuspend 0
- sys sys32_sigpending 1
+ sys compat_sys_sigpending 1
sys sys_sethostname 2
sys sys32_setrlimit 2 /* 4075 */
sys sys32_getrlimit 2
@@ -332,16 +332,16 @@
sys sys_getpriority 2
sys sys_setpriority 3
sys sys_ni_syscall 0
- sys sys32_statfs 2
- sys sys32_fstatfs 2 /* 4100 */
+ sys compat_sys_statfs 2
+ sys compat_sys_fstatfs 2 /* 4100 */
sys sys_ni_syscall 0 /* sys_ioperm */
sys sys_socketcall 2
sys sys_syslog 3
sys compat_sys_setitimer 3
sys compat_sys_getitimer 2 /* 4105 */
- sys sys32_newstat 2
- sys sys32_newlstat 2
- sys sys32_newfstat 2
+ sys compat_sys_newstat 2
+ sys compat_sys_newlstat 2
+ sys compat_sys_newfstat 2
sys sys_ni_syscall 0 /* was sys_uname */
sys sys_ni_syscall 0 /* sys_ioperm *//* 4110 */
sys sys_vhangup 0
@@ -359,7 +359,7 @@
sys sys_ni_syscall 0 /* sys_modify_ldt */
sys sys32_adjtimex 1
sys sys_mprotect 3 /* 4125 */
- sys sys32_sigprocmask 3
+ sys compat_sys_sigprocmask 3
sys sys_create_module 2
sys sys_init_module 5
sys sys_delete_module 1
diff -ruN 2.5.60/arch/mips64/kernel/signal32.c 2.5.60-32bit.1/arch/mips64/kernel/signal32.c
--- 2.5.60/arch/mips64/kernel/signal32.c 2003-01-02 15:13:45.000000000 +1100
+++ 2.5.60-32bit.1/arch/mips64/kernel/signal32.c 2003-02-11 12:21:29.000000000 +1100
@@ -39,20 +39,13 @@
/* 32-bit compatibility types */
-#define _NSIG32_BPW 32
-#define _NSIG32_WORDS (_NSIG / _NSIG32_BPW)
-
-typedef struct {
- unsigned int sig[_NSIG32_WORDS];
-} sigset32_t;
-
typedef unsigned int __sighandler32_t;
typedef void (*vfptr_t)(void);
struct sigaction32 {
unsigned int sa_flags;
__sighandler32_t sa_handler;
- sigset32_t sa_mask;
+ compat_sigset_t sa_mask;
unsigned int sa_restorer;
int sa_resv[1]; /* reserved */
};
@@ -98,7 +91,7 @@
extern void __get_sigset_unknown_nsig(void);
static inline int
-put_sigset(const sigset_t *kbuf, sigset32_t *ubuf)
+put_sigset(const sigset_t *kbuf, compat_sigset_t *ubuf)
{
int err = 0;
@@ -120,7 +113,7 @@
}
static inline int
-get_sigset(sigset_t *kbuf, const sigset32_t *ubuf)
+get_sigset(sigset_t *kbuf, const compat_sigset_t *ubuf)
{
int err = 0;
unsigned long sig[4];
@@ -150,11 +143,11 @@
asmlinkage inline int
sys32_sigsuspend(abi64_no_regargs, struct pt_regs regs)
{
- sigset32_t *uset;
+ compat_sigset_t *uset;
sigset_t newset, saveset;
save_static(®s);
- uset = (sigset32_t *) regs.regs[4];
+ uset = (compat_sigset_t *) regs.regs[4];
if (get_sigset(&newset, uset))
return -EFAULT;
sigdelsetmask(&newset, ~_BLOCKABLE);
@@ -178,17 +171,17 @@
asmlinkage int
sys32_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
{
- sigset32_t *uset;
+ compat_sigset_t *uset;
sigset_t newset, saveset;
size_t sigsetsize;
save_static(®s);
/* XXX Don't preclude handling different sized sigset_t's. */
sigsetsize = regs.regs[5];
- if (sigsetsize != sizeof(sigset32_t))
+ if (sigsetsize != sizeof(compat_sigset_t))
return -EINVAL;
- uset = (sigset32_t *) regs.regs[4];
+ uset = (compat_sigset_t *) regs.regs[4];
if (get_sigset(&newset, uset))
return -EFAULT;
sigdelsetmask(&newset, ~_BLOCKABLE);
@@ -701,44 +694,6 @@
return 0;
}
-extern asmlinkage int sys_sigprocmask(int how, old_sigset_t *set,
- old_sigset_t *oset);
-
-asmlinkage int sys32_sigprocmask(int how, old_sigset_t32 *set,
- old_sigset_t32 *oset)
-{
- old_sigset_t s;
- int ret;
- mm_segment_t old_fs = get_fs();
-
- if (set && get_user (s, set))
- return -EFAULT;
- set_fs (KERNEL_DS);
- ret = sys_sigprocmask(how, set ? &s : NULL, oset ? &s : NULL);
- set_fs (old_fs);
- if (!ret && oset && put_user (s, oset))
- return -EFAULT;
- return ret;
-}
-
-asmlinkage long sys_sigpending(old_sigset_t *set);
-
-asmlinkage int sys32_sigpending(old_sigset_t32 *set)
-{
- old_sigset_t pending;
- int ret;
- mm_segment_t old_fs = get_fs();
-
- set_fs (KERNEL_DS);
- ret = sys_sigpending(&pending);
- set_fs (old_fs);
-
- if (put_user(pending, set))
- return -EFAULT;
-
- return ret;
-}
-
asmlinkage int sys32_rt_sigaction(int sig, const struct sigaction32 *act,
struct sigaction32 *oact,
unsigned int sigsetsize)
@@ -789,7 +744,7 @@
asmlinkage long sys_rt_sigprocmask(int how, sigset_t *set, sigset_t *oset,
size_t sigsetsize);
-asmlinkage int sys32_rt_sigprocmask(int how, sigset32_t *set, sigset32_t *oset,
+asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t *set, compat_sigset_t *oset,
unsigned int sigsetsize)
{
sigset_t old_set, new_set;
@@ -812,7 +767,7 @@
asmlinkage long sys_rt_sigpending(sigset_t *set, size_t sigsetsize);
-asmlinkage int sys32_rt_sigpending(sigset32_t *uset, unsigned int sigsetsize)
+asmlinkage int sys32_rt_sigpending(compat_sigset_t *uset, unsigned int sigsetsize)
{
int ret;
sigset_t set;
diff -ruN 2.5.60/include/asm-mips64/compat.h 2.5.60-32bit.1/include/asm-mips64/compat.h
--- 2.5.60/include/asm-mips64/compat.h 2002-12-16 14:49:54.000000000 +1100
+++ 2.5.60-32bit.1/include/asm-mips64/compat.h 2003-02-11 12:21:29.000000000 +1100
@@ -5,14 +5,86 @@
*/
#include <linux/types.h>
+#define COMPAT_USER_HZ 100
+
typedef u32 compat_size_t;
typedef s32 compat_ssize_t;
typedef s32 compat_time_t;
-typedef s32 compat_suseconds_t;
+typedef s32 compat_clock_t;
+typedef s32 compat_pid_t;
+typedef s32 compat_uid_t;
+typedef s32 compat_gid_t;
+typedef u32 compat_mode_t;
+typedef u32 compat_ino_t;
+typedef u32 compat_dev_t;
+typedef s32 compat_off_t;
+typedef u32 compat_nlink_t;
+typedef s32 compat_ipc_pid_t;
+typedef s32 compat_daddr_t;
+typedef u32 compat_caddr_t;
+typedef __kernel_fsid_t compat_fsid_t;
struct compat_timespec {
compat_time_t tv_sec;
s32 tv_nsec;
};
+struct compat_timeval {
+ compat_time_t tv_sec;
+ s32 tv_usec;
+};
+
+struct compat_stat {
+ compat_dev_t st_dev;
+ s32 st_pad1[3];
+ compat_ino_t st_ino;
+ compat_mode_t st_mode;
+ compat_nlink_t st_nlink;
+ compat_uid_t st_uid;
+ compat_gid_t st_gid;
+ compat_dev_t st_rdev;
+ s32 st_pad2[2];
+ compat_off_t st_size;
+ s32 st_pad3;
+ compat_time_t st_atime;
+ s32 reserved0;
+ compat_time_t st_mtime;
+ s32 reserved1;
+ compat_time_t st_ctime;
+ s32 reserved2;
+ s32 st_blksize;
+ s32 st_blocks;
+ s32 st_pad4[14];
+};
+
+struct compat_flock {
+ short l_type;
+ short l_whence;
+ compat_off_t l_start;
+ compat_off_t l_len;
+ compat_pid_t l_pid;
+ short __unused;
+};
+
+struct compat_statfs {
+ int f_type;
+ int f_bsize;
+ int f_frsize;
+ int f_blocks;
+ int f_bfree;
+ int f_files;
+ int f_ffree;
+ int f_bavail;
+ compat_fsid_t f_fsid;
+ int f_namelen;
+ int f_spare[6];
+};
+
+typedef u32 compat_old_sigset_t;
+
+#define _COMPAT_NSIG 128
+#define _COMPAT_NSIG_BPW 32
+
+typedef u32 compat_sigset_word;
+
#endif /* _ASM_MIPS64_COMPAT_H */
diff -ruN 2.5.60/include/asm-mips64/posix_types.h 2.5.60-32bit.1/include/asm-mips64/posix_types.h
--- 2.5.60/include/asm-mips64/posix_types.h 2002-12-16 14:49:54.000000000 +1100
+++ 2.5.60-32bit.1/include/asm-mips64/posix_types.h 2003-02-11 12:21:29.000000000 +1100
@@ -48,23 +48,6 @@
int val[2];
} __kernel_fsid_t;
-/* Now 32bit compatibility types */
-typedef unsigned int __kernel_dev_t32;
-typedef unsigned int __kernel_ino_t32;
-typedef unsigned int __kernel_mode_t32;
-typedef unsigned int __kernel_nlink_t32;
-typedef int __kernel_off_t32;
-typedef int __kernel_pid_t32;
-typedef int __kernel_ipc_pid_t32;
-typedef int __kernel_uid_t32;
-typedef int __kernel_gid_t32;
-typedef int __kernel_ptrdiff_t32;
-typedef int __kernel_suseconds_t32;
-typedef int __kernel_clock_t32;
-typedef int __kernel_daddr_t32;
-typedef unsigned int __kernel_caddr_t32;
-typedef __kernel_fsid_t __kernel_fsid_t32;
-
#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
#undef __FD_SET
diff -ruN 2.5.60/include/asm-mips64/signal.h 2.5.60-32bit.1/include/asm-mips64/signal.h
--- 2.5.60/include/asm-mips64/signal.h 2003-02-11 09:39:59.000000000 +1100
+++ 2.5.60-32bit.1/include/asm-mips64/signal.h 2003-02-11 12:21:29.000000000 +1100
@@ -20,7 +20,6 @@
} sigset_t;
typedef unsigned long old_sigset_t; /* at least 32 bits */
-typedef unsigned int old_sigset_t32;
#define SIGHUP 1 /* Hangup (POSIX). */
#define SIGINT 2 /* Interrupt (ANSI). */
diff -ruN 2.5.60/include/asm-mips64/stat.h 2.5.60-32bit.1/include/asm-mips64/stat.h
--- 2.5.60/include/asm-mips64/stat.h 2002-12-16 14:49:54.000000000 +1100
+++ 2.5.60-32bit.1/include/asm-mips64/stat.h 2003-02-11 12:21:29.000000000 +1100
@@ -10,7 +10,6 @@
#define _ASM_STAT_H
#include <linux/types.h>
-#include <linux/compat.h>
struct __old_kernel_stat {
unsigned int st_dev;
@@ -29,29 +28,6 @@
unsigned int st_unused[2];
};
-struct stat32 {
- __kernel_dev_t32 st_dev;
- int st_pad1[3];
- __kernel_ino_t32 st_ino;
- __kernel_mode_t32 st_mode;
- __kernel_nlink_t32 st_nlink;
- __kernel_uid_t32 st_uid;
- __kernel_gid_t32 st_gid;
- __kernel_dev_t32 st_rdev;
- int st_pad2[2];
- __kernel_off_t32 st_size;
- int st_pad3;
- compat_time_t st_atime;
- int reserved0;
- compat_time_t st_mtime;
- int reserved1;
- compat_time_t st_ctime;
- int reserved2;
- int st_blksize;
- int st_blocks;
- int st_pad4[14];
-};
-
/* The memory layout is the same as of struct stat64 of the 32-bit kernel. */
struct stat {
dev_t st_dev;
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH][COMPAT] outstanding compatibility changes 3/4 sparc
2003-02-12 4:29 [PATCH][COMPAT] outstanding compatibility changes 1/4 parisc Stephen Rothwell
2003-02-12 4:33 ` [PATCH][COMPAT] outstanding compatibility changes 2/4 parisc Stephen Rothwell
@ 2003-02-12 4:36 ` Stephen Rothwell
2003-02-12 4:26 ` David S. Miller
2003-02-12 4:40 ` [PATCH][COMPAT] outstanding compatibility changes 4/4 x86_64 Stephen Rothwell
2 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2003-02-12 4:36 UTC (permalink / raw)
To: Dave Miller; +Cc: torvalds, linux-kernel
Hi Dave,
These are the outstanding compatibility patches I have for sparc64 against
2.5.60. I am not sure whether you dropped these deliberately or not.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN 2.5.60/arch/sparc64/kernel/sys_sparc32.c 2.5.60-32bit.1/arch/sparc64/kernel/sys_sparc32.c
--- 2.5.60/arch/sparc64/kernel/sys_sparc32.c 2003-02-11 09:39:18.000000000 +1100
+++ 2.5.60-32bit.1/arch/sparc64/kernel/sys_sparc32.c 2003-02-11 12:21:29.000000000 +1100
@@ -1679,23 +1679,6 @@
return ret;
}
-extern asmlinkage int sys_sigprocmask(int how, old_sigset_t *set, old_sigset_t *oset);
-
-asmlinkage int sys32_sigprocmask(int how, compat_old_sigset_t *set, compat_old_sigset_t *oset)
-{
- old_sigset_t s;
- int ret;
- mm_segment_t old_fs = get_fs();
-
- if (set && get_user (s, set)) return -EFAULT;
- set_fs (KERNEL_DS);
- ret = sys_sigprocmask(how, set ? &s : NULL, oset ? &s : NULL);
- set_fs (old_fs);
- if (ret) return ret;
- if (oset && put_user (s, oset)) return -EFAULT;
- return 0;
-}
-
extern asmlinkage int sys_rt_sigprocmask(int how, sigset_t *set, sigset_t *oset, size_t sigsetsize);
asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t *set, compat_sigset_t *oset, compat_size_t sigsetsize)
@@ -1732,21 +1715,6 @@
return 0;
}
-extern asmlinkage int sys_sigpending(old_sigset_t *set);
-
-asmlinkage int sys32_sigpending(compat_old_sigset_t *set)
-{
- old_sigset_t s;
- int ret;
- mm_segment_t old_fs = get_fs();
-
- set_fs (KERNEL_DS);
- ret = sys_sigpending(&s);
- set_fs (old_fs);
- if (put_user (s, set)) return -EFAULT;
- return ret;
-}
-
extern asmlinkage int sys_rt_sigpending(sigset_t *set, size_t sigsetsize);
asmlinkage int sys32_rt_sigpending(compat_sigset_t *set, compat_size_t sigsetsize)
diff -ruN 2.5.60/arch/sparc64/kernel/systbls.S 2.5.60-32bit.1/arch/sparc64/kernel/systbls.S
--- 2.5.60/arch/sparc64/kernel/systbls.S 2003-02-11 09:39:18.000000000 +1100
+++ 2.5.60-32bit.1/arch/sparc64/kernel/systbls.S 2003-02-11 12:21:29.000000000 +1100
@@ -55,7 +55,7 @@
.word sys_quotactl, sys_set_tid_address, sys32_mount, sys_ustat, sys_setxattr
/*170*/ .word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys32_getdents
.word sys_setsid, sys_fchdir, sys_fgetxattr, sys_listxattr, sys_llistxattr
-/*180*/ .word sys_flistxattr, sys_removexattr, sys_lremovexattr, sys32_sigpending, sys_ni_syscall
+/*180*/ .word sys_flistxattr, sys_removexattr, sys_lremovexattr, compat_sys_sigpending, sys_ni_syscall
.word sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sparc64_newuname
/*190*/ .word sys32_init_module, sparc64_personality, sys_remap_file_pages, sys_epoll_create, sys_epoll_ctl
.word sys_epoll_wait, sys_nis_syscall, sys_getppid, sys32_sigaction, sys_sgetmask
@@ -63,7 +63,7 @@
.word sys32_readahead, sys32_socketcall, sys_syslog, sys32_lookup_dcookie, sys_nis_syscall
/*210*/ .word sys_nis_syscall, sys_nis_syscall, sys_waitpid, sys_swapoff, sys32_sysinfo
.word sys32_ipc, sys32_sigreturn, sys_clone, sys_nis_syscall, sys32_adjtimex
-/*220*/ .word sys32_sigprocmask, sys_ni_syscall, sys32_delete_module, sys_ni_syscall, sys_getpgid
+/*220*/ .word compat_sys_sigprocmask, sys_ni_syscall, sys32_delete_module, sys_ni_syscall, sys_getpgid
.word sys32_bdflush, sys32_sysfs, sys_nis_syscall, sys32_setfsuid16, sys32_setfsgid16
/*230*/ .word sys32_select, sys_time, sys_nis_syscall, sys_stime, sys_ni_syscall
.word sys_ni_syscall, sys_llseek, sys_mlock, sys_munlock, sys_mlockall
@@ -203,7 +203,7 @@
.word sunos_nosys, sunos_getdents, sys_setsid
.word sys_fchdir, sunos_nosys, sunos_nosys
.word sunos_nosys, sunos_nosys, sunos_nosys
- .word sunos_nosys, sys32_sigpending, sunos_nosys
+ .word sunos_nosys, compat_sys_sigpending, sunos_nosys
.word sys_setpgid, sunos_pathconf, sunos_fpathconf
.word sunos_sysconf, sunos_uname, sunos_nosys
.word sunos_nosys, sunos_nosys, sunos_nosys
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH][COMPAT] outstanding compatibility changes 4/4 x86_64
2003-02-12 4:29 [PATCH][COMPAT] outstanding compatibility changes 1/4 parisc Stephen Rothwell
2003-02-12 4:33 ` [PATCH][COMPAT] outstanding compatibility changes 2/4 parisc Stephen Rothwell
2003-02-12 4:36 ` [PATCH][COMPAT] outstanding compatibility changes 3/4 sparc Stephen Rothwell
@ 2003-02-12 4:40 ` Stephen Rothwell
2 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2003-02-12 4:40 UTC (permalink / raw)
To: Linus; +Cc: linux-kernel, Andi Kleen
Hi Linus,
Andi has asked that I send these straight forward compatibility patches to
you and he will fix up any merge problems later. So here are the
outstanding patches for x86_64 against 2.5.60.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN 2.5.60/arch/x86_64/ia32/ia32_signal.c 2.5.60-32bit.1/arch/x86_64/ia32/ia32_signal.c
--- 2.5.60/arch/x86_64/ia32/ia32_signal.c 2003-02-11 09:39:21.000000000 +1100
+++ 2.5.60-32bit.1/arch/x86_64/ia32/ia32_signal.c 2003-02-11 12:21:29.000000000 +1100
@@ -22,6 +22,7 @@
#include <linux/unistd.h>
#include <linux/stddef.h>
#include <linux/personality.h>
+#include <linux/compat.h>
#include <asm/ucontext.h>
#include <asm/uaccess.h>
#include <asm/i387.h>
@@ -134,7 +135,7 @@
int sig;
struct sigcontext_ia32 sc;
struct _fpstate_ia32 fpstate;
- unsigned int extramask[_IA32_NSIG_WORDS-1];
+ unsigned int extramask[_COMPAT_NSIG_WORDS-1];
char retcode[8];
};
@@ -237,7 +238,7 @@
if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
goto badframe;
if (__get_user(set.sig[0], &frame->sc.oldmask)
- || (_IA32_NSIG_WORDS > 1
+ || (_COMPAT_NSIG_WORDS > 1
&& __copy_from_user((((char *) &set.sig) + 4), &frame->extramask,
sizeof(frame->extramask))))
goto badframe;
@@ -373,7 +374,7 @@
}
void ia32_setup_frame(int sig, struct k_sigaction *ka,
- sigset32_t *set, struct pt_regs * regs)
+ compat_sigset_t *set, struct pt_regs * regs)
{
struct sigframe *frame;
int err = 0;
@@ -399,7 +400,7 @@
if (err)
goto give_sigsegv;
- if (_IA32_NSIG_WORDS > 1) {
+ if (_COMPAT_NSIG_WORDS > 1) {
err |= __copy_to_user(frame->extramask, &set->sig[1],
sizeof(frame->extramask));
}
@@ -460,7 +461,7 @@
}
void ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
- sigset32_t *set, struct pt_regs * regs)
+ compat_sigset_t *set, struct pt_regs * regs)
{
struct rt_sigframe *frame;
int err = 0;
diff -ruN 2.5.60/arch/x86_64/ia32/ia32entry.S 2.5.60-32bit.1/arch/x86_64/ia32/ia32entry.S
--- 2.5.60/arch/x86_64/ia32/ia32entry.S 2003-01-17 14:01:02.000000000 +1100
+++ 2.5.60-32bit.1/arch/x86_64/ia32/ia32entry.S 2003-02-11 12:21:29.000000000 +1100
@@ -273,7 +273,7 @@
.quad sys_setreuid16 /* 70 */
.quad sys_setregid16
.quad stub32_sigsuspend
- .quad sys32_sigpending
+ .quad compat_sys_sigpending
.quad sys_sethostname
.quad sys32_setrlimit /* 75 */
.quad sys32_old_getrlimit /* old_getrlimit */
@@ -326,7 +326,7 @@
.quad sys32_modify_ldt
.quad sys32_adjtimex
.quad sys32_mprotect /* 125 */
- .quad sys32_sigprocmask
+ .quad compat_sys_sigprocmask
.quad sys32_module_warning /* create_module */
.quad sys_init_module
.quad sys_delete_module
diff -ruN 2.5.60/arch/x86_64/ia32/ipc32.c 2.5.60-32bit.1/arch/x86_64/ia32/ipc32.c
--- 2.5.60/arch/x86_64/ia32/ipc32.c 2003-01-09 16:23:55.000000000 +1100
+++ 2.5.60-32bit.1/arch/x86_64/ia32/ipc32.c 2003-02-11 12:21:29.000000000 +1100
@@ -626,9 +626,7 @@
return -E2BIG;
if (!access_ok(VERIFY_READ, sb, nsops * sizeof(struct sembuf)))
return -EFAULT;
- if (ts32 &&
- (get_user(ts.tv_sec, &ts32->tv_sec) ||
- __get_user(ts.tv_nsec, &ts32->tv_nsec)))
+ if (ts32 && get_compat_timespec(&ts, ts32))
return -EFAULT;
set_fs(KERNEL_DS);
diff -ruN 2.5.60/arch/x86_64/ia32/sys_ia32.c 2.5.60-32bit.1/arch/x86_64/ia32/sys_ia32.c
--- 2.5.60/arch/x86_64/ia32/sys_ia32.c 2003-01-17 14:01:02.000000000 +1100
+++ 2.5.60-32bit.1/arch/x86_64/ia32/sys_ia32.c 2003-02-11 12:21:29.000000000 +1100
@@ -276,10 +276,10 @@
{
struct k_sigaction new_ka, old_ka;
int ret;
- sigset32_t set32;
+ compat_sigset_t set32;
/* XXX: Don't preclude handling different sized sigset_t's. */
- if (sigsetsize != sizeof(sigset32_t))
+ if (sigsetsize != sizeof(compat_sigset_t))
return -EINVAL;
if (act) {
@@ -287,10 +287,10 @@
__get_user((long)new_ka.sa.sa_handler, &act->sa_handler) ||
__get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
__get_user((long)new_ka.sa.sa_restorer, &act->sa_restorer)||
- __copy_from_user(&set32, &act->sa_mask, sizeof(sigset32_t)))
+ __copy_from_user(&set32, &act->sa_mask, sizeof(compat_sigset_t)))
return -EFAULT;
- /* FIXME: here we rely on _IA32_NSIG_WORS to be >= than _NSIG_WORDS << 1 */
+ /* FIXME: here we rely on _COMPAT_NSIG_WORS to be >= than _NSIG_WORDS << 1 */
switch (_NSIG_WORDS) {
case 4: new_ka.sa.sa_mask.sig[3] = set32.sig[6]
| (((long)set32.sig[7]) << 32);
@@ -306,7 +306,7 @@
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
if (!ret && oact) {
- /* FIXME: here we rely on _IA32_NSIG_WORS to be >= than _NSIG_WORDS << 1 */
+ /* FIXME: here we rely on _COMPAT_NSIG_WORS to be >= than _NSIG_WORDS << 1 */
switch (_NSIG_WORDS) {
case 4:
set32.sig[7] = (old_ka.sa.sa_mask.sig[3] >> 32);
@@ -325,7 +325,7 @@
__put_user((long)old_ka.sa.sa_handler, &oact->sa_handler) ||
__put_user((long)old_ka.sa.sa_restorer, &oact->sa_restorer) ||
__put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
- __copy_to_user(&oact->sa_mask, &set32, sizeof(sigset32_t)))
+ __copy_to_user(&oact->sa_mask, &set32, sizeof(compat_sigset_t)))
return -EFAULT;
}
@@ -339,7 +339,7 @@
int ret;
if (act) {
- old_sigset32_t mask;
+ compat_old_sigset_t mask;
if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
__get_user((long)new_ka.sa.sa_handler, &act->sa_handler) ||
@@ -368,16 +368,16 @@
size_t sigsetsize);
asmlinkage long
-sys32_rt_sigprocmask(int how, sigset32_t *set, sigset32_t *oset,
+sys32_rt_sigprocmask(int how, compat_sigset_t *set, compat_sigset_t *oset,
unsigned int sigsetsize)
{
sigset_t s;
- sigset32_t s32;
+ compat_sigset_t s32;
int ret;
mm_segment_t old_fs = get_fs();
if (set) {
- if (copy_from_user (&s32, set, sizeof(sigset32_t)))
+ if (copy_from_user (&s32, set, sizeof(compat_sigset_t)))
return -EFAULT;
switch (_NSIG_WORDS) {
case 4: s.sig[3] = s32.sig[6] | (((long)s32.sig[7]) << 32);
@@ -398,7 +398,7 @@
case 2: s32.sig[3] = (s.sig[1] >> 32); s32.sig[2] = s.sig[1];
case 1: s32.sig[1] = (s.sig[0] >> 32); s32.sig[0] = s.sig[0];
}
- if (copy_to_user (oset, &s32, sizeof(sigset32_t)))
+ if (copy_to_user (oset, &s32, sizeof(compat_sigset_t)))
return -EFAULT;
}
return 0;
@@ -1219,55 +1219,18 @@
set_fs (KERNEL_DS);
ret = sys_sched_rr_get_interval(pid, &t);
set_fs (old_fs);
- if (verify_area(VERIFY_WRITE, interval, sizeof(struct compat_timespec)) ||
- __put_user (t.tv_sec, &interval->tv_sec) ||
- __put_user (t.tv_nsec, &interval->tv_nsec))
+ if (put_compat_timespec(&t, interval))
return -EFAULT;
return ret;
}
-extern asmlinkage long sys_sigprocmask(int how, old_sigset_t *set,
- old_sigset_t *oset);
-
-asmlinkage long
-sys32_sigprocmask(int how, old_sigset32_t *set, old_sigset32_t *oset)
-{
- old_sigset_t s;
- int ret;
- mm_segment_t old_fs = get_fs();
-
- if (set && get_user (s, set)) return -EFAULT;
- set_fs (KERNEL_DS);
- ret = sys_sigprocmask(how, set ? &s : NULL, oset ? &s : NULL);
- set_fs (old_fs);
- if (ret) return ret;
- if (oset && put_user (s, oset)) return -EFAULT;
- return 0;
-}
-
-extern asmlinkage long sys_sigpending(old_sigset_t *set);
-
-asmlinkage long
-sys32_sigpending(old_sigset32_t *set)
-{
- old_sigset_t s;
- int ret;
- mm_segment_t old_fs = get_fs();
-
- set_fs (KERNEL_DS);
- ret = sys_sigpending(&s);
- set_fs (old_fs);
- if (put_user (s, set)) return -EFAULT;
- return ret;
-}
-
extern asmlinkage long sys_rt_sigpending(sigset_t *set, size_t sigsetsize);
asmlinkage long
-sys32_rt_sigpending(sigset32_t *set, compat_size_t sigsetsize)
+sys32_rt_sigpending(compat_sigset_t *set, compat_size_t sigsetsize)
{
sigset_t s;
- sigset32_t s32;
+ compat_sigset_t s32;
int ret;
mm_segment_t old_fs = get_fs();
@@ -1281,7 +1244,7 @@
case 2: s32.sig[3] = (s.sig[1] >> 32); s32.sig[2] = s.sig[1];
case 1: s32.sig[1] = (s.sig[0] >> 32); s32.sig[0] = s.sig[0];
}
- if (copy_to_user (set, &s32, sizeof(sigset32_t)))
+ if (copy_to_user (set, &s32, sizeof(compat_sigset_t)))
return -EFAULT;
}
return ret;
@@ -1369,18 +1332,18 @@
const struct timespec *uts, size_t sigsetsize);
asmlinkage long
-sys32_rt_sigtimedwait(sigset32_t *uthese, siginfo_t32 *uinfo,
+sys32_rt_sigtimedwait(compat_sigset_t *uthese, siginfo_t32 *uinfo,
struct compat_timespec *uts, compat_size_t sigsetsize)
{
sigset_t s;
- sigset32_t s32;
+ compat_sigset_t s32;
struct timespec t;
int ret;
mm_segment_t old_fs = get_fs();
siginfo_t info;
siginfo_t32 info32;
- if (copy_from_user (&s32, uthese, sizeof(sigset32_t)))
+ if (copy_from_user (&s32, uthese, sizeof(compat_sigset_t)))
return -EFAULT;
switch (_NSIG_WORDS) {
case 4: s.sig[3] = s32.sig[6] | (((long)s32.sig[7]) << 32);
@@ -1388,14 +1351,11 @@
case 2: s.sig[1] = s32.sig[2] | (((long)s32.sig[3]) << 32);
case 1: s.sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32);
}
- if (uts) {
- if (verify_area(VERIFY_READ, uts, sizeof(struct compat_timespec)) ||
- __get_user (t.tv_sec, &uts->tv_sec) ||
- __get_user (t.tv_nsec, &uts->tv_nsec))
- return -EFAULT;
- }
+ if (uts && get_compat_timespec(&t, uts))
+ return -EFAULT;
set_fs (KERNEL_DS);
- ret = sys_rt_sigtimedwait(&s, &info, &t, sigsetsize);
+ ret = sys_rt_sigtimedwait(&s, uinfo ? &info : NULL, uts ? &t : NULL,
+ sigsetsize);
set_fs (old_fs);
if (ret >= 0 && uinfo) {
if (copy_to_user (uinfo, siginfo64to32(&info32, &info),
@@ -2248,20 +2208,13 @@
mm_segment_t oldfs = get_fs();
int err;
- if (utime32) {
- if (verify_area(VERIFY_READ, utime32, sizeof(*utime32)))
- return -EFAULT;
-
- if (__get_user(t.tv_sec, &utime32->tv_sec) ||
- __get_user(t.tv_nsec, &utime32->tv_nsec))
- return -EFAULT;
-
- }
+ if (utime32 && get_compat_timespec(&t, utime32))
+ return -EFAULT;
/* the set_fs is safe because futex doesn't use the seg limit
for valid page checking of uaddr. */
set_fs(KERNEL_DS);
- err = sys_futex(uaddr, op, val, &t);
+ err = sys_futex(uaddr, op, val, utime32 ? &t : NULL);
set_fs(oldfs);
return err;
}
@@ -2340,22 +2293,18 @@
{
long ret;
mm_segment_t oldfs;
- struct timespec t32;
+ struct timespec t;
/* Harden against bogus ptrace */
if (nr >= 0xffffffff ||
!access_ok(VERIFY_WRITE, events, nr * sizeof(struct io_event)))
return -EFAULT;
- if (timeout &&
- (get_user(t32.tv_sec, &timeout->tv_sec) ||
- __get_user(t32.tv_nsec, &timeout->tv_nsec)))
+ if (timeout && get_compat_timespec(&t, timeout))
return -EFAULT;
oldfs = get_fs();
set_fs(KERNEL_DS);
- ret = sys_io_getevents(ctx_id,min_nr,nr,events,timeout ? &t32 : NULL);
+ ret = sys_io_getevents(ctx_id,min_nr,nr,events,timeout ? &t : NULL);
set_fs(oldfs);
- if (timeout &&
- (__put_user(t32.tv_sec, &timeout->tv_sec) ||
- __put_user(t32.tv_nsec, &timeout->tv_nsec)))
+ if (timeout && put_compat_timespec(&t, timeout))
return -EFAULT;
return ret;
}
diff -ruN 2.5.60/include/asm-x86_64/ia32.h 2.5.60-32bit.1/include/asm-x86_64/ia32.h
--- 2.5.60/include/asm-x86_64/ia32.h 2003-01-17 14:01:07.000000000 +1100
+++ 2.5.60-32bit.1/include/asm-x86_64/ia32.h 2003-02-11 12:21:29.000000000 +1100
@@ -26,28 +26,18 @@
#include <asm/sigcontext32.h>
/* signal.h */
-#define _IA32_NSIG 64
-#define _IA32_NSIG_BPW 32
-#define _IA32_NSIG_WORDS (_IA32_NSIG / _IA32_NSIG_BPW)
-
-typedef struct {
- unsigned int sig[_IA32_NSIG_WORDS];
-} sigset32_t;
-
struct sigaction32 {
unsigned int sa_handler; /* Really a pointer, but need to deal
with 32 bits */
unsigned int sa_flags;
unsigned int sa_restorer; /* Another 32 bit pointer */
- sigset32_t sa_mask; /* A 32 bit mask */
+ compat_sigset_t sa_mask; /* A 32 bit mask */
};
-typedef unsigned int old_sigset32_t; /* at least 32 bits */
-
struct old_sigaction32 {
unsigned int sa_handler; /* Really a pointer, but need to deal
with 32 bits */
- old_sigset32_t sa_mask; /* A 32 bit mask */
+ compat_old_sigset_t sa_mask; /* A 32 bit mask */
unsigned int sa_flags;
unsigned int sa_restorer; /* Another 32 bit pointer */
};
@@ -63,7 +53,7 @@
unsigned int uc_link;
stack_ia32_t uc_stack;
struct sigcontext_ia32 uc_mcontext;
- sigset32_t uc_sigmask; /* mask last for extensibility */
+ compat_sigset_t uc_sigmask; /* mask last for extensibility */
};
/* This matches struct stat64 in glibc2.2, hence the absolutely
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-02-12 4:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-12 4:29 [PATCH][COMPAT] outstanding compatibility changes 1/4 parisc Stephen Rothwell
2003-02-12 4:33 ` [PATCH][COMPAT] outstanding compatibility changes 2/4 parisc Stephen Rothwell
2003-02-12 4:36 ` [PATCH][COMPAT] outstanding compatibility changes 3/4 sparc Stephen Rothwell
2003-02-12 4:26 ` David S. Miller
2003-02-12 4:40 ` [PATCH][COMPAT] outstanding compatibility changes 4/4 x86_64 Stephen Rothwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox