aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2005-11-25 06:12:01 -0500
committerPaul Mackerras <paulus@samba.org>2005-11-25 06:12:01 -0500
commit26925c5910ab77fc95b4d8bb6d98780b50ab1e5a (patch)
tree7d7506b3aedeea4db8b8659f046850db97503a89 /include
parent55bb239e5464ecde046af3e45052ef06efda6444 (diff)
parentcd0cca7bf5e201dcea5632f78ad9b37cb419a5df (diff)
Merge ../linux-2.6
Diffstat (limited to 'include')
-rw-r--r--include/asm-alpha/atomic.h7
-rw-r--r--include/asm-arm/arch-iop3xx/timex.h2
-rw-r--r--include/asm-powerpc/page_64.h6
-rw-r--r--include/asm-sparc64/atomic.h1
-rw-r--r--include/asm-x86_64/atomic.h51
-rw-r--r--include/linux/smp.h8
-rw-r--r--include/linux/usb.h1
7 files changed, 50 insertions, 26 deletions
diff --git a/include/asm-alpha/atomic.h b/include/asm-alpha/atomic.h
index 36505bb4e8cb..6183eab006d4 100644
--- a/include/asm-alpha/atomic.h
+++ b/include/asm-alpha/atomic.h
@@ -118,8 +118,6 @@ static __inline__ long atomic_add_return(int i, atomic_t * v)
118 return result; 118 return result;
119} 119}
120 120
121#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0)
122
123static __inline__ long atomic64_add_return(long i, atomic64_t * v) 121static __inline__ long atomic64_add_return(long i, atomic64_t * v)
124{ 122{
125 long temp, result; 123 long temp, result;
@@ -189,6 +187,9 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
189}) 187})
190#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 188#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
191 189
190#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0)
191#define atomic64_add_negative(a, v) (atomic64_add_return((a), (v)) < 0)
192
192#define atomic_dec_return(v) atomic_sub_return(1,(v)) 193#define atomic_dec_return(v) atomic_sub_return(1,(v))
193#define atomic64_dec_return(v) atomic64_sub_return(1,(v)) 194#define atomic64_dec_return(v) atomic64_sub_return(1,(v))
194 195
@@ -199,6 +200,8 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
199#define atomic64_sub_and_test(i,v) (atomic64_sub_return((i), (v)) == 0) 200#define atomic64_sub_and_test(i,v) (atomic64_sub_return((i), (v)) == 0)
200 201
201#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0) 202#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0)
203#define atomic64_inc_and_test(v) (atomic64_add_return(1, (v)) == 0)
204
202#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) 205#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
203#define atomic64_dec_and_test(v) (atomic64_sub_return(1, (v)) == 0) 206#define atomic64_dec_and_test(v) (atomic64_sub_return(1, (v)) == 0)
204 207
diff --git a/include/asm-arm/arch-iop3xx/timex.h b/include/asm-arm/arch-iop3xx/timex.h
index d4187fe9a85a..472badb451c4 100644
--- a/include/asm-arm/arch-iop3xx/timex.h
+++ b/include/asm-arm/arch-iop3xx/timex.h
@@ -4,7 +4,7 @@
4 * IOP3xx architecture timex specifications 4 * IOP3xx architecture timex specifications
5 */ 5 */
6#include <linux/config.h> 6#include <linux/config.h>
7 7#include <asm/hardware.h>
8 8
9#if defined(CONFIG_ARCH_IQ80321) || defined(CONFIG_ARCH_IQ31244) 9#if defined(CONFIG_ARCH_IQ80321) || defined(CONFIG_ARCH_IQ31244)
10 10
diff --git a/include/asm-powerpc/page_64.h b/include/asm-powerpc/page_64.h
index 1e6e7846824f..58a3dd9a79ec 100644
--- a/include/asm-powerpc/page_64.h
+++ b/include/asm-powerpc/page_64.h
@@ -135,9 +135,9 @@ extern unsigned int HPAGE_SHIFT;
135 135
136#define in_hugepage_area(context, addr) \ 136#define in_hugepage_area(context, addr) \
137 (cpu_has_feature(CPU_FTR_16M_PAGE) && \ 137 (cpu_has_feature(CPU_FTR_16M_PAGE) && \
138 ( ((1 << GET_HTLB_AREA(addr)) & (context).high_htlb_areas) || \ 138 ( ( (addr) >= 0x100000000UL) \
139 ( ((addr) < 0x100000000L) && \ 139 ? ((1 << GET_HTLB_AREA(addr)) & (context).high_htlb_areas) \
140 ((1 << GET_ESID(addr)) & (context).low_htlb_areas) ) ) ) 140 : ((1 << GET_ESID(addr)) & (context).low_htlb_areas) ) )
141 141
142#else /* !CONFIG_HUGETLB_PAGE */ 142#else /* !CONFIG_HUGETLB_PAGE */
143 143
diff --git a/include/asm-sparc64/atomic.h b/include/asm-sparc64/atomic.h
index 8198c3d0d007..3789fe315992 100644
--- a/include/asm-sparc64/atomic.h
+++ b/include/asm-sparc64/atomic.h
@@ -54,6 +54,7 @@ extern int atomic64_sub_ret(int, atomic64_t *);
54 * other cases. 54 * other cases.
55 */ 55 */
56#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0) 56#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
57#define atomic64_inc_and_test(v) (atomic64_inc_return(v) == 0)
57 58
58#define atomic_sub_and_test(i, v) (atomic_sub_ret(i, v) == 0) 59#define atomic_sub_and_test(i, v) (atomic_sub_ret(i, v) == 0)
59#define atomic64_sub_and_test(i, v) (atomic64_sub_ret(i, v) == 0) 60#define atomic64_sub_and_test(i, v) (atomic64_sub_ret(i, v) == 0)
diff --git a/include/asm-x86_64/atomic.h b/include/asm-x86_64/atomic.h
index 0866ef67f198..50db9f39274f 100644
--- a/include/asm-x86_64/atomic.h
+++ b/include/asm-x86_64/atomic.h
@@ -160,8 +160,8 @@ static __inline__ int atomic_inc_and_test(atomic_t *v)
160 160
161/** 161/**
162 * atomic_add_negative - add and test if negative 162 * atomic_add_negative - add and test if negative
163 * @v: pointer of type atomic_t
164 * @i: integer value to add 163 * @i: integer value to add
164 * @v: pointer of type atomic_t
165 * 165 *
166 * Atomically adds @i to @v and returns true 166 * Atomically adds @i to @v and returns true
167 * if the result is negative, or false when 167 * if the result is negative, or false when
@@ -178,6 +178,31 @@ static __inline__ int atomic_add_negative(int i, atomic_t *v)
178 return c; 178 return c;
179} 179}
180 180
181/**
182 * atomic_add_return - add and return
183 * @i: integer value to add
184 * @v: pointer of type atomic_t
185 *
186 * Atomically adds @i to @v and returns @i + @v
187 */
188static __inline__ int atomic_add_return(int i, atomic_t *v)
189{
190 int __i = i;
191 __asm__ __volatile__(
192 LOCK "xaddl %0, %1;"
193 :"=r"(i)
194 :"m"(v->counter), "0"(i));
195 return i + __i;
196}
197
198static __inline__ int atomic_sub_return(int i, atomic_t *v)
199{
200 return atomic_add_return(-i,v);
201}
202
203#define atomic_inc_return(v) (atomic_add_return(1,v))
204#define atomic_dec_return(v) (atomic_sub_return(1,v))
205
181/* An 64bit atomic type */ 206/* An 64bit atomic type */
182 207
183typedef struct { volatile long counter; } atomic64_t; 208typedef struct { volatile long counter; } atomic64_t;
@@ -320,14 +345,14 @@ static __inline__ int atomic64_inc_and_test(atomic64_t *v)
320 345
321/** 346/**
322 * atomic64_add_negative - add and test if negative 347 * atomic64_add_negative - add and test if negative
323 * @v: pointer to atomic64_t
324 * @i: integer value to add 348 * @i: integer value to add
349 * @v: pointer to type atomic64_t
325 * 350 *
326 * Atomically adds @i to @v and returns true 351 * Atomically adds @i to @v and returns true
327 * if the result is negative, or false when 352 * if the result is negative, or false when
328 * result is greater than or equal to zero. 353 * result is greater than or equal to zero.
329 */ 354 */
330static __inline__ long atomic64_add_negative(long i, atomic64_t *v) 355static __inline__ int atomic64_add_negative(long i, atomic64_t *v)
331{ 356{
332 unsigned char c; 357 unsigned char c;
333 358
@@ -339,27 +364,30 @@ static __inline__ long atomic64_add_negative(long i, atomic64_t *v)
339} 364}
340 365
341/** 366/**
342 * atomic_add_return - add and return 367 * atomic64_add_return - add and return
343 * @v: pointer of type atomic_t
344 * @i: integer value to add 368 * @i: integer value to add
369 * @v: pointer to type atomic64_t
345 * 370 *
346 * Atomically adds @i to @v and returns @i + @v 371 * Atomically adds @i to @v and returns @i + @v
347 */ 372 */
348static __inline__ int atomic_add_return(int i, atomic_t *v) 373static __inline__ long atomic64_add_return(long i, atomic64_t *v)
349{ 374{
350 int __i = i; 375 long __i = i;
351 __asm__ __volatile__( 376 __asm__ __volatile__(
352 LOCK "xaddl %0, %1;" 377 LOCK "xaddq %0, %1;"
353 :"=r"(i) 378 :"=r"(i)
354 :"m"(v->counter), "0"(i)); 379 :"m"(v->counter), "0"(i));
355 return i + __i; 380 return i + __i;
356} 381}
357 382
358static __inline__ int atomic_sub_return(int i, atomic_t *v) 383static __inline__ long atomic64_sub_return(long i, atomic64_t *v)
359{ 384{
360 return atomic_add_return(-i,v); 385 return atomic64_add_return(-i,v);
361} 386}
362 387
388#define atomic64_inc_return(v) (atomic64_add_return(1,v))
389#define atomic64_dec_return(v) (atomic64_sub_return(1,v))
390
363#define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new)) 391#define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new))
364 392
365/** 393/**
@@ -381,9 +409,6 @@ static __inline__ int atomic_sub_return(int i, atomic_t *v)
381}) 409})
382#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 410#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
383 411
384#define atomic_inc_return(v) (atomic_add_return(1,v))
385#define atomic_dec_return(v) (atomic_sub_return(1,v))
386
387/* These are x86-specific, used by some header files */ 412/* These are x86-specific, used by some header files */
388#define atomic_clear_mask(mask, addr) \ 413#define atomic_clear_mask(mask, addr) \
389__asm__ __volatile__(LOCK "andl %0,%1" \ 414__asm__ __volatile__(LOCK "andl %0,%1" \
diff --git a/include/linux/smp.h b/include/linux/smp.h
index b6069c8e1f04..9dfa3ee769ae 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -94,13 +94,7 @@ void smp_prepare_boot_cpu(void);
94 */ 94 */
95#define raw_smp_processor_id() 0 95#define raw_smp_processor_id() 0
96#define hard_smp_processor_id() 0 96#define hard_smp_processor_id() 0
97 97#define smp_call_function(func,info,retry,wait) ({ 0; })
98static inline int smp_call_function(void (*func) (void *info), void *info,
99 int retry, int wait)
100{
101 return 0;
102}
103
104#define on_each_cpu(func,info,retry,wait) ({ func(info); 0; }) 98#define on_each_cpu(func,info,retry,wait) ({ func(info); 0; })
105static inline void smp_send_reschedule(int cpu) { } 99static inline void smp_send_reschedule(int cpu) { }
106#define num_booting_cpus() 1 100#define num_booting_cpus() 1
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 856d232c7562..d81b050e5955 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -47,6 +47,7 @@ struct usb_driver;
47 * @urb_list: urbs queued to this endpoint; maintained by usbcore 47 * @urb_list: urbs queued to this endpoint; maintained by usbcore
48 * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH) 48 * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH)
49 * with one or more transfer descriptors (TDs) per urb 49 * with one or more transfer descriptors (TDs) per urb
50 * @kobj: kobject for sysfs info
50 * @extra: descriptors following this endpoint in the configuration 51 * @extra: descriptors following this endpoint in the configuration
51 * @extralen: how many bytes of "extra" are valid 52 * @extralen: how many bytes of "extra" are valid
52 * 53 *