vserver 1.9.5.x5
[linux-2.6.git] / arch / ppc64 / kernel / syscalls.c
index 4ae0825..3659871 100644 (file)
@@ -57,7 +57,8 @@ check_bugs(void)
  * This is really horribly ugly.
  */
 asmlinkage int 
-sys_ipc (uint call, int first, int second, long third, void __user *ptr, long fifth)
+sys_ipc (uint call, int first, unsigned long second, long third,
+        void __user *ptr, long fifth)
 {
        int version, ret;
 
@@ -67,15 +68,16 @@ sys_ipc (uint call, int first, int second, long third, void __user *ptr, long fi
        ret = -ENOSYS;
        switch (call) {
        case SEMOP:
-               ret = sys_semtimedop (first, (struct sembuf __user *)ptr, second,
-                                     NULL);
+               ret = sys_semtimedop(first, (struct sembuf __user *)ptr,
+                                     (unsigned)second, NULL);
                break;
        case SEMTIMEDOP:
-               ret = sys_semtimedop (first, (struct sembuf __user *)ptr, second,
+               ret = sys_semtimedop(first, (struct sembuf __user *)ptr,
+                                     (unsigned)second,
                                      (const struct timespec __user *) fifth);
                break;
        case SEMGET:
-               ret = sys_semget (first, second, third);
+               ret = sys_semget (first, (int)second, third);
                break;
        case SEMCTL: {
                union semun fourth;
@@ -85,11 +87,12 @@ sys_ipc (uint call, int first, int second, long third, void __user *ptr, long fi
                        break;
                if ((ret = get_user(fourth.__pad, (void __user * __user *)ptr)))
                        break;
-               ret = sys_semctl (first, second, third, fourth);
+               ret = sys_semctl(first, (int)second, third, fourth);
                break;
        }
        case MSGSND:
-               ret = sys_msgsnd (first, (struct msgbuf __user *) ptr, second, third);
+               ret = sys_msgsnd(first, (struct msgbuf __user *)ptr,
+                                 (size_t)second, third);
                break;
        case MSGRCV:
                switch (version) {
@@ -103,27 +106,29 @@ sys_ipc (uint call, int first, int second, long third, void __user *ptr, long fi
                                                (struct ipc_kludge __user *) ptr,
                                                sizeof (tmp)) ? -EFAULT : 0))
                                break;
-                       ret = sys_msgrcv (first, tmp.msgp, second, tmp.msgtyp,
-                                         third);
+                       ret = sys_msgrcv(first, tmp.msgp, (size_t) second,
+                                         tmp.msgtyp, third);
                        break;
                }
                default:
                        ret = sys_msgrcv (first, (struct msgbuf __user *) ptr,
-                                         second, fifth, third);
+                                         (size_t)second, fifth, third);
                        break;
                }
                break;
        case MSGGET:
-               ret = sys_msgget ((key_t) first, second);
+               ret = sys_msgget ((key_t)first, (int)second);
                break;
        case MSGCTL:
-               ret = sys_msgctl (first, second, (struct msqid_ds __user *) ptr);
+               ret = sys_msgctl(first, (int)second,
+                                 (struct msqid_ds __user *)ptr);
                break;
        case SHMAT:
                switch (version) {
                default: {
                        ulong raddr;
-                       ret = do_shmat (first, (char __user *) ptr, second, &raddr);
+                       ret = do_shmat(first, (char __user *) ptr,
+                                       (int)second, &raddr);
                        if (ret)
                                break;
                        ret = put_user (raddr, (ulong __user *) third);
@@ -133,8 +138,8 @@ sys_ipc (uint call, int first, int second, long third, void __user *ptr, long fi
                        ret = -EINVAL;
                        if (!segment_eq(get_fs(), get_ds()))
                                break;
-                       ret = do_shmat (first, (char __user *) ptr, second,
-                                        (ulong *) third);
+                       ret = do_shmat(first, (char __user *)ptr,
+                                       (int)second, (ulong *)third);
                        break;
                }
                break;
@@ -142,10 +147,11 @@ sys_ipc (uint call, int first, int second, long third, void __user *ptr, long fi
                ret = sys_shmdt ((char __user *)ptr);
                break;
        case SHMGET:
-               ret = sys_shmget (first, second, third);
+               ret = sys_shmget (first, (size_t)second, third);
                break;
        case SHMCTL:
-               ret = sys_shmctl (first, second, (struct shmid_ds __user *) ptr);
+               ret = sys_shmctl(first, (int)second,
+                                 (struct shmid_ds __user *)ptr);
                break;
        }
 
@@ -237,5 +243,19 @@ asmlinkage time_t sys64_time(time_t __user * tloc)
        return secs;
 }
 
+void do_show_syscall(unsigned long r3, unsigned long r4, unsigned long r5,
+                    unsigned long r6, unsigned long r7, unsigned long r8,
+                    struct pt_regs *regs)
+{
+       printk("syscall %ld(%lx, %lx, %lx, %lx, %lx, %lx) regs=%p current=%p"
+              " cpu=%d\n", regs->gpr[0], r3, r4, r5, r6, r7, r8, regs,
+              current, smp_processor_id());
+}
+
+void do_show_syscall_exit(unsigned long r3)
+{
+       printk(" -> %lx, current=%p cpu=%d\n", r3, current, smp_processor_id());
+}
+
 /* Only exists on P-series. */
 cond_syscall(ppc_rtas);