aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/include/asm/uaccess.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/microblaze/include/asm/uaccess.h')
-rw-r--r--arch/microblaze/include/asm/uaccess.h30
1 files changed, 19 insertions, 11 deletions
diff --git a/arch/microblaze/include/asm/uaccess.h b/arch/microblaze/include/asm/uaccess.h
index a1ab5f0009ef..efe59d881789 100644
--- a/arch/microblaze/include/asm/uaccess.h
+++ b/arch/microblaze/include/asm/uaccess.h
@@ -90,17 +90,25 @@ static inline int ___range_ok(unsigned long addr, unsigned long size)
90 90
91#else 91#else
92 92
93/* 93static inline int access_ok(int type, const void __user *addr,
94 * Address is valid if: 94 unsigned long size)
95 * - "addr", "addr + size" and "size" are all below the limit 95{
96 */ 96 if (!size)
97#define access_ok(type, addr, size) \ 97 goto ok;
98 (get_fs().seg >= (((unsigned long)(addr)) | \ 98
99 (size) | ((unsigned long)(addr) + (size)))) 99 if ((get_fs().seg < ((unsigned long)addr)) ||
100 100 (get_fs().seg < ((unsigned long)addr + size - 1))) {
101/* || printk("access_ok failed for %s at 0x%08lx (size %d), seg 0x%08x\n", 101 pr_debug("ACCESS fail: %s at 0x%08x (size 0x%x), seg 0x%08x\n",
102 type?"WRITE":"READ",addr,size,get_fs().seg)) */ 102 type ? "WRITE" : "READ ", (u32)addr, (u32)size,
103 103 (u32)get_fs().seg);
104 return 0;
105 }
106ok:
107 pr_debug("ACCESS OK: %s at 0x%08x (size 0x%x), seg 0x%08x\n",
108 type ? "WRITE" : "READ ", (u32)addr, (u32)size,
109 (u32)get_fs().seg);
110 return 1;
111}
104#endif 112#endif
105 113
106#ifdef CONFIG_MMU 114#ifdef CONFIG_MMU