diff options
Diffstat (limited to 'arch/xtensa')
-rw-r--r-- | arch/xtensa/include/asm/atomic.h | 10 | ||||
-rw-r--r-- | arch/xtensa/include/asm/bitops.h | 14 | ||||
-rw-r--r-- | arch/xtensa/include/asm/posix_types.h | 2 | ||||
-rw-r--r-- | arch/xtensa/include/asm/ptrace.h | 1 | ||||
-rw-r--r-- | arch/xtensa/include/asm/uaccess.h | 4 | ||||
-rw-r--r-- | arch/xtensa/kernel/process.c | 2 | ||||
-rw-r--r-- | arch/xtensa/kernel/ptrace.c | 3 | ||||
-rw-r--r-- | arch/xtensa/variants/s6000/include/variant/dmac.h | 2 |
8 files changed, 13 insertions, 25 deletions
diff --git a/arch/xtensa/include/asm/atomic.h b/arch/xtensa/include/asm/atomic.h index a96a0619d0b7..23592eff67ad 100644 --- a/arch/xtensa/include/asm/atomic.h +++ b/arch/xtensa/include/asm/atomic.h | |||
@@ -225,15 +225,15 @@ static inline int atomic_sub_return(int i, atomic_t * v) | |||
225 | #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) | 225 | #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) |
226 | 226 | ||
227 | /** | 227 | /** |
228 | * atomic_add_unless - add unless the number is a given value | 228 | * __atomic_add_unless - add unless the number is a given value |
229 | * @v: pointer of type atomic_t | 229 | * @v: pointer of type atomic_t |
230 | * @a: the amount to add to v... | 230 | * @a: the amount to add to v... |
231 | * @u: ...unless v is equal to u. | 231 | * @u: ...unless v is equal to u. |
232 | * | 232 | * |
233 | * Atomically adds @a to @v, so long as it was not @u. | 233 | * Atomically adds @a to @v, so long as it was not @u. |
234 | * Returns non-zero if @v was not @u, and zero otherwise. | 234 | * Returns the old value of @v. |
235 | */ | 235 | */ |
236 | static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) | 236 | static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u) |
237 | { | 237 | { |
238 | int c, old; | 238 | int c, old; |
239 | c = atomic_read(v); | 239 | c = atomic_read(v); |
@@ -245,10 +245,9 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) | |||
245 | break; | 245 | break; |
246 | c = old; | 246 | c = old; |
247 | } | 247 | } |
248 | return c != (u); | 248 | return c; |
249 | } | 249 | } |
250 | 250 | ||
251 | #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) | ||
252 | 251 | ||
253 | static inline void atomic_clear_mask(unsigned int mask, atomic_t *v) | 252 | static inline void atomic_clear_mask(unsigned int mask, atomic_t *v) |
254 | { | 253 | { |
@@ -292,7 +291,6 @@ static inline void atomic_set_mask(unsigned int mask, atomic_t *v) | |||
292 | #define smp_mb__before_atomic_inc() barrier() | 291 | #define smp_mb__before_atomic_inc() barrier() |
293 | #define smp_mb__after_atomic_inc() barrier() | 292 | #define smp_mb__after_atomic_inc() barrier() |
294 | 293 | ||
295 | #include <asm-generic/atomic-long.h> | ||
296 | #endif /* __KERNEL__ */ | 294 | #endif /* __KERNEL__ */ |
297 | 295 | ||
298 | #endif /* _XTENSA_ATOMIC_H */ | 296 | #endif /* _XTENSA_ATOMIC_H */ |
diff --git a/arch/xtensa/include/asm/bitops.h b/arch/xtensa/include/asm/bitops.h index c8fac8d8190d..40aa7fe77f66 100644 --- a/arch/xtensa/include/asm/bitops.h +++ b/arch/xtensa/include/asm/bitops.h | |||
@@ -108,19 +108,7 @@ static inline unsigned long __fls(unsigned long word) | |||
108 | #include <asm-generic/bitops/find.h> | 108 | #include <asm-generic/bitops/find.h> |
109 | #include <asm-generic/bitops/le.h> | 109 | #include <asm-generic/bitops/le.h> |
110 | 110 | ||
111 | #ifdef __XTENSA_EL__ | 111 | #include <asm-generic/bitops/ext2-atomic-setbit.h> |
112 | # define ext2_set_bit_atomic(lock,nr,addr) \ | ||
113 | test_and_set_bit((nr), (unsigned long*)(addr)) | ||
114 | # define ext2_clear_bit_atomic(lock,nr,addr) \ | ||
115 | test_and_clear_bit((nr), (unsigned long*)(addr)) | ||
116 | #elif defined(__XTENSA_EB__) | ||
117 | # define ext2_set_bit_atomic(lock,nr,addr) \ | ||
118 | test_and_set_bit((nr) ^ 0x18, (unsigned long*)(addr)) | ||
119 | # define ext2_clear_bit_atomic(lock,nr,addr) \ | ||
120 | test_and_clear_bit((nr) ^ 0x18, (unsigned long*)(addr)) | ||
121 | #else | ||
122 | # error processor byte order undefined! | ||
123 | #endif | ||
124 | 112 | ||
125 | #include <asm-generic/bitops/hweight.h> | 113 | #include <asm-generic/bitops/hweight.h> |
126 | #include <asm-generic/bitops/lock.h> | 114 | #include <asm-generic/bitops/lock.h> |
diff --git a/arch/xtensa/include/asm/posix_types.h b/arch/xtensa/include/asm/posix_types.h index 43f9dd1126a4..6b2190c35882 100644 --- a/arch/xtensa/include/asm/posix_types.h +++ b/arch/xtensa/include/asm/posix_types.h | |||
@@ -58,7 +58,7 @@ typedef struct { | |||
58 | 58 | ||
59 | #define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) | 59 | #define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) |
60 | #define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) | 60 | #define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) |
61 | #define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) | 61 | #define __FD_ISSET(d, set) (!!((set)->fds_bits[__FDELT(d)] & __FDMASK(d))) |
62 | #define __FD_ZERO(set) \ | 62 | #define __FD_ZERO(set) \ |
63 | ((void) memset ((void *) (set), 0, sizeof (__kernel_fd_set))) | 63 | ((void) memset ((void *) (set), 0, sizeof (__kernel_fd_set))) |
64 | 64 | ||
diff --git a/arch/xtensa/include/asm/ptrace.h b/arch/xtensa/include/asm/ptrace.h index 0d42c934b66f..d85d38da8eec 100644 --- a/arch/xtensa/include/asm/ptrace.h +++ b/arch/xtensa/include/asm/ptrace.h | |||
@@ -120,7 +120,6 @@ struct pt_regs { | |||
120 | (task_stack_page(tsk) + KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4) - 1) | 120 | (task_stack_page(tsk) + KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4) - 1) |
121 | # define user_mode(regs) (((regs)->ps & 0x00000020)!=0) | 121 | # define user_mode(regs) (((regs)->ps & 0x00000020)!=0) |
122 | # define instruction_pointer(regs) ((regs)->pc) | 122 | # define instruction_pointer(regs) ((regs)->pc) |
123 | extern void show_regs(struct pt_regs *); | ||
124 | 123 | ||
125 | # ifndef CONFIG_SMP | 124 | # ifndef CONFIG_SMP |
126 | # define profile_pc(regs) instruction_pointer(regs) | 125 | # define profile_pc(regs) instruction_pointer(regs) |
diff --git a/arch/xtensa/include/asm/uaccess.h b/arch/xtensa/include/asm/uaccess.h index 5b0c18c1cce1..3fa526fd3c99 100644 --- a/arch/xtensa/include/asm/uaccess.h +++ b/arch/xtensa/include/asm/uaccess.h | |||
@@ -17,6 +17,8 @@ | |||
17 | #define _XTENSA_UACCESS_H | 17 | #define _XTENSA_UACCESS_H |
18 | 18 | ||
19 | #include <linux/errno.h> | 19 | #include <linux/errno.h> |
20 | #include <linux/prefetch.h> | ||
21 | #include <asm/types.h> | ||
20 | 22 | ||
21 | #define VERIFY_READ 0 | 23 | #define VERIFY_READ 0 |
22 | #define VERIFY_WRITE 1 | 24 | #define VERIFY_WRITE 1 |
@@ -26,7 +28,6 @@ | |||
26 | #include <asm/current.h> | 28 | #include <asm/current.h> |
27 | #include <asm/asm-offsets.h> | 29 | #include <asm/asm-offsets.h> |
28 | #include <asm/processor.h> | 30 | #include <asm/processor.h> |
29 | #include <asm/types.h> | ||
30 | 31 | ||
31 | /* | 32 | /* |
32 | * These assembly macros mirror the C macros that follow below. They | 33 | * These assembly macros mirror the C macros that follow below. They |
@@ -157,7 +158,6 @@ | |||
157 | #else /* __ASSEMBLY__ not defined */ | 158 | #else /* __ASSEMBLY__ not defined */ |
158 | 159 | ||
159 | #include <linux/sched.h> | 160 | #include <linux/sched.h> |
160 | #include <asm/types.h> | ||
161 | 161 | ||
162 | /* | 162 | /* |
163 | * The fs value determines whether argument validity checking should | 163 | * The fs value determines whether argument validity checking should |
diff --git a/arch/xtensa/kernel/process.c b/arch/xtensa/kernel/process.c index e3558b9a58ba..47041e7c088c 100644 --- a/arch/xtensa/kernel/process.c +++ b/arch/xtensa/kernel/process.c | |||
@@ -40,7 +40,7 @@ | |||
40 | #include <asm/platform.h> | 40 | #include <asm/platform.h> |
41 | #include <asm/mmu.h> | 41 | #include <asm/mmu.h> |
42 | #include <asm/irq.h> | 42 | #include <asm/irq.h> |
43 | #include <asm/atomic.h> | 43 | #include <linux/atomic.h> |
44 | #include <asm/asm-offsets.h> | 44 | #include <asm/asm-offsets.h> |
45 | #include <asm/regs.h> | 45 | #include <asm/regs.h> |
46 | 46 | ||
diff --git a/arch/xtensa/kernel/ptrace.c b/arch/xtensa/kernel/ptrace.c index c72c9473ef99..a0d042aa2967 100644 --- a/arch/xtensa/kernel/ptrace.c +++ b/arch/xtensa/kernel/ptrace.c | |||
@@ -147,6 +147,9 @@ int ptrace_setxregs(struct task_struct *child, void __user *uregs) | |||
147 | elf_xtregs_t *xtregs = uregs; | 147 | elf_xtregs_t *xtregs = uregs; |
148 | int ret = 0; | 148 | int ret = 0; |
149 | 149 | ||
150 | if (!access_ok(VERIFY_READ, uregs, sizeof(elf_xtregs_t))) | ||
151 | return -EFAULT; | ||
152 | |||
150 | #if XTENSA_HAVE_COPROCESSORS | 153 | #if XTENSA_HAVE_COPROCESSORS |
151 | /* Flush all coprocessors before we overwrite them. */ | 154 | /* Flush all coprocessors before we overwrite them. */ |
152 | coprocessor_flush_all(ti); | 155 | coprocessor_flush_all(ti); |
diff --git a/arch/xtensa/variants/s6000/include/variant/dmac.h b/arch/xtensa/variants/s6000/include/variant/dmac.h index 89ab9484fb71..e81735b2a206 100644 --- a/arch/xtensa/variants/s6000/include/variant/dmac.h +++ b/arch/xtensa/variants/s6000/include/variant/dmac.h | |||
@@ -357,7 +357,7 @@ static inline u32 s6dmac_channel_enabled(u32 dmac, int chan) | |||
357 | static inline void s6dmac_dp_setup_group(u32 dmac, int port, | 357 | static inline void s6dmac_dp_setup_group(u32 dmac, int port, |
358 | int nrch, int frrep) | 358 | int nrch, int frrep) |
359 | { | 359 | { |
360 | const static u8 mask[4] = {0, 3, 1, 2}; | 360 | static const u8 mask[4] = {0, 3, 1, 2}; |
361 | BUG_ON(dmac != S6_REG_DPDMA); | 361 | BUG_ON(dmac != S6_REG_DPDMA); |
362 | if ((port < 0) || (port > 3) || (nrch < 1) || (nrch > 4)) | 362 | if ((port < 0) || (port > 3) || (nrch < 1) || (nrch > 4)) |
363 | return; | 363 | return; |