diff options
author | Jesper Juhl <jesper.juhl@gmail.com> | 2006-06-23 05:05:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-23 10:43:02 -0400 |
commit | b9e122c80cd2e10fe18678c63db4717871ed31cf (patch) | |
tree | 3e29f080ff69dc93d07e41774f2e3c53506ef37c | |
parent | 6f36d17a87ea9c2584aa8f649e438334bd69e32f (diff) |
[PATCH] xtensa: remove verify_area macros
verify_area() is still alive on xtensa in 2.6.17-rc3-git13 It would be nice
to finally be rid of that function across the board.
Signed-off-by: Chris Zankel <chris@zankel.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/xtensa/Kconfig | 4 | ||||
-rw-r--r-- | arch/xtensa/kernel/entry.S | 2 | ||||
-rw-r--r-- | arch/xtensa/kernel/signal.c | 10 | ||||
-rw-r--r-- | include/asm-xtensa/checksum.h | 3 | ||||
-rw-r--r-- | include/asm-xtensa/rwsem.h | 7 | ||||
-rw-r--r-- | include/asm-xtensa/uaccess.h | 34 |
6 files changed, 13 insertions, 47 deletions
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index dbeb3504c3c8..848f173db257 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig | |||
@@ -34,10 +34,6 @@ config GENERIC_HARDIRQS | |||
34 | bool | 34 | bool |
35 | default y | 35 | default y |
36 | 36 | ||
37 | config RWSEM_GENERIC_SPINLOCK | ||
38 | bool | ||
39 | default y | ||
40 | |||
41 | source "init/Kconfig" | 37 | source "init/Kconfig" |
42 | 38 | ||
43 | menu "Processor type and features" | 39 | menu "Processor type and features" |
diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S index 5c018c503dfa..89e409e9e0de 100644 --- a/arch/xtensa/kernel/entry.S +++ b/arch/xtensa/kernel/entry.S | |||
@@ -1102,7 +1102,7 @@ ENTRY(fast_syscall_sysxtensa) | |||
1102 | s32i a7, a2, PT_AREG7 | 1102 | s32i a7, a2, PT_AREG7 |
1103 | 1103 | ||
1104 | movi a7, 4 # sizeof(unsigned int) | 1104 | movi a7, 4 # sizeof(unsigned int) |
1105 | verify_area a3, a7, a0, a2, .Leac | 1105 | access_ok a0, a3, a7, a2, .Leac |
1106 | 1106 | ||
1107 | _beqi a6, SYSXTENSA_ATOMIC_SET, .Lset | 1107 | _beqi a6, SYSXTENSA_ATOMIC_SET, .Lset |
1108 | _beqi a6, SYSXTENSA_ATOMIC_EXG_ADD, .Lexg | 1108 | _beqi a6, SYSXTENSA_ATOMIC_EXG_ADD, .Lexg |
diff --git a/arch/xtensa/kernel/signal.c b/arch/xtensa/kernel/signal.c index e252b61e45a5..beba497e78df 100644 --- a/arch/xtensa/kernel/signal.c +++ b/arch/xtensa/kernel/signal.c | |||
@@ -104,7 +104,7 @@ sys_sigaction(int sig, const struct old_sigaction *act, | |||
104 | 104 | ||
105 | if (act) { | 105 | if (act) { |
106 | old_sigset_t mask; | 106 | old_sigset_t mask; |
107 | if (verify_area(VERIFY_READ, act, sizeof(*act)) || | 107 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || |
108 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || | 108 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || |
109 | __get_user(new_ka.sa.sa_restorer, &act->sa_restorer)) | 109 | __get_user(new_ka.sa.sa_restorer, &act->sa_restorer)) |
110 | return -EFAULT; | 110 | return -EFAULT; |
@@ -116,7 +116,7 @@ sys_sigaction(int sig, const struct old_sigaction *act, | |||
116 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | 116 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); |
117 | 117 | ||
118 | if (!ret && oact) { | 118 | if (!ret && oact) { |
119 | if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) || | 119 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || |
120 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || | 120 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || |
121 | __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer)) | 121 | __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer)) |
122 | return -EFAULT; | 122 | return -EFAULT; |
@@ -236,7 +236,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc) | |||
236 | err |= __copy_from_user (regs->areg, sc->sc_areg, XCHAL_NUM_AREGS*4); | 236 | err |= __copy_from_user (regs->areg, sc->sc_areg, XCHAL_NUM_AREGS*4); |
237 | err |= __get_user(buf, &sc->sc_cpstate); | 237 | err |= __get_user(buf, &sc->sc_cpstate); |
238 | if (buf) { | 238 | if (buf) { |
239 | if (verify_area(VERIFY_READ, buf, sizeof(*buf))) | 239 | if (!access_ok(VERIFY_READ, buf, sizeof(*buf))) |
240 | goto badframe; | 240 | goto badframe; |
241 | err |= restore_cpextra(buf); | 241 | err |= restore_cpextra(buf); |
242 | } | 242 | } |
@@ -357,7 +357,7 @@ asmlinkage int sys_sigreturn(struct pt_regs *regs) | |||
357 | if (regs->depc > 64) | 357 | if (regs->depc > 64) |
358 | panic ("Double exception sys_sigreturn\n"); | 358 | panic ("Double exception sys_sigreturn\n"); |
359 | 359 | ||
360 | if (verify_area(VERIFY_READ, frame, sizeof(*frame))) | 360 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) |
361 | goto badframe; | 361 | goto badframe; |
362 | 362 | ||
363 | if (__get_user(set.sig[0], &frame->sc.oldmask) | 363 | if (__get_user(set.sig[0], &frame->sc.oldmask) |
@@ -394,7 +394,7 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs) | |||
394 | return 0; | 394 | return 0; |
395 | } | 395 | } |
396 | 396 | ||
397 | if (verify_area(VERIFY_READ, frame, sizeof(*frame))) | 397 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) |
398 | goto badframe; | 398 | goto badframe; |
399 | 399 | ||
400 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 400 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
diff --git a/include/asm-xtensa/checksum.h b/include/asm-xtensa/checksum.h index bdc00ae9be48..03114f8d1e18 100644 --- a/include/asm-xtensa/checksum.h +++ b/include/asm-xtensa/checksum.h | |||
@@ -43,8 +43,7 @@ asmlinkage unsigned int csum_partial_copy_generic( const char *src, char *dst, i | |||
43 | * Note: when you get a NULL pointer exception here this means someone | 43 | * Note: when you get a NULL pointer exception here this means someone |
44 | * passed in an incorrect kernel address to one of these functions. | 44 | * passed in an incorrect kernel address to one of these functions. |
45 | * | 45 | * |
46 | * If you use these functions directly please don't forget the | 46 | * If you use these functions directly please don't forget the access_ok(). |
47 | * verify_area(). | ||
48 | */ | 47 | */ |
49 | static inline | 48 | static inline |
50 | unsigned int csum_partial_copy_nocheck ( const char *src, char *dst, | 49 | unsigned int csum_partial_copy_nocheck ( const char *src, char *dst, |
diff --git a/include/asm-xtensa/rwsem.h b/include/asm-xtensa/rwsem.h index 3c02b0e033f0..abcd86dc5ab9 100644 --- a/include/asm-xtensa/rwsem.h +++ b/include/asm-xtensa/rwsem.h | |||
@@ -172,4 +172,9 @@ static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem) | |||
172 | return atomic_add_return(delta, (atomic_t *)(&sem->count)); | 172 | return atomic_add_return(delta, (atomic_t *)(&sem->count)); |
173 | } | 173 | } |
174 | 174 | ||
175 | #endif /* _XTENSA_RWSEM_XADD_H */ | 175 | static inline int rwsem_is_locked(struct rw_semaphore *sem) |
176 | { | ||
177 | return (sem->count != 0); | ||
178 | } | ||
179 | |||
180 | #endif /* _XTENSA_RWSEM_H */ | ||
diff --git a/include/asm-xtensa/uaccess.h b/include/asm-xtensa/uaccess.h index 06a22b83ba17..88a64e1144d5 100644 --- a/include/asm-xtensa/uaccess.h +++ b/include/asm-xtensa/uaccess.h | |||
@@ -154,35 +154,6 @@ | |||
154 | .Laccess_ok_\@: | 154 | .Laccess_ok_\@: |
155 | .endm | 155 | .endm |
156 | 156 | ||
157 | /* | ||
158 | * verify_area determines whether a memory access is allowed. It's | ||
159 | * mostly an unnecessary wrapper for access_ok, but we provide it as a | ||
160 | * duplicate of the verify_area() C inline function below. See the | ||
161 | * equivalent C version below for clarity. | ||
162 | * | ||
163 | * On error, verify_area branches to a label indicated by parameter | ||
164 | * <error>. This implies that the macro falls through to the next | ||
165 | * instruction on success. | ||
166 | * | ||
167 | * Note that we assume success is the common case, and we optimize the | ||
168 | * branch fall-through case on success. | ||
169 | * | ||
170 | * On Entry: | ||
171 | * <aa> register containing memory address | ||
172 | * <as> register containing memory size | ||
173 | * <at> temp register | ||
174 | * <error> label to branch to on error; implies fall-through | ||
175 | * macro on success | ||
176 | * On Exit: | ||
177 | * <aa> preserved | ||
178 | * <as> preserved | ||
179 | * <at> destroyed | ||
180 | */ | ||
181 | .macro verify_area aa, as, at, sp, error | ||
182 | access_ok \at, \aa, \as, \sp, \error | ||
183 | .endm | ||
184 | |||
185 | |||
186 | #else /* __ASSEMBLY__ not defined */ | 157 | #else /* __ASSEMBLY__ not defined */ |
187 | 158 | ||
188 | #include <linux/sched.h> | 159 | #include <linux/sched.h> |
@@ -211,11 +182,6 @@ | |||
211 | #define __access_ok(addr,size) (__kernel_ok || __user_ok((addr),(size))) | 182 | #define __access_ok(addr,size) (__kernel_ok || __user_ok((addr),(size))) |
212 | #define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size)) | 183 | #define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size)) |
213 | 184 | ||
214 | static inline int verify_area(int type, const void * addr, unsigned long size) | ||
215 | { | ||
216 | return access_ok(type,addr,size) ? 0 : -EFAULT; | ||
217 | } | ||
218 | |||
219 | /* | 185 | /* |
220 | * These are the main single-value transfer routines. They | 186 | * These are the main single-value transfer routines. They |
221 | * automatically use the right size if we just have the right pointer | 187 | * automatically use the right size if we just have the right pointer |