aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/xtensa/include')
-rw-r--r--arch/xtensa/include/asm/atomic.h10
-rw-r--r--arch/xtensa/include/asm/bitops.h14
-rw-r--r--arch/xtensa/include/asm/posix_types.h2
-rw-r--r--arch/xtensa/include/asm/ptrace.h1
-rw-r--r--arch/xtensa/include/asm/uaccess.h4
5 files changed, 8 insertions, 23 deletions
diff --git a/arch/xtensa/include/asm/atomic.h b/arch/xtensa/include/asm/atomic.h
index a96a0619d0b..23592eff67a 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 */
236static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) 236static __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
253static inline void atomic_clear_mask(unsigned int mask, atomic_t *v) 252static 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 c8fac8d8190..40aa7fe77f6 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 43f9dd1126a..6b2190c3588 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 0d42c934b66..d85d38da8ee 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)
123extern 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 5b0c18c1cce..3fa526fd3c9 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