diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-alpha/atomic.h | 2 | ||||
-rw-r--r-- | include/asm-alpha/barrier.h | 34 | ||||
-rw-r--r-- | include/asm-alpha/system.h | 31 | ||||
-rw-r--r-- | include/asm-arm/bitops.h | 1 | ||||
-rw-r--r-- | include/net/llc_pdu.h | 4 |
5 files changed, 40 insertions, 32 deletions
diff --git a/include/asm-alpha/atomic.h b/include/asm-alpha/atomic.h index 0b40bad00289..20ac3d95ecd9 100644 --- a/include/asm-alpha/atomic.h +++ b/include/asm-alpha/atomic.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _ALPHA_ATOMIC_H | 1 | #ifndef _ALPHA_ATOMIC_H |
2 | #define _ALPHA_ATOMIC_H | 2 | #define _ALPHA_ATOMIC_H |
3 | 3 | ||
4 | #include <asm/barrier.h> | ||
5 | |||
4 | /* | 6 | /* |
5 | * Atomic operations that C can't guarantee us. Useful for | 7 | * Atomic operations that C can't guarantee us. Useful for |
6 | * resource counting etc... | 8 | * resource counting etc... |
diff --git a/include/asm-alpha/barrier.h b/include/asm-alpha/barrier.h new file mode 100644 index 000000000000..229c83fe77cb --- /dev/null +++ b/include/asm-alpha/barrier.h | |||
@@ -0,0 +1,34 @@ | |||
1 | #ifndef __BARRIER_H | ||
2 | #define __BARRIER_H | ||
3 | |||
4 | #define mb() \ | ||
5 | __asm__ __volatile__("mb": : :"memory") | ||
6 | |||
7 | #define rmb() \ | ||
8 | __asm__ __volatile__("mb": : :"memory") | ||
9 | |||
10 | #define wmb() \ | ||
11 | __asm__ __volatile__("wmb": : :"memory") | ||
12 | |||
13 | #define read_barrier_depends() \ | ||
14 | __asm__ __volatile__("mb": : :"memory") | ||
15 | |||
16 | #ifdef CONFIG_SMP | ||
17 | #define smp_mb() mb() | ||
18 | #define smp_rmb() rmb() | ||
19 | #define smp_wmb() wmb() | ||
20 | #define smp_read_barrier_depends() read_barrier_depends() | ||
21 | #else | ||
22 | #define smp_mb() barrier() | ||
23 | #define smp_rmb() barrier() | ||
24 | #define smp_wmb() barrier() | ||
25 | #define smp_read_barrier_depends() barrier() | ||
26 | #endif | ||
27 | |||
28 | #define set_mb(var, value) \ | ||
29 | do { var = value; mb(); } while (0) | ||
30 | |||
31 | #define set_wmb(var, value) \ | ||
32 | do { var = value; wmb(); } while (0) | ||
33 | |||
34 | #endif /* __BARRIER_H */ | ||
diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h index bdb4d66418f1..050e86d12891 100644 --- a/include/asm-alpha/system.h +++ b/include/asm-alpha/system.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/config.h> | 4 | #include <linux/config.h> |
5 | #include <asm/pal.h> | 5 | #include <asm/pal.h> |
6 | #include <asm/page.h> | 6 | #include <asm/page.h> |
7 | #include <asm/barrier.h> | ||
7 | 8 | ||
8 | /* | 9 | /* |
9 | * System defines.. Note that this is included both from .c and .S | 10 | * System defines.. Note that this is included both from .c and .S |
@@ -139,36 +140,6 @@ extern void halt(void) __attribute__((noreturn)); | |||
139 | struct task_struct; | 140 | struct task_struct; |
140 | extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct*); | 141 | extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct*); |
141 | 142 | ||
142 | #define mb() \ | ||
143 | __asm__ __volatile__("mb": : :"memory") | ||
144 | |||
145 | #define rmb() \ | ||
146 | __asm__ __volatile__("mb": : :"memory") | ||
147 | |||
148 | #define wmb() \ | ||
149 | __asm__ __volatile__("wmb": : :"memory") | ||
150 | |||
151 | #define read_barrier_depends() \ | ||
152 | __asm__ __volatile__("mb": : :"memory") | ||
153 | |||
154 | #ifdef CONFIG_SMP | ||
155 | #define smp_mb() mb() | ||
156 | #define smp_rmb() rmb() | ||
157 | #define smp_wmb() wmb() | ||
158 | #define smp_read_barrier_depends() read_barrier_depends() | ||
159 | #else | ||
160 | #define smp_mb() barrier() | ||
161 | #define smp_rmb() barrier() | ||
162 | #define smp_wmb() barrier() | ||
163 | #define smp_read_barrier_depends() barrier() | ||
164 | #endif | ||
165 | |||
166 | #define set_mb(var, value) \ | ||
167 | do { var = value; mb(); } while (0) | ||
168 | |||
169 | #define set_wmb(var, value) \ | ||
170 | do { var = value; wmb(); } while (0) | ||
171 | |||
172 | #define imb() \ | 143 | #define imb() \ |
173 | __asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory") | 144 | __asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory") |
174 | 145 | ||
diff --git a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h index aad7aad026b3..e007dd990da5 100644 --- a/include/asm-arm/bitops.h +++ b/include/asm-arm/bitops.h | |||
@@ -347,7 +347,6 @@ static inline unsigned long __ffs(unsigned long word) | |||
347 | * the clz instruction for much better code efficiency. | 347 | * the clz instruction for much better code efficiency. |
348 | */ | 348 | */ |
349 | 349 | ||
350 | static __inline__ int generic_fls(int x); | ||
351 | #define fls(x) \ | 350 | #define fls(x) \ |
352 | ( __builtin_constant_p(x) ? generic_fls(x) : \ | 351 | ( __builtin_constant_p(x) ? generic_fls(x) : \ |
353 | ({ int __r; asm("clz\t%0, %1" : "=r"(__r) : "r"(x) : "cc"); 32-__r; }) ) | 352 | ({ int __r; asm("clz\t%0, %1" : "=r"(__r) : "r"(x) : "cc"); 32-__r; }) ) |
diff --git a/include/net/llc_pdu.h b/include/net/llc_pdu.h index f45c37d89cf7..c7a959428b4f 100644 --- a/include/net/llc_pdu.h +++ b/include/net/llc_pdu.h | |||
@@ -254,8 +254,10 @@ static inline void llc_pdu_decode_sa(struct sk_buff *skb, u8 *sa) | |||
254 | { | 254 | { |
255 | if (skb->protocol == ntohs(ETH_P_802_2)) | 255 | if (skb->protocol == ntohs(ETH_P_802_2)) |
256 | memcpy(sa, eth_hdr(skb)->h_source, ETH_ALEN); | 256 | memcpy(sa, eth_hdr(skb)->h_source, ETH_ALEN); |
257 | else if (skb->protocol == ntohs(ETH_P_TR_802_2)) | 257 | else if (skb->protocol == ntohs(ETH_P_TR_802_2)) { |
258 | memcpy(sa, tr_hdr(skb)->saddr, ETH_ALEN); | 258 | memcpy(sa, tr_hdr(skb)->saddr, ETH_ALEN); |
259 | *sa &= 0x7F; | ||
260 | } | ||
259 | } | 261 | } |
260 | 262 | ||
261 | /** | 263 | /** |