diff options
Diffstat (limited to 'include/asm-sh/uaccess.h')
-rw-r--r-- | include/asm-sh/uaccess.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/asm-sh/uaccess.h b/include/asm-sh/uaccess.h index 5c3b00c2f107..5c49ed6715f2 100644 --- a/include/asm-sh/uaccess.h +++ b/include/asm-sh/uaccess.h | |||
@@ -34,12 +34,12 @@ | |||
34 | 34 | ||
35 | #define segment_eq(a,b) ((a).seg == (b).seg) | 35 | #define segment_eq(a,b) ((a).seg == (b).seg) |
36 | 36 | ||
37 | #define __addr_ok(addr) \ | ||
38 | ((unsigned long)(addr) < (current_thread_info()->addr_limit.seg)) | ||
39 | |||
40 | #define get_ds() (KERNEL_DS) | 37 | #define get_ds() (KERNEL_DS) |
41 | 38 | ||
42 | #if !defined(CONFIG_MMU) | 39 | #if !defined(CONFIG_MMU) |
40 | /* NOMMU is always true */ | ||
41 | #define __addr_ok(addr) (1) | ||
42 | |||
43 | static inline mm_segment_t get_fs(void) | 43 | static inline mm_segment_t get_fs(void) |
44 | { | 44 | { |
45 | return USER_DS; | 45 | return USER_DS; |
@@ -66,6 +66,9 @@ static inline int __access_ok(unsigned long addr, unsigned long size) | |||
66 | return ((addr >= memory_start) && ((addr + size) < memory_end)); | 66 | return ((addr >= memory_start) && ((addr + size) < memory_end)); |
67 | } | 67 | } |
68 | #else /* CONFIG_MMU */ | 68 | #else /* CONFIG_MMU */ |
69 | #define __addr_ok(addr) \ | ||
70 | ((unsigned long)(addr) < (current_thread_info()->addr_limit.seg)) | ||
71 | |||
69 | #define get_fs() (current_thread_info()->addr_limit) | 72 | #define get_fs() (current_thread_info()->addr_limit) |
70 | #define set_fs(x) (current_thread_info()->addr_limit = (x)) | 73 | #define set_fs(x) (current_thread_info()->addr_limit = (x)) |
71 | 74 | ||