linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / arch / sparc64 / kernel / sunos_ioctl32.c
index 1e041b0..3f619ea 100644 (file)
 #include <linux/smp_lock.h>
 #include <linux/syscalls.h>
 #include <linux/compat.h>
-#include <asm/kbio.h>
-
-/* Use this to get at 32-bit user passed pointers. */
-#define A(__x)                         \
-({     unsigned long __ret;            \
-       __asm__ ("srl   %0, 0, %0"      \
-                : "=r" (__ret)         \
-                : "0" (__x));          \
-       __ret;                          \
-})
 
 #define SUNOS_NR_OPEN  256
 
@@ -108,7 +98,7 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg)
                int ntty = N_TTY;
                int tmp;
 
-               p = (int __user *)A(arg);
+               p = (int __user *) (unsigned long) arg;
                ret = -EFAULT;
                if(get_user(tmp, p))
                        goto out;
@@ -161,11 +151,12 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg)
                ret = compat_sys_ioctl(fd, SIOCGIFCONF, arg);
                goto out;
 
-       case _IOW('i', 21, struct ifreq): /* SIOCSIFMTU */
-               ret = sys_ioctl(fd, SIOCSIFMTU, arg);
+       case _IOW('i', 21, struct ifreq32):
+               ret = compat_sys_ioctl(fd, SIOCSIFMTU, arg);
                goto out;
-       case _IOWR('i', 22, struct ifreq): /* SIOCGIFMTU */
-               ret = sys_ioctl(fd, SIOCGIFMTU, arg);
+
+       case _IOWR('i', 22, struct ifreq32):
+               ret = compat_sys_ioctl(fd, SIOCGIFMTU, arg);
                goto out;
 
        case _IOWR('i', 23, struct ifreq32):
@@ -241,7 +232,7 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg)
                int oldval, newval, __user *ptr;
 
                cmd = TIOCSPGRP;
-               ptr = (int __user *) A(arg);
+               ptr = (int __user *) (unsigned long) arg;
                ret = -EFAULT;
                if(get_user(oldval, ptr))
                        goto out;
@@ -260,7 +251,7 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg)
                int oldval, newval, __user *ptr;
 
                cmd = TIOCGPGRP;
-               ptr = (int __user *) A(arg);
+               ptr = (int __user *) (unsigned long) arg;
                ret = -EFAULT;
                if(get_user(oldval, ptr))
                        goto out;