linux-cvs-patches
[Top] [All Lists]

CVS Update@linux-mips.org: linux

To: linux-cvs-patches@linux-mips.org
Subject: CVS Update@linux-mips.org: linux
From: ralf@linux-mips.org
Date: Wed, 16 Feb 2005 21:25:09 +0000
Reply-to: linux-mips@linux-mips.org
Sender: linux-cvs-patches-bounce@linux-mips.org
CVSROOT:        /home/cvs
Module name:    linux
Changes by:     ralf@ftp.linux-mips.org 05/02/16 21:25:03

Modified files:
        arch/mips/kernel: linux32.c scall64-n32.S scall64-o32.S 

Log message:
        32-bit compatibility for various timer-related system calls.

diff -urN linux/arch/mips/kernel/linux32.c linux/arch/mips/kernel/linux32.c
--- linux/arch/mips/kernel/linux32.c    2005/02/16 21:21:29     1.26
+++ linux/arch/mips/kernel/linux32.c    2005/02/16 21:25:03     1.27
@@ -1421,3 +1421,53 @@
        }
        return err;
 }
+
+struct sigevent32 { 
+       u32 sigev_value;
+       u32 sigev_signo; 
+       u32 sigev_notify; 
+       u32 payload[(64 / 4) - 3]; 
+}; 
+
+extern asmlinkage long
+sys_timer_create(clockid_t which_clock,
+                struct sigevent __user *timer_event_spec,
+                timer_t __user * created_timer_id);
+
+long
+sys32_timer_create(u32 clock, struct sigevent32 __user *se32, timer_t __user 
*timer_id)
+{
+       struct sigevent __user *p = NULL;
+       if (se32) { 
+               struct sigevent se;
+               p = compat_alloc_user_space(sizeof(struct sigevent));
+               memset(&se, 0, sizeof(struct sigevent)); 
+               if (get_user(se.sigev_value.sival_int,  &se32->sigev_value) ||
+                   __get_user(se.sigev_signo, &se32->sigev_signo) ||
+                   __get_user(se.sigev_notify, &se32->sigev_notify) ||
+                   __copy_from_user(&se._sigev_un._pad, &se32->payload, 
+                                    sizeof(se32->payload)) ||
+                   copy_to_user(p, &se, sizeof(se)))
+                       return -EFAULT;
+       } 
+       return sys_timer_create(clock, p, timer_id);
+} 
+
+asmlinkage long
+sysn32_rt_sigtimedwait(const sigset_t __user *uthese,
+                      siginfo_t __user *uinfo,
+                      const struct compat_timespec __user *uts32,
+                      size_t sigsetsize)
+{
+       struct timespec __user *uts = NULL;
+
+       if (uts32) {
+               struct timespec ts;
+               uts = compat_alloc_user_space(sizeof(struct timespec));
+               if (get_user(ts.tv_sec, &uts32->tv_sec) ||
+                   get_user(ts.tv_nsec, &uts32->tv_nsec) ||
+                   copy_to_user (uts, &ts, sizeof (ts)))
+                       return -EFAULT;
+       }
+       return sys_rt_sigtimedwait(uthese, uinfo, uts, sigsetsize);
+}
diff -urN linux/arch/mips/kernel/scall64-n32.S 
linux/arch/mips/kernel/scall64-n32.S
--- linux/arch/mips/kernel/scall64-n32.S        2005/02/16 21:21:30     1.27
+++ linux/arch/mips/kernel/scall64-n32.S        2005/02/16 21:25:03     1.28
@@ -243,8 +243,8 @@
        PTR     sys_capget
        PTR     sys_capset
        PTR     sys32_rt_sigpending             /* 6125 */
-       PTR     compat_sys_rt_sigtimedwait
-       PTR     sys32_rt_sigqueueinfo
+       PTR     sysn32_rt_sigtimedwait
+       PTR     sys_rt_sigqueueinfo
        PTR     sys32_rt_sigsuspend
        PTR     sys32_sigaltstack
        PTR     compat_sys_utime                /* 6130 */
@@ -337,15 +337,15 @@
        PTR     compat_sys_statfs64
        PTR     compat_sys_fstatfs64
        PTR     sys_sendfile64
-       PTR     sys_timer_create                /* 6220 */
-       PTR     sys_timer_settime
-       PTR     sys_timer_gettime
+       PTR     sys32_timer_create              /* 6220 */
+       PTR     compat_sys_timer_settime
+       PTR     compat_sys_timer_gettime
        PTR     sys_timer_getoverrun
        PTR     sys_timer_delete
-       PTR     sys_clock_settime               /* 6225 */
-       PTR     sys_clock_gettime
-       PTR     sys_clock_getres
-       PTR     sys_clock_nanosleep
+       PTR     compat_sys_clock_settime                /* 6225 */
+       PTR     compat_sys_clock_gettime
+       PTR     compat_sys_clock_getres
+       PTR     compat_sys_clock_nanosleep
        PTR     sys_tgkill
        PTR     compat_sys_utimes               /* 6230 */
        PTR     sys_ni_syscall                  /* sys_mbind */
diff -urN linux/arch/mips/kernel/scall64-o32.S 
linux/arch/mips/kernel/scall64-o32.S
--- linux/arch/mips/kernel/scall64-o32.S        2005/02/16 21:21:30     1.34
+++ linux/arch/mips/kernel/scall64-o32.S        2005/02/16 21:25:03     1.35
@@ -459,7 +459,7 @@
        PTR     sys_fadvise64_64
        PTR     compat_sys_statfs64             /* 4255 */
        PTR     compat_sys_fstatfs64
-       PTR     sys_timer_create
+       PTR     sys32_timer_create
        PTR     compat_sys_timer_settime
        PTR     compat_sys_timer_gettime
        PTR     sys_timer_getoverrun            /* 4260 */

<Prev in Thread] Current Thread [Next in Thread>