]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/ia64/include/asm/uaccess.h
ia64: get rid of 'segment' argument of __do_{get,put}_user()
[karo-tx-linux.git] / arch / ia64 / include / asm / uaccess.h
index 471044be2a3bdf5b418ea2f3b909c3cf3ef53798..24b39341f816663db4fed56de384a1b9acfdfe16 100644 (file)
  */
 
 #include <linux/compiler.h>
-#include <linux/errno.h>
-#include <linux/sched.h>
 #include <linux/page-flags.h>
 #include <linux/mm.h>
 
 #include <asm/intrinsics.h>
 #include <asm/pgtable.h>
 #include <asm/io.h>
+#include <asm/extable.h>
 
 /*
  * For historical reasons, the following macros are grossly misnamed:
@@ -48,9 +47,6 @@
 #define KERNEL_DS      ((mm_segment_t) { ~0UL })               /* cf. access_ok() */
 #define USER_DS                ((mm_segment_t) { TASK_SIZE-1 })        /* cf. access_ok() */
 
-#define VERIFY_READ    0
-#define VERIFY_WRITE   1
-
 #define get_ds()  (KERNEL_DS)
 #define get_fs()  (current_thread_info()->addr_limit)
 #define set_fs(x) (current_thread_info()->addr_limit = (x))
@@ -80,8 +76,8 @@
  * (a) re-use the arguments for side effects (sizeof/typeof is ok)
  * (b) require any knowledge of processes at this stage
  */
-#define put_user(x, ptr)       __put_user_check((__typeof__(*(ptr))) (x), (ptr), sizeof(*(ptr)), get_fs())
-#define get_user(x, ptr)       __get_user_check((x), (ptr), sizeof(*(ptr)), get_fs())
+#define put_user(x, ptr)       __put_user_check((__typeof__(*(ptr))) (x), (ptr), sizeof(*(ptr)))
+#define get_user(x, ptr)       __get_user_check((x), (ptr), sizeof(*(ptr)))
 
 /*
  * The "__xxx" versions do not do address space checking, useful when
@@ -184,13 +180,13 @@ extern void __get_user_unknown (void);
  * could clobber r8 and r9 (among others).  Thus, be careful not to evaluate it while
  * using r8/r9.
  */
-#define __do_get_user(check, x, ptr, size, segment)                                    \
+#define __do_get_user(check, x, ptr, size)                                             \
 ({                                                                                     \
        const __typeof__(*(ptr)) __user *__gu_ptr = (ptr);                              \
        __typeof__ (size) __gu_size = (size);                                           \
        long __gu_err = -EFAULT;                                                        \
        unsigned long __gu_val = 0;                                                     \
-       if (!check || __access_ok(__gu_ptr, size, segment))                             \
+       if (!check || __access_ok(__gu_ptr, size, get_fs()))                            \
                switch (__gu_size) {                                                    \
                      case 1: __get_user_size(__gu_val, __gu_ptr, 1, __gu_err); break;  \
                      case 2: __get_user_size(__gu_val, __gu_ptr, 2, __gu_err); break;  \
@@ -202,8 +198,8 @@ extern void __get_user_unknown (void);
        __gu_err;                                                                       \
 })
 
-#define __get_user_nocheck(x, ptr, size)       __do_get_user(0, x, ptr, size, KERNEL_DS)
-#define __get_user_check(x, ptr, size, segment)        __do_get_user(1, x, ptr, size, segment)
+#define __get_user_nocheck(x, ptr, size)       __do_get_user(0, x, ptr, size)
+#define __get_user_check(x, ptr, size) __do_get_user(1, x, ptr, size)
 
 extern void __put_user_unknown (void);
 
@@ -211,14 +207,14 @@ extern void __put_user_unknown (void);
  * Evaluating arguments X, PTR, SIZE, and SEGMENT may involve subroutine-calls, which
  * could clobber r8 (among others).  Thus, be careful not to evaluate them while using r8.
  */
-#define __do_put_user(check, x, ptr, size, segment)                                    \
+#define __do_put_user(check, x, ptr, size)                                             \
 ({                                                                                     \
        __typeof__ (x) __pu_x = (x);                                                    \
        __typeof__ (*(ptr)) __user *__pu_ptr = (ptr);                                   \
        __typeof__ (size) __pu_size = (size);                                           \
        long __pu_err = -EFAULT;                                                        \
                                                                                        \
-       if (!check || __access_ok(__pu_ptr, __pu_size, segment))                        \
+       if (!check || __access_ok(__pu_ptr, __pu_size, get_fs()))                       \
                switch (__pu_size) {                                                    \
                      case 1: __put_user_size(__pu_x, __pu_ptr, 1, __pu_err); break;    \
                      case 2: __put_user_size(__pu_x, __pu_ptr, 2, __pu_err); break;    \
@@ -229,8 +225,8 @@ extern void __put_user_unknown (void);
        __pu_err;                                                                       \
 })
 
-#define __put_user_nocheck(x, ptr, size)       __do_put_user(0, x, ptr, size, KERNEL_DS)
-#define __put_user_check(x, ptr, size, segment)        __do_put_user(1, x, ptr, size, segment)
+#define __put_user_nocheck(x, ptr, size)       __do_put_user(0, x, ptr, size)
+#define __put_user_check(x, ptr, size) __do_put_user(1, x, ptr, size)
 
 /*
  * Complex access routines
@@ -346,13 +342,6 @@ extern unsigned long __strnlen_user (const char __user *, long);
        __su_ret;                                               \
 })
 
-#define ARCH_HAS_RELATIVE_EXTABLE
-
-struct exception_table_entry {
-       int insn;       /* location-relative address of insn this fixup is for */
-       int fixup;      /* location-relative continuation addr.; if bit 2 is set, r9 is set to 0 */
-};
-
 #define ARCH_HAS_TRANSLATE_MEM_PTR     1
 static __inline__ void *
 xlate_dev_mem_ptr(phys_addr_t p)