diff options
author | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-07-27 09:14:13 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-07-27 09:14:13 -0400 |
commit | c5fbc3966f48279dbebfde10248c977014aa9988 (patch) | |
tree | 0a52f645d89f91952c26b215f460a4ba195ca42c /include | |
parent | 39299d9d15c41cbdd7c7009967cd35afaf34d8fa (diff) | |
parent | 9e566d8bd61f939b7f5d7d969f5b178571471cf9 (diff) |
Merge with master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'include')
55 files changed, 442 insertions, 377 deletions
diff --git a/include/asm-alpha/emergency-restart.h b/include/asm-alpha/emergency-restart.h new file mode 100644 index 000000000000..108d8c48e42e --- /dev/null +++ b/include/asm-alpha/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-arm/arch-imx/imxfb.h b/include/asm-arm/arch-imx/imxfb.h index 2346d454ab9c..7dbc7bbba65d 100644 --- a/include/asm-arm/arch-imx/imxfb.h +++ b/include/asm-arm/arch-imx/imxfb.h | |||
@@ -25,6 +25,7 @@ struct imxfb_mach_info { | |||
25 | u_int pcr; | 25 | u_int pcr; |
26 | u_int pwmr; | 26 | u_int pwmr; |
27 | u_int lscr1; | 27 | u_int lscr1; |
28 | u_int dmacr; | ||
28 | 29 | ||
29 | u_char * fixed_screen_cpu; | 30 | u_char * fixed_screen_cpu; |
30 | dma_addr_t fixed_screen_dma; | 31 | dma_addr_t fixed_screen_dma; |
diff --git a/include/asm-arm/arch-s3c2410/regs-iis.h b/include/asm-arm/arch-s3c2410/regs-iis.h index 385b07d510da..fdd62e8cd6cb 100644 --- a/include/asm-arm/arch-s3c2410/regs-iis.h +++ b/include/asm-arm/arch-s3c2410/regs-iis.h | |||
@@ -15,6 +15,9 @@ | |||
15 | * 12-03-2004 BJD Updated include protection | 15 | * 12-03-2004 BJD Updated include protection |
16 | * 07-03-2005 BJD Added FIFO size flags and S3C2440 MPLL | 16 | * 07-03-2005 BJD Added FIFO size flags and S3C2440 MPLL |
17 | * 05-04-2005 LCVR Added IISFCON definitions for the S3C2400 | 17 | * 05-04-2005 LCVR Added IISFCON definitions for the S3C2400 |
18 | * 18-07-2005 DA Change IISCON_MPLL to IISMOD_MPLL | ||
19 | * Correct IISMOD_256FS and IISMOD_384FS | ||
20 | * Add IISCON_PSCEN | ||
18 | */ | 21 | */ |
19 | 22 | ||
20 | #ifndef __ASM_ARCH_REGS_IIS_H | 23 | #ifndef __ASM_ARCH_REGS_IIS_H |
@@ -22,7 +25,6 @@ | |||
22 | 25 | ||
23 | #define S3C2410_IISCON (0x00) | 26 | #define S3C2410_IISCON (0x00) |
24 | 27 | ||
25 | #define S3C2440_IISCON_MPLL (1<<9) | ||
26 | #define S3C2410_IISCON_LRINDEX (1<<8) | 28 | #define S3C2410_IISCON_LRINDEX (1<<8) |
27 | #define S3C2410_IISCON_TXFIFORDY (1<<7) | 29 | #define S3C2410_IISCON_TXFIFORDY (1<<7) |
28 | #define S3C2410_IISCON_RXFIFORDY (1<<6) | 30 | #define S3C2410_IISCON_RXFIFORDY (1<<6) |
@@ -30,10 +32,12 @@ | |||
30 | #define S3C2410_IISCON_RXDMAEN (1<<4) | 32 | #define S3C2410_IISCON_RXDMAEN (1<<4) |
31 | #define S3C2410_IISCON_TXIDLE (1<<3) | 33 | #define S3C2410_IISCON_TXIDLE (1<<3) |
32 | #define S3C2410_IISCON_RXIDLE (1<<2) | 34 | #define S3C2410_IISCON_RXIDLE (1<<2) |
35 | #define S3C2410_IISCON_PSCEN (1<<1) | ||
33 | #define S3C2410_IISCON_IISEN (1<<0) | 36 | #define S3C2410_IISCON_IISEN (1<<0) |
34 | 37 | ||
35 | #define S3C2410_IISMOD (0x04) | 38 | #define S3C2410_IISMOD (0x04) |
36 | 39 | ||
40 | #define S3C2440_IISMOD_MPLL (1<<9) | ||
37 | #define S3C2410_IISMOD_SLAVE (1<<8) | 41 | #define S3C2410_IISMOD_SLAVE (1<<8) |
38 | #define S3C2410_IISMOD_NOXFER (0<<6) | 42 | #define S3C2410_IISMOD_NOXFER (0<<6) |
39 | #define S3C2410_IISMOD_RXMODE (1<<6) | 43 | #define S3C2410_IISMOD_RXMODE (1<<6) |
@@ -46,8 +50,8 @@ | |||
46 | #define S3C2410_IISMOD_8BIT (0<<3) | 50 | #define S3C2410_IISMOD_8BIT (0<<3) |
47 | #define S3C2410_IISMOD_16BIT (1<<3) | 51 | #define S3C2410_IISMOD_16BIT (1<<3) |
48 | #define S3C2410_IISMOD_BITMASK (1<<3) | 52 | #define S3C2410_IISMOD_BITMASK (1<<3) |
49 | #define S3C2410_IISMOD_256FS (0<<1) | 53 | #define S3C2410_IISMOD_256FS (0<<2) |
50 | #define S3C2410_IISMOD_384FS (1<<1) | 54 | #define S3C2410_IISMOD_384FS (1<<2) |
51 | #define S3C2410_IISMOD_16FS (0<<0) | 55 | #define S3C2410_IISMOD_16FS (0<<0) |
52 | #define S3C2410_IISMOD_32FS (1<<0) | 56 | #define S3C2410_IISMOD_32FS (1<<0) |
53 | #define S3C2410_IISMOD_48FS (2<<0) | 57 | #define S3C2410_IISMOD_48FS (2<<0) |
diff --git a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h index 4edd4dc40c5b..c1adc6b3e86d 100644 --- a/include/asm-arm/bitops.h +++ b/include/asm-arm/bitops.h | |||
@@ -21,8 +21,8 @@ | |||
21 | 21 | ||
22 | #include <asm/system.h> | 22 | #include <asm/system.h> |
23 | 23 | ||
24 | #define smp_mb__before_clear_bit() do { } while (0) | 24 | #define smp_mb__before_clear_bit() mb() |
25 | #define smp_mb__after_clear_bit() do { } while (0) | 25 | #define smp_mb__after_clear_bit() mb() |
26 | 26 | ||
27 | /* | 27 | /* |
28 | * These functions are the basis of our bit ops. | 28 | * These functions are the basis of our bit ops. |
diff --git a/include/asm-arm/emergency-restart.h b/include/asm-arm/emergency-restart.h new file mode 100644 index 000000000000..108d8c48e42e --- /dev/null +++ b/include/asm-arm/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-arm/locks.h b/include/asm-arm/locks.h index c26298f3891f..f08dc8447913 100644 --- a/include/asm-arm/locks.h +++ b/include/asm-arm/locks.h | |||
@@ -28,7 +28,8 @@ | |||
28 | " blmi " #fail \ | 28 | " blmi " #fail \ |
29 | : \ | 29 | : \ |
30 | : "r" (ptr), "I" (1) \ | 30 | : "r" (ptr), "I" (1) \ |
31 | : "ip", "lr", "cc", "memory"); \ | 31 | : "ip", "lr", "cc"); \ |
32 | smp_mb(); \ | ||
32 | }) | 33 | }) |
33 | 34 | ||
34 | #define __down_op_ret(ptr,fail) \ | 35 | #define __down_op_ret(ptr,fail) \ |
@@ -48,12 +49,14 @@ | |||
48 | " mov %0, ip" \ | 49 | " mov %0, ip" \ |
49 | : "=&r" (ret) \ | 50 | : "=&r" (ret) \ |
50 | : "r" (ptr), "I" (1) \ | 51 | : "r" (ptr), "I" (1) \ |
51 | : "ip", "lr", "cc", "memory"); \ | 52 | : "ip", "lr", "cc"); \ |
53 | smp_mb(); \ | ||
52 | ret; \ | 54 | ret; \ |
53 | }) | 55 | }) |
54 | 56 | ||
55 | #define __up_op(ptr,wake) \ | 57 | #define __up_op(ptr,wake) \ |
56 | ({ \ | 58 | ({ \ |
59 | smp_mb(); \ | ||
57 | __asm__ __volatile__( \ | 60 | __asm__ __volatile__( \ |
58 | "@ up_op\n" \ | 61 | "@ up_op\n" \ |
59 | "1: ldrex lr, [%0]\n" \ | 62 | "1: ldrex lr, [%0]\n" \ |
@@ -61,12 +64,12 @@ | |||
61 | " strex ip, lr, [%0]\n" \ | 64 | " strex ip, lr, [%0]\n" \ |
62 | " teq ip, #0\n" \ | 65 | " teq ip, #0\n" \ |
63 | " bne 1b\n" \ | 66 | " bne 1b\n" \ |
64 | " teq lr, #0\n" \ | 67 | " cmp lr, #0\n" \ |
65 | " movle ip, %0\n" \ | 68 | " movle ip, %0\n" \ |
66 | " blle " #wake \ | 69 | " blle " #wake \ |
67 | : \ | 70 | : \ |
68 | : "r" (ptr), "I" (1) \ | 71 | : "r" (ptr), "I" (1) \ |
69 | : "ip", "lr", "cc", "memory"); \ | 72 | : "ip", "lr", "cc"); \ |
70 | }) | 73 | }) |
71 | 74 | ||
72 | /* | 75 | /* |
@@ -92,15 +95,17 @@ | |||
92 | " blne " #fail \ | 95 | " blne " #fail \ |
93 | : \ | 96 | : \ |
94 | : "r" (ptr), "I" (RW_LOCK_BIAS) \ | 97 | : "r" (ptr), "I" (RW_LOCK_BIAS) \ |
95 | : "ip", "lr", "cc", "memory"); \ | 98 | : "ip", "lr", "cc"); \ |
99 | smp_mb(); \ | ||
96 | }) | 100 | }) |
97 | 101 | ||
98 | #define __up_op_write(ptr,wake) \ | 102 | #define __up_op_write(ptr,wake) \ |
99 | ({ \ | 103 | ({ \ |
104 | smp_mb(); \ | ||
100 | __asm__ __volatile__( \ | 105 | __asm__ __volatile__( \ |
101 | "@ up_op_read\n" \ | 106 | "@ up_op_read\n" \ |
102 | "1: ldrex lr, [%0]\n" \ | 107 | "1: ldrex lr, [%0]\n" \ |
103 | " add lr, lr, %1\n" \ | 108 | " adds lr, lr, %1\n" \ |
104 | " strex ip, lr, [%0]\n" \ | 109 | " strex ip, lr, [%0]\n" \ |
105 | " teq ip, #0\n" \ | 110 | " teq ip, #0\n" \ |
106 | " bne 1b\n" \ | 111 | " bne 1b\n" \ |
@@ -108,7 +113,7 @@ | |||
108 | " blcs " #wake \ | 113 | " blcs " #wake \ |
109 | : \ | 114 | : \ |
110 | : "r" (ptr), "I" (RW_LOCK_BIAS) \ | 115 | : "r" (ptr), "I" (RW_LOCK_BIAS) \ |
111 | : "ip", "lr", "cc", "memory"); \ | 116 | : "ip", "lr", "cc"); \ |
112 | }) | 117 | }) |
113 | 118 | ||
114 | #define __down_op_read(ptr,fail) \ | 119 | #define __down_op_read(ptr,fail) \ |
@@ -116,6 +121,7 @@ | |||
116 | 121 | ||
117 | #define __up_op_read(ptr,wake) \ | 122 | #define __up_op_read(ptr,wake) \ |
118 | ({ \ | 123 | ({ \ |
124 | smp_mb(); \ | ||
119 | __asm__ __volatile__( \ | 125 | __asm__ __volatile__( \ |
120 | "@ up_op_read\n" \ | 126 | "@ up_op_read\n" \ |
121 | "1: ldrex lr, [%0]\n" \ | 127 | "1: ldrex lr, [%0]\n" \ |
@@ -128,7 +134,7 @@ | |||
128 | " bleq " #wake \ | 134 | " bleq " #wake \ |
129 | : \ | 135 | : \ |
130 | : "r" (ptr), "I" (1) \ | 136 | : "r" (ptr), "I" (1) \ |
131 | : "ip", "lr", "cc", "memory"); \ | 137 | : "ip", "lr", "cc"); \ |
132 | }) | 138 | }) |
133 | 139 | ||
134 | #else | 140 | #else |
@@ -148,7 +154,8 @@ | |||
148 | " blmi " #fail \ | 154 | " blmi " #fail \ |
149 | : \ | 155 | : \ |
150 | : "r" (ptr), "I" (1) \ | 156 | : "r" (ptr), "I" (1) \ |
151 | : "ip", "lr", "cc", "memory"); \ | 157 | : "ip", "lr", "cc"); \ |
158 | smp_mb(); \ | ||
152 | }) | 159 | }) |
153 | 160 | ||
154 | #define __down_op_ret(ptr,fail) \ | 161 | #define __down_op_ret(ptr,fail) \ |
@@ -169,12 +176,14 @@ | |||
169 | " mov %0, ip" \ | 176 | " mov %0, ip" \ |
170 | : "=&r" (ret) \ | 177 | : "=&r" (ret) \ |
171 | : "r" (ptr), "I" (1) \ | 178 | : "r" (ptr), "I" (1) \ |
172 | : "ip", "lr", "cc", "memory"); \ | 179 | : "ip", "lr", "cc"); \ |
180 | smp_mb(); \ | ||
173 | ret; \ | 181 | ret; \ |
174 | }) | 182 | }) |
175 | 183 | ||
176 | #define __up_op(ptr,wake) \ | 184 | #define __up_op(ptr,wake) \ |
177 | ({ \ | 185 | ({ \ |
186 | smp_mb(); \ | ||
178 | __asm__ __volatile__( \ | 187 | __asm__ __volatile__( \ |
179 | "@ up_op\n" \ | 188 | "@ up_op\n" \ |
180 | " mrs ip, cpsr\n" \ | 189 | " mrs ip, cpsr\n" \ |
@@ -188,7 +197,7 @@ | |||
188 | " blle " #wake \ | 197 | " blle " #wake \ |
189 | : \ | 198 | : \ |
190 | : "r" (ptr), "I" (1) \ | 199 | : "r" (ptr), "I" (1) \ |
191 | : "ip", "lr", "cc", "memory"); \ | 200 | : "ip", "lr", "cc"); \ |
192 | }) | 201 | }) |
193 | 202 | ||
194 | /* | 203 | /* |
@@ -215,7 +224,8 @@ | |||
215 | " blne " #fail \ | 224 | " blne " #fail \ |
216 | : \ | 225 | : \ |
217 | : "r" (ptr), "I" (RW_LOCK_BIAS) \ | 226 | : "r" (ptr), "I" (RW_LOCK_BIAS) \ |
218 | : "ip", "lr", "cc", "memory"); \ | 227 | : "ip", "lr", "cc"); \ |
228 | smp_mb(); \ | ||
219 | }) | 229 | }) |
220 | 230 | ||
221 | #define __up_op_write(ptr,wake) \ | 231 | #define __up_op_write(ptr,wake) \ |
@@ -233,7 +243,8 @@ | |||
233 | " blcs " #wake \ | 243 | " blcs " #wake \ |
234 | : \ | 244 | : \ |
235 | : "r" (ptr), "I" (RW_LOCK_BIAS) \ | 245 | : "r" (ptr), "I" (RW_LOCK_BIAS) \ |
236 | : "ip", "lr", "cc", "memory"); \ | 246 | : "ip", "lr", "cc"); \ |
247 | smp_mb(); \ | ||
237 | }) | 248 | }) |
238 | 249 | ||
239 | #define __down_op_read(ptr,fail) \ | 250 | #define __down_op_read(ptr,fail) \ |
@@ -241,6 +252,7 @@ | |||
241 | 252 | ||
242 | #define __up_op_read(ptr,wake) \ | 253 | #define __up_op_read(ptr,wake) \ |
243 | ({ \ | 254 | ({ \ |
255 | smp_mb(); \ | ||
244 | __asm__ __volatile__( \ | 256 | __asm__ __volatile__( \ |
245 | "@ up_op_read\n" \ | 257 | "@ up_op_read\n" \ |
246 | " mrs ip, cpsr\n" \ | 258 | " mrs ip, cpsr\n" \ |
@@ -254,7 +266,7 @@ | |||
254 | " bleq " #wake \ | 266 | " bleq " #wake \ |
255 | : \ | 267 | : \ |
256 | : "r" (ptr), "I" (1) \ | 268 | : "r" (ptr), "I" (1) \ |
257 | : "ip", "lr", "cc", "memory"); \ | 269 | : "ip", "lr", "cc"); \ |
258 | }) | 270 | }) |
259 | 271 | ||
260 | #endif | 272 | #endif |
diff --git a/include/asm-arm/spinlock.h b/include/asm-arm/spinlock.h index 182323619caa..1f906d09b688 100644 --- a/include/asm-arm/spinlock.h +++ b/include/asm-arm/spinlock.h | |||
@@ -8,9 +8,10 @@ | |||
8 | /* | 8 | /* |
9 | * ARMv6 Spin-locking. | 9 | * ARMv6 Spin-locking. |
10 | * | 10 | * |
11 | * We (exclusively) read the old value, and decrement it. If it | 11 | * We exclusively read the old value. If it is zero, we may have |
12 | * hits zero, we may have won the lock, so we try (exclusively) | 12 | * won the lock, so we try exclusively storing it. A memory barrier |
13 | * storing it. | 13 | * is required after we get a lock, and before we release it, because |
14 | * V6 CPUs are assumed to have weakly ordered memory. | ||
14 | * | 15 | * |
15 | * Unlocked value: 0 | 16 | * Unlocked value: 0 |
16 | * Locked value: 1 | 17 | * Locked value: 1 |
@@ -41,7 +42,9 @@ static inline void _raw_spin_lock(spinlock_t *lock) | |||
41 | " bne 1b" | 42 | " bne 1b" |
42 | : "=&r" (tmp) | 43 | : "=&r" (tmp) |
43 | : "r" (&lock->lock), "r" (1) | 44 | : "r" (&lock->lock), "r" (1) |
44 | : "cc", "memory"); | 45 | : "cc"); |
46 | |||
47 | smp_mb(); | ||
45 | } | 48 | } |
46 | 49 | ||
47 | static inline int _raw_spin_trylock(spinlock_t *lock) | 50 | static inline int _raw_spin_trylock(spinlock_t *lock) |
@@ -54,18 +57,25 @@ static inline int _raw_spin_trylock(spinlock_t *lock) | |||
54 | " strexeq %0, %2, [%1]" | 57 | " strexeq %0, %2, [%1]" |
55 | : "=&r" (tmp) | 58 | : "=&r" (tmp) |
56 | : "r" (&lock->lock), "r" (1) | 59 | : "r" (&lock->lock), "r" (1) |
57 | : "cc", "memory"); | 60 | : "cc"); |
58 | 61 | ||
59 | return tmp == 0; | 62 | if (tmp == 0) { |
63 | smp_mb(); | ||
64 | return 1; | ||
65 | } else { | ||
66 | return 0; | ||
67 | } | ||
60 | } | 68 | } |
61 | 69 | ||
62 | static inline void _raw_spin_unlock(spinlock_t *lock) | 70 | static inline void _raw_spin_unlock(spinlock_t *lock) |
63 | { | 71 | { |
72 | smp_mb(); | ||
73 | |||
64 | __asm__ __volatile__( | 74 | __asm__ __volatile__( |
65 | " str %1, [%0]" | 75 | " str %1, [%0]" |
66 | : | 76 | : |
67 | : "r" (&lock->lock), "r" (0) | 77 | : "r" (&lock->lock), "r" (0) |
68 | : "cc", "memory"); | 78 | : "cc"); |
69 | } | 79 | } |
70 | 80 | ||
71 | /* | 81 | /* |
@@ -79,7 +89,8 @@ typedef struct { | |||
79 | } rwlock_t; | 89 | } rwlock_t; |
80 | 90 | ||
81 | #define RW_LOCK_UNLOCKED (rwlock_t) { 0 } | 91 | #define RW_LOCK_UNLOCKED (rwlock_t) { 0 } |
82 | #define rwlock_init(x) do { *(x) + RW_LOCK_UNLOCKED; } while (0) | 92 | #define rwlock_init(x) do { *(x) = RW_LOCK_UNLOCKED; } while (0) |
93 | #define rwlock_is_locked(x) (*((volatile unsigned int *)(x)) != 0) | ||
83 | 94 | ||
84 | /* | 95 | /* |
85 | * Write locks are easy - we just set bit 31. When unlocking, we can | 96 | * Write locks are easy - we just set bit 31. When unlocking, we can |
@@ -97,16 +108,40 @@ static inline void _raw_write_lock(rwlock_t *rw) | |||
97 | " bne 1b" | 108 | " bne 1b" |
98 | : "=&r" (tmp) | 109 | : "=&r" (tmp) |
99 | : "r" (&rw->lock), "r" (0x80000000) | 110 | : "r" (&rw->lock), "r" (0x80000000) |
100 | : "cc", "memory"); | 111 | : "cc"); |
112 | |||
113 | smp_mb(); | ||
114 | } | ||
115 | |||
116 | static inline int _raw_write_trylock(rwlock_t *rw) | ||
117 | { | ||
118 | unsigned long tmp; | ||
119 | |||
120 | __asm__ __volatile__( | ||
121 | "1: ldrex %0, [%1]\n" | ||
122 | " teq %0, #0\n" | ||
123 | " strexeq %0, %2, [%1]" | ||
124 | : "=&r" (tmp) | ||
125 | : "r" (&rw->lock), "r" (0x80000000) | ||
126 | : "cc"); | ||
127 | |||
128 | if (tmp == 0) { | ||
129 | smp_mb(); | ||
130 | return 1; | ||
131 | } else { | ||
132 | return 0; | ||
133 | } | ||
101 | } | 134 | } |
102 | 135 | ||
103 | static inline void _raw_write_unlock(rwlock_t *rw) | 136 | static inline void _raw_write_unlock(rwlock_t *rw) |
104 | { | 137 | { |
138 | smp_mb(); | ||
139 | |||
105 | __asm__ __volatile__( | 140 | __asm__ __volatile__( |
106 | "str %1, [%0]" | 141 | "str %1, [%0]" |
107 | : | 142 | : |
108 | : "r" (&rw->lock), "r" (0) | 143 | : "r" (&rw->lock), "r" (0) |
109 | : "cc", "memory"); | 144 | : "cc"); |
110 | } | 145 | } |
111 | 146 | ||
112 | /* | 147 | /* |
@@ -133,11 +168,17 @@ static inline void _raw_read_lock(rwlock_t *rw) | |||
133 | " bmi 1b" | 168 | " bmi 1b" |
134 | : "=&r" (tmp), "=&r" (tmp2) | 169 | : "=&r" (tmp), "=&r" (tmp2) |
135 | : "r" (&rw->lock) | 170 | : "r" (&rw->lock) |
136 | : "cc", "memory"); | 171 | : "cc"); |
172 | |||
173 | smp_mb(); | ||
137 | } | 174 | } |
138 | 175 | ||
139 | static inline void _raw_read_unlock(rwlock_t *rw) | 176 | static inline void _raw_read_unlock(rwlock_t *rw) |
140 | { | 177 | { |
178 | unsigned long tmp, tmp2; | ||
179 | |||
180 | smp_mb(); | ||
181 | |||
141 | __asm__ __volatile__( | 182 | __asm__ __volatile__( |
142 | "1: ldrex %0, [%2]\n" | 183 | "1: ldrex %0, [%2]\n" |
143 | " sub %0, %0, #1\n" | 184 | " sub %0, %0, #1\n" |
@@ -146,24 +187,9 @@ static inline void _raw_read_unlock(rwlock_t *rw) | |||
146 | " bne 1b" | 187 | " bne 1b" |
147 | : "=&r" (tmp), "=&r" (tmp2) | 188 | : "=&r" (tmp), "=&r" (tmp2) |
148 | : "r" (&rw->lock) | 189 | : "r" (&rw->lock) |
149 | : "cc", "memory"); | 190 | : "cc"); |
150 | } | 191 | } |
151 | 192 | ||
152 | #define _raw_read_trylock(lock) generic_raw_read_trylock(lock) | 193 | #define _raw_read_trylock(lock) generic_raw_read_trylock(lock) |
153 | 194 | ||
154 | static inline int _raw_write_trylock(rwlock_t *rw) | ||
155 | { | ||
156 | unsigned long tmp; | ||
157 | |||
158 | __asm__ __volatile__( | ||
159 | "1: ldrex %0, [%1]\n" | ||
160 | " teq %0, #0\n" | ||
161 | " strexeq %0, %2, [%1]" | ||
162 | : "=&r" (tmp) | ||
163 | : "r" (&rw->lock), "r" (0x80000000) | ||
164 | : "cc", "memory"); | ||
165 | |||
166 | return tmp == 0; | ||
167 | } | ||
168 | |||
169 | #endif /* __ASM_SPINLOCK_H */ | 195 | #endif /* __ASM_SPINLOCK_H */ |
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h index 2f44b2044214..8efa4ebdcacb 100644 --- a/include/asm-arm/system.h +++ b/include/asm-arm/system.h | |||
@@ -139,7 +139,12 @@ extern unsigned int user_debug; | |||
139 | #define vectors_high() (0) | 139 | #define vectors_high() (0) |
140 | #endif | 140 | #endif |
141 | 141 | ||
142 | #if __LINUX_ARM_ARCH__ >= 6 | ||
143 | #define mb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" \ | ||
144 | : : "r" (0) : "memory") | ||
145 | #else | ||
142 | #define mb() __asm__ __volatile__ ("" : : : "memory") | 146 | #define mb() __asm__ __volatile__ ("" : : : "memory") |
147 | #endif | ||
143 | #define rmb() mb() | 148 | #define rmb() mb() |
144 | #define wmb() mb() | 149 | #define wmb() mb() |
145 | #define read_barrier_depends() do { } while(0) | 150 | #define read_barrier_depends() do { } while(0) |
@@ -323,12 +328,8 @@ do { \ | |||
323 | * NOTE that this solution won't work on an SMP system, so explcitly | 328 | * NOTE that this solution won't work on an SMP system, so explcitly |
324 | * forbid it here. | 329 | * forbid it here. |
325 | */ | 330 | */ |
326 | #ifdef CONFIG_SMP | ||
327 | #error SMP is not supported on SA1100/SA110 | ||
328 | #else | ||
329 | #define swp_is_buggy | 331 | #define swp_is_buggy |
330 | #endif | 332 | #endif |
331 | #endif | ||
332 | 333 | ||
333 | static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size) | 334 | static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size) |
334 | { | 335 | { |
@@ -337,35 +338,68 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size | |||
337 | #ifdef swp_is_buggy | 338 | #ifdef swp_is_buggy |
338 | unsigned long flags; | 339 | unsigned long flags; |
339 | #endif | 340 | #endif |
341 | #if __LINUX_ARM_ARCH__ >= 6 | ||
342 | unsigned int tmp; | ||
343 | #endif | ||
340 | 344 | ||
341 | switch (size) { | 345 | switch (size) { |
342 | #ifdef swp_is_buggy | 346 | #if __LINUX_ARM_ARCH__ >= 6 |
343 | case 1: | 347 | case 1: |
344 | local_irq_save(flags); | 348 | asm volatile("@ __xchg1\n" |
345 | ret = *(volatile unsigned char *)ptr; | 349 | "1: ldrexb %0, [%3]\n" |
346 | *(volatile unsigned char *)ptr = x; | 350 | " strexb %1, %2, [%3]\n" |
347 | local_irq_restore(flags); | 351 | " teq %1, #0\n" |
348 | break; | 352 | " bne 1b" |
349 | 353 | : "=&r" (ret), "=&r" (tmp) | |
350 | case 4: | 354 | : "r" (x), "r" (ptr) |
351 | local_irq_save(flags); | 355 | : "memory", "cc"); |
352 | ret = *(volatile unsigned long *)ptr; | 356 | break; |
353 | *(volatile unsigned long *)ptr = x; | 357 | case 4: |
354 | local_irq_restore(flags); | 358 | asm volatile("@ __xchg4\n" |
355 | break; | 359 | "1: ldrex %0, [%3]\n" |
360 | " strex %1, %2, [%3]\n" | ||
361 | " teq %1, #0\n" | ||
362 | " bne 1b" | ||
363 | : "=&r" (ret), "=&r" (tmp) | ||
364 | : "r" (x), "r" (ptr) | ||
365 | : "memory", "cc"); | ||
366 | break; | ||
367 | #elif defined(swp_is_buggy) | ||
368 | #ifdef CONFIG_SMP | ||
369 | #error SMP is not supported on this platform | ||
370 | #endif | ||
371 | case 1: | ||
372 | local_irq_save(flags); | ||
373 | ret = *(volatile unsigned char *)ptr; | ||
374 | *(volatile unsigned char *)ptr = x; | ||
375 | local_irq_restore(flags); | ||
376 | break; | ||
377 | |||
378 | case 4: | ||
379 | local_irq_save(flags); | ||
380 | ret = *(volatile unsigned long *)ptr; | ||
381 | *(volatile unsigned long *)ptr = x; | ||
382 | local_irq_restore(flags); | ||
383 | break; | ||
356 | #else | 384 | #else |
357 | case 1: __asm__ __volatile__ ("swpb %0, %1, [%2]" | 385 | case 1: |
358 | : "=&r" (ret) | 386 | asm volatile("@ __xchg1\n" |
359 | : "r" (x), "r" (ptr) | 387 | " swpb %0, %1, [%2]" |
360 | : "memory", "cc"); | 388 | : "=&r" (ret) |
361 | break; | 389 | : "r" (x), "r" (ptr) |
362 | case 4: __asm__ __volatile__ ("swp %0, %1, [%2]" | 390 | : "memory", "cc"); |
363 | : "=&r" (ret) | 391 | break; |
364 | : "r" (x), "r" (ptr) | 392 | case 4: |
365 | : "memory", "cc"); | 393 | asm volatile("@ __xchg4\n" |
366 | break; | 394 | " swp %0, %1, [%2]" |
395 | : "=&r" (ret) | ||
396 | : "r" (x), "r" (ptr) | ||
397 | : "memory", "cc"); | ||
398 | break; | ||
367 | #endif | 399 | #endif |
368 | default: __bad_xchg(ptr, size), ret = 0; | 400 | default: |
401 | __bad_xchg(ptr, size), ret = 0; | ||
402 | break; | ||
369 | } | 403 | } |
370 | 404 | ||
371 | return ret; | 405 | return ret; |
diff --git a/include/asm-arm26/emergency-restart.h b/include/asm-arm26/emergency-restart.h new file mode 100644 index 000000000000..108d8c48e42e --- /dev/null +++ b/include/asm-arm26/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-cris/emergency-restart.h b/include/asm-cris/emergency-restart.h new file mode 100644 index 000000000000..108d8c48e42e --- /dev/null +++ b/include/asm-cris/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-frv/emergency-restart.h b/include/asm-frv/emergency-restart.h new file mode 100644 index 000000000000..108d8c48e42e --- /dev/null +++ b/include/asm-frv/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-generic/emergency-restart.h b/include/asm-generic/emergency-restart.h new file mode 100644 index 000000000000..0d68a1eae985 --- /dev/null +++ b/include/asm-generic/emergency-restart.h | |||
@@ -0,0 +1,9 @@ | |||
1 | #ifndef _ASM_GENERIC_EMERGENCY_RESTART_H | ||
2 | #define _ASM_GENERIC_EMERGENCY_RESTART_H | ||
3 | |||
4 | static inline void machine_emergency_restart(void) | ||
5 | { | ||
6 | machine_restart(NULL); | ||
7 | } | ||
8 | |||
9 | #endif /* _ASM_GENERIC_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-h8300/emergency-restart.h b/include/asm-h8300/emergency-restart.h new file mode 100644 index 000000000000..108d8c48e42e --- /dev/null +++ b/include/asm-h8300/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-i386/emergency-restart.h b/include/asm-i386/emergency-restart.h new file mode 100644 index 000000000000..680c39563345 --- /dev/null +++ b/include/asm-i386/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | extern void machine_emergency_restart(void); | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-i386/i387.h b/include/asm-i386/i387.h index f6feb98a9397..6747006743f9 100644 --- a/include/asm-i386/i387.h +++ b/include/asm-i386/i387.h | |||
@@ -19,10 +19,21 @@ | |||
19 | 19 | ||
20 | extern void mxcsr_feature_mask_init(void); | 20 | extern void mxcsr_feature_mask_init(void); |
21 | extern void init_fpu(struct task_struct *); | 21 | extern void init_fpu(struct task_struct *); |
22 | |||
22 | /* | 23 | /* |
23 | * FPU lazy state save handling... | 24 | * FPU lazy state save handling... |
24 | */ | 25 | */ |
25 | extern void restore_fpu( struct task_struct *tsk ); | 26 | |
27 | /* | ||
28 | * The "nop" is needed to make the instructions the same | ||
29 | * length. | ||
30 | */ | ||
31 | #define restore_fpu(tsk) \ | ||
32 | alternative_input( \ | ||
33 | "nop ; frstor %1", \ | ||
34 | "fxrstor %1", \ | ||
35 | X86_FEATURE_FXSR, \ | ||
36 | "m" ((tsk)->thread.i387.fxsave)) | ||
26 | 37 | ||
27 | extern void kernel_fpu_begin(void); | 38 | extern void kernel_fpu_begin(void); |
28 | #define kernel_fpu_end() do { stts(); preempt_enable(); } while(0) | 39 | #define kernel_fpu_end() do { stts(); preempt_enable(); } while(0) |
@@ -32,13 +43,12 @@ extern void kernel_fpu_begin(void); | |||
32 | */ | 43 | */ |
33 | static inline void __save_init_fpu( struct task_struct *tsk ) | 44 | static inline void __save_init_fpu( struct task_struct *tsk ) |
34 | { | 45 | { |
35 | if ( cpu_has_fxsr ) { | 46 | alternative_input( |
36 | asm volatile( "fxsave %0 ; fnclex" | 47 | "fnsave %1 ; fwait ;" GENERIC_NOP2, |
37 | : "=m" (tsk->thread.i387.fxsave) ); | 48 | "fxsave %1 ; fnclex", |
38 | } else { | 49 | X86_FEATURE_FXSR, |
39 | asm volatile( "fnsave %0 ; fwait" | 50 | "m" (tsk->thread.i387.fxsave) |
40 | : "=m" (tsk->thread.i387.fsave) ); | 51 | :"memory"); |
41 | } | ||
42 | tsk->thread_info->status &= ~TS_USEDFPU; | 52 | tsk->thread_info->status &= ~TS_USEDFPU; |
43 | } | 53 | } |
44 | 54 | ||
diff --git a/include/asm-i386/ptrace.h b/include/asm-i386/ptrace.h index eef9f93870d4..b926cb4f4cfd 100644 --- a/include/asm-i386/ptrace.h +++ b/include/asm-i386/ptrace.h | |||
@@ -57,14 +57,21 @@ struct pt_regs { | |||
57 | #ifdef __KERNEL__ | 57 | #ifdef __KERNEL__ |
58 | struct task_struct; | 58 | struct task_struct; |
59 | extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code); | 59 | extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code); |
60 | #define user_mode(regs) (3 & (regs)->xcs) | 60 | |
61 | #define user_mode_vm(regs) ((VM_MASK & (regs)->eflags) || user_mode(regs)) | 61 | static inline int user_mode(struct pt_regs *regs) |
62 | { | ||
63 | return (regs->xcs & 3) != 0; | ||
64 | } | ||
65 | static inline int user_mode_vm(struct pt_regs *regs) | ||
66 | { | ||
67 | return ((regs->xcs & 3) | (regs->eflags & VM_MASK)) != 0; | ||
68 | } | ||
62 | #define instruction_pointer(regs) ((regs)->eip) | 69 | #define instruction_pointer(regs) ((regs)->eip) |
63 | #if defined(CONFIG_SMP) && defined(CONFIG_FRAME_POINTER) | 70 | #if defined(CONFIG_SMP) && defined(CONFIG_FRAME_POINTER) |
64 | extern unsigned long profile_pc(struct pt_regs *regs); | 71 | extern unsigned long profile_pc(struct pt_regs *regs); |
65 | #else | 72 | #else |
66 | #define profile_pc(regs) instruction_pointer(regs) | 73 | #define profile_pc(regs) instruction_pointer(regs) |
67 | #endif | 74 | #endif |
68 | #endif | 75 | #endif /* __KERNEL__ */ |
69 | 76 | ||
70 | #endif | 77 | #endif |
diff --git a/include/asm-ia64/emergency-restart.h b/include/asm-ia64/emergency-restart.h new file mode 100644 index 000000000000..108d8c48e42e --- /dev/null +++ b/include/asm-ia64/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-m32r/emergency-restart.h b/include/asm-m32r/emergency-restart.h new file mode 100644 index 000000000000..108d8c48e42e --- /dev/null +++ b/include/asm-m32r/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-m68k/emergency-restart.h b/include/asm-m68k/emergency-restart.h new file mode 100644 index 000000000000..108d8c48e42e --- /dev/null +++ b/include/asm-m68k/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-m68knommu/emergency-restart.h b/include/asm-m68knommu/emergency-restart.h new file mode 100644 index 000000000000..108d8c48e42e --- /dev/null +++ b/include/asm-m68knommu/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-mips/emergency-restart.h b/include/asm-mips/emergency-restart.h new file mode 100644 index 000000000000..108d8c48e42e --- /dev/null +++ b/include/asm-mips/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-parisc/emergency-restart.h b/include/asm-parisc/emergency-restart.h new file mode 100644 index 000000000000..108d8c48e42e --- /dev/null +++ b/include/asm-parisc/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-ppc/emergency-restart.h b/include/asm-ppc/emergency-restart.h new file mode 100644 index 000000000000..108d8c48e42e --- /dev/null +++ b/include/asm-ppc/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-ppc64/emergency-restart.h b/include/asm-ppc64/emergency-restart.h new file mode 100644 index 000000000000..108d8c48e42e --- /dev/null +++ b/include/asm-ppc64/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-s390/emergency-restart.h b/include/asm-s390/emergency-restart.h new file mode 100644 index 000000000000..108d8c48e42e --- /dev/null +++ b/include/asm-s390/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-sh/emergency-restart.h b/include/asm-sh/emergency-restart.h new file mode 100644 index 000000000000..108d8c48e42e --- /dev/null +++ b/include/asm-sh/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-sh64/emergency-restart.h b/include/asm-sh64/emergency-restart.h new file mode 100644 index 000000000000..108d8c48e42e --- /dev/null +++ b/include/asm-sh64/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-sparc/emergency-restart.h b/include/asm-sparc/emergency-restart.h new file mode 100644 index 000000000000..108d8c48e42e --- /dev/null +++ b/include/asm-sparc/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-sparc64/bitops.h b/include/asm-sparc64/bitops.h index 9d722dc8cca3..9c5e71970287 100644 --- a/include/asm-sparc64/bitops.h +++ b/include/asm-sparc64/bitops.h | |||
@@ -20,52 +20,52 @@ extern void change_bit(unsigned long nr, volatile unsigned long *addr); | |||
20 | 20 | ||
21 | /* "non-atomic" versions... */ | 21 | /* "non-atomic" versions... */ |
22 | 22 | ||
23 | static __inline__ void __set_bit(int nr, volatile unsigned long *addr) | 23 | static inline void __set_bit(int nr, volatile unsigned long *addr) |
24 | { | 24 | { |
25 | volatile unsigned long *m = addr + (nr >> 6); | 25 | unsigned long *m = ((unsigned long *)addr) + (nr >> 6); |
26 | 26 | ||
27 | *m |= (1UL << (nr & 63)); | 27 | *m |= (1UL << (nr & 63)); |
28 | } | 28 | } |
29 | 29 | ||
30 | static __inline__ void __clear_bit(int nr, volatile unsigned long *addr) | 30 | static inline void __clear_bit(int nr, volatile unsigned long *addr) |
31 | { | 31 | { |
32 | volatile unsigned long *m = addr + (nr >> 6); | 32 | unsigned long *m = ((unsigned long *)addr) + (nr >> 6); |
33 | 33 | ||
34 | *m &= ~(1UL << (nr & 63)); | 34 | *m &= ~(1UL << (nr & 63)); |
35 | } | 35 | } |
36 | 36 | ||
37 | static __inline__ void __change_bit(int nr, volatile unsigned long *addr) | 37 | static inline void __change_bit(int nr, volatile unsigned long *addr) |
38 | { | 38 | { |
39 | volatile unsigned long *m = addr + (nr >> 6); | 39 | unsigned long *m = ((unsigned long *)addr) + (nr >> 6); |
40 | 40 | ||
41 | *m ^= (1UL << (nr & 63)); | 41 | *m ^= (1UL << (nr & 63)); |
42 | } | 42 | } |
43 | 43 | ||
44 | static __inline__ int __test_and_set_bit(int nr, volatile unsigned long *addr) | 44 | static inline int __test_and_set_bit(int nr, volatile unsigned long *addr) |
45 | { | 45 | { |
46 | volatile unsigned long *m = addr + (nr >> 6); | 46 | unsigned long *m = ((unsigned long *)addr) + (nr >> 6); |
47 | long old = *m; | 47 | unsigned long old = *m; |
48 | long mask = (1UL << (nr & 63)); | 48 | unsigned long mask = (1UL << (nr & 63)); |
49 | 49 | ||
50 | *m = (old | mask); | 50 | *m = (old | mask); |
51 | return ((old & mask) != 0); | 51 | return ((old & mask) != 0); |
52 | } | 52 | } |
53 | 53 | ||
54 | static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long *addr) | 54 | static inline int __test_and_clear_bit(int nr, volatile unsigned long *addr) |
55 | { | 55 | { |
56 | volatile unsigned long *m = addr + (nr >> 6); | 56 | unsigned long *m = ((unsigned long *)addr) + (nr >> 6); |
57 | long old = *m; | 57 | unsigned long old = *m; |
58 | long mask = (1UL << (nr & 63)); | 58 | unsigned long mask = (1UL << (nr & 63)); |
59 | 59 | ||
60 | *m = (old & ~mask); | 60 | *m = (old & ~mask); |
61 | return ((old & mask) != 0); | 61 | return ((old & mask) != 0); |
62 | } | 62 | } |
63 | 63 | ||
64 | static __inline__ int __test_and_change_bit(int nr, volatile unsigned long *addr) | 64 | static inline int __test_and_change_bit(int nr, volatile unsigned long *addr) |
65 | { | 65 | { |
66 | volatile unsigned long *m = addr + (nr >> 6); | 66 | unsigned long *m = ((unsigned long *)addr) + (nr >> 6); |
67 | long old = *m; | 67 | unsigned long old = *m; |
68 | long mask = (1UL << (nr & 63)); | 68 | unsigned long mask = (1UL << (nr & 63)); |
69 | 69 | ||
70 | *m = (old ^ mask); | 70 | *m = (old ^ mask); |
71 | return ((old & mask) != 0); | 71 | return ((old & mask) != 0); |
@@ -79,13 +79,13 @@ static __inline__ int __test_and_change_bit(int nr, volatile unsigned long *addr | |||
79 | #define smp_mb__after_clear_bit() barrier() | 79 | #define smp_mb__after_clear_bit() barrier() |
80 | #endif | 80 | #endif |
81 | 81 | ||
82 | static __inline__ int test_bit(int nr, __const__ volatile unsigned long *addr) | 82 | static inline int test_bit(int nr, __const__ volatile unsigned long *addr) |
83 | { | 83 | { |
84 | return (1UL & ((addr)[nr >> 6] >> (nr & 63))) != 0UL; | 84 | return (1UL & (addr[nr >> 6] >> (nr & 63))) != 0UL; |
85 | } | 85 | } |
86 | 86 | ||
87 | /* The easy/cheese version for now. */ | 87 | /* The easy/cheese version for now. */ |
88 | static __inline__ unsigned long ffz(unsigned long word) | 88 | static inline unsigned long ffz(unsigned long word) |
89 | { | 89 | { |
90 | unsigned long result; | 90 | unsigned long result; |
91 | 91 | ||
@@ -103,7 +103,7 @@ static __inline__ unsigned long ffz(unsigned long word) | |||
103 | * | 103 | * |
104 | * Undefined if no bit exists, so code should check against 0 first. | 104 | * Undefined if no bit exists, so code should check against 0 first. |
105 | */ | 105 | */ |
106 | static __inline__ unsigned long __ffs(unsigned long word) | 106 | static inline unsigned long __ffs(unsigned long word) |
107 | { | 107 | { |
108 | unsigned long result = 0; | 108 | unsigned long result = 0; |
109 | 109 | ||
@@ -144,7 +144,7 @@ static inline int sched_find_first_bit(unsigned long *b) | |||
144 | * the libc and compiler builtin ffs routines, therefore | 144 | * the libc and compiler builtin ffs routines, therefore |
145 | * differs in spirit from the above ffz (man ffs). | 145 | * differs in spirit from the above ffz (man ffs). |
146 | */ | 146 | */ |
147 | static __inline__ int ffs(int x) | 147 | static inline int ffs(int x) |
148 | { | 148 | { |
149 | if (!x) | 149 | if (!x) |
150 | return 0; | 150 | return 0; |
@@ -158,7 +158,7 @@ static __inline__ int ffs(int x) | |||
158 | 158 | ||
159 | #ifdef ULTRA_HAS_POPULATION_COUNT | 159 | #ifdef ULTRA_HAS_POPULATION_COUNT |
160 | 160 | ||
161 | static __inline__ unsigned int hweight64(unsigned long w) | 161 | static inline unsigned int hweight64(unsigned long w) |
162 | { | 162 | { |
163 | unsigned int res; | 163 | unsigned int res; |
164 | 164 | ||
@@ -166,7 +166,7 @@ static __inline__ unsigned int hweight64(unsigned long w) | |||
166 | return res; | 166 | return res; |
167 | } | 167 | } |
168 | 168 | ||
169 | static __inline__ unsigned int hweight32(unsigned int w) | 169 | static inline unsigned int hweight32(unsigned int w) |
170 | { | 170 | { |
171 | unsigned int res; | 171 | unsigned int res; |
172 | 172 | ||
@@ -174,7 +174,7 @@ static __inline__ unsigned int hweight32(unsigned int w) | |||
174 | return res; | 174 | return res; |
175 | } | 175 | } |
176 | 176 | ||
177 | static __inline__ unsigned int hweight16(unsigned int w) | 177 | static inline unsigned int hweight16(unsigned int w) |
178 | { | 178 | { |
179 | unsigned int res; | 179 | unsigned int res; |
180 | 180 | ||
@@ -182,7 +182,7 @@ static __inline__ unsigned int hweight16(unsigned int w) | |||
182 | return res; | 182 | return res; |
183 | } | 183 | } |
184 | 184 | ||
185 | static __inline__ unsigned int hweight8(unsigned int w) | 185 | static inline unsigned int hweight8(unsigned int w) |
186 | { | 186 | { |
187 | unsigned int res; | 187 | unsigned int res; |
188 | 188 | ||
@@ -236,7 +236,7 @@ extern unsigned long find_next_zero_bit(const unsigned long *, | |||
236 | #define test_and_clear_le_bit(nr,addr) \ | 236 | #define test_and_clear_le_bit(nr,addr) \ |
237 | test_and_clear_bit((nr) ^ 0x38, (addr)) | 237 | test_and_clear_bit((nr) ^ 0x38, (addr)) |
238 | 238 | ||
239 | static __inline__ int test_le_bit(int nr, __const__ unsigned long * addr) | 239 | static inline int test_le_bit(int nr, __const__ unsigned long * addr) |
240 | { | 240 | { |
241 | int mask; | 241 | int mask; |
242 | __const__ unsigned char *ADDR = (__const__ unsigned char *) addr; | 242 | __const__ unsigned char *ADDR = (__const__ unsigned char *) addr; |
diff --git a/include/asm-sparc64/emergency-restart.h b/include/asm-sparc64/emergency-restart.h new file mode 100644 index 000000000000..108d8c48e42e --- /dev/null +++ b/include/asm-sparc64/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-sparc64/ptrace.h b/include/asm-sparc64/ptrace.h index 2d2b5a113d24..6194f771e9fc 100644 --- a/include/asm-sparc64/ptrace.h +++ b/include/asm-sparc64/ptrace.h | |||
@@ -94,8 +94,9 @@ struct sparc_trapf { | |||
94 | #define STACKFRAME32_SZ sizeof(struct sparc_stackf32) | 94 | #define STACKFRAME32_SZ sizeof(struct sparc_stackf32) |
95 | 95 | ||
96 | #ifdef __KERNEL__ | 96 | #ifdef __KERNEL__ |
97 | #define force_successful_syscall_return() \ | 97 | #define force_successful_syscall_return() \ |
98 | set_thread_flag(TIF_SYSCALL_SUCCESS) | 98 | do { current_thread_info()->syscall_noerror = 1; \ |
99 | } while (0) | ||
99 | #define user_mode(regs) (!((regs)->tstate & TSTATE_PRIV)) | 100 | #define user_mode(regs) (!((regs)->tstate & TSTATE_PRIV)) |
100 | #define instruction_pointer(regs) ((regs)->tpc) | 101 | #define instruction_pointer(regs) ((regs)->tpc) |
101 | #ifdef CONFIG_SMP | 102 | #ifdef CONFIG_SMP |
diff --git a/include/asm-sparc64/rwsem.h b/include/asm-sparc64/rwsem.h index a1cc94f95984..4568ee4022df 100644 --- a/include/asm-sparc64/rwsem.h +++ b/include/asm-sparc64/rwsem.h | |||
@@ -46,54 +46,14 @@ extern void __up_read(struct rw_semaphore *sem); | |||
46 | extern void __up_write(struct rw_semaphore *sem); | 46 | extern void __up_write(struct rw_semaphore *sem); |
47 | extern void __downgrade_write(struct rw_semaphore *sem); | 47 | extern void __downgrade_write(struct rw_semaphore *sem); |
48 | 48 | ||
49 | static __inline__ int rwsem_atomic_update(int delta, struct rw_semaphore *sem) | 49 | static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem) |
50 | { | 50 | { |
51 | int tmp = delta; | 51 | return atomic_add_return(delta, (atomic_t *)(&sem->count)); |
52 | |||
53 | __asm__ __volatile__( | ||
54 | "1:\tlduw [%2], %%g1\n\t" | ||
55 | "add %%g1, %1, %%g7\n\t" | ||
56 | "cas [%2], %%g1, %%g7\n\t" | ||
57 | "cmp %%g1, %%g7\n\t" | ||
58 | "membar #StoreLoad | #StoreStore\n\t" | ||
59 | "bne,pn %%icc, 1b\n\t" | ||
60 | " nop\n\t" | ||
61 | "mov %%g7, %0\n\t" | ||
62 | : "=&r" (tmp) | ||
63 | : "0" (tmp), "r" (sem) | ||
64 | : "g1", "g7", "memory", "cc"); | ||
65 | |||
66 | return tmp + delta; | ||
67 | } | ||
68 | |||
69 | #define rwsem_atomic_add rwsem_atomic_update | ||
70 | |||
71 | static __inline__ __u16 rwsem_cmpxchgw(struct rw_semaphore *sem, __u16 __old, __u16 __new) | ||
72 | { | ||
73 | u32 old = (sem->count & 0xffff0000) | (u32) __old; | ||
74 | u32 new = (old & 0xffff0000) | (u32) __new; | ||
75 | u32 prev; | ||
76 | |||
77 | again: | ||
78 | __asm__ __volatile__("cas [%2], %3, %0\n\t" | ||
79 | "membar #StoreLoad | #StoreStore" | ||
80 | : "=&r" (prev) | ||
81 | : "0" (new), "r" (sem), "r" (old) | ||
82 | : "memory"); | ||
83 | |||
84 | /* To give the same semantics as x86 cmpxchgw, keep trying | ||
85 | * if only the upper 16-bits changed. | ||
86 | */ | ||
87 | if (prev != old && | ||
88 | ((prev & 0xffff) == (old & 0xffff))) | ||
89 | goto again; | ||
90 | |||
91 | return prev & 0xffff; | ||
92 | } | 52 | } |
93 | 53 | ||
94 | static __inline__ signed long rwsem_cmpxchg(struct rw_semaphore *sem, signed long old, signed long new) | 54 | static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem) |
95 | { | 55 | { |
96 | return cmpxchg(&sem->count,old,new); | 56 | atomic_add(delta, (atomic_t *)(&sem->count)); |
97 | } | 57 | } |
98 | 58 | ||
99 | #endif /* __KERNEL__ */ | 59 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-sparc64/spitfire.h b/include/asm-sparc64/spitfire.h index 1aa932773af8..962638c9d122 100644 --- a/include/asm-sparc64/spitfire.h +++ b/include/asm-sparc64/spitfire.h | |||
@@ -56,52 +56,6 @@ extern void cheetah_enable_pcache(void); | |||
56 | SPITFIRE_HIGHEST_LOCKED_TLBENT : \ | 56 | SPITFIRE_HIGHEST_LOCKED_TLBENT : \ |
57 | CHEETAH_HIGHEST_LOCKED_TLBENT) | 57 | CHEETAH_HIGHEST_LOCKED_TLBENT) |
58 | 58 | ||
59 | static __inline__ unsigned long spitfire_get_isfsr(void) | ||
60 | { | ||
61 | unsigned long ret; | ||
62 | |||
63 | __asm__ __volatile__("ldxa [%1] %2, %0" | ||
64 | : "=r" (ret) | ||
65 | : "r" (TLB_SFSR), "i" (ASI_IMMU)); | ||
66 | return ret; | ||
67 | } | ||
68 | |||
69 | static __inline__ unsigned long spitfire_get_dsfsr(void) | ||
70 | { | ||
71 | unsigned long ret; | ||
72 | |||
73 | __asm__ __volatile__("ldxa [%1] %2, %0" | ||
74 | : "=r" (ret) | ||
75 | : "r" (TLB_SFSR), "i" (ASI_DMMU)); | ||
76 | return ret; | ||
77 | } | ||
78 | |||
79 | static __inline__ unsigned long spitfire_get_sfar(void) | ||
80 | { | ||
81 | unsigned long ret; | ||
82 | |||
83 | __asm__ __volatile__("ldxa [%1] %2, %0" | ||
84 | : "=r" (ret) | ||
85 | : "r" (DMMU_SFAR), "i" (ASI_DMMU)); | ||
86 | return ret; | ||
87 | } | ||
88 | |||
89 | static __inline__ void spitfire_put_isfsr(unsigned long sfsr) | ||
90 | { | ||
91 | __asm__ __volatile__("stxa %0, [%1] %2\n\t" | ||
92 | "membar #Sync" | ||
93 | : /* no outputs */ | ||
94 | : "r" (sfsr), "r" (TLB_SFSR), "i" (ASI_IMMU)); | ||
95 | } | ||
96 | |||
97 | static __inline__ void spitfire_put_dsfsr(unsigned long sfsr) | ||
98 | { | ||
99 | __asm__ __volatile__("stxa %0, [%1] %2\n\t" | ||
100 | "membar #Sync" | ||
101 | : /* no outputs */ | ||
102 | : "r" (sfsr), "r" (TLB_SFSR), "i" (ASI_DMMU)); | ||
103 | } | ||
104 | |||
105 | /* The data cache is write through, so this just invalidates the | 59 | /* The data cache is write through, so this just invalidates the |
106 | * specified line. | 60 | * specified line. |
107 | */ | 61 | */ |
@@ -193,90 +147,6 @@ static __inline__ void spitfire_put_itlb_data(int entry, unsigned long data) | |||
193 | "i" (ASI_ITLB_DATA_ACCESS)); | 147 | "i" (ASI_ITLB_DATA_ACCESS)); |
194 | } | 148 | } |
195 | 149 | ||
196 | /* Spitfire hardware assisted TLB flushes. */ | ||
197 | |||
198 | /* Context level flushes. */ | ||
199 | static __inline__ void spitfire_flush_dtlb_primary_context(void) | ||
200 | { | ||
201 | __asm__ __volatile__("stxa %%g0, [%0] %1\n\t" | ||
202 | "membar #Sync" | ||
203 | : /* No outputs */ | ||
204 | : "r" (0x40), "i" (ASI_DMMU_DEMAP)); | ||
205 | } | ||
206 | |||
207 | static __inline__ void spitfire_flush_itlb_primary_context(void) | ||
208 | { | ||
209 | __asm__ __volatile__("stxa %%g0, [%0] %1\n\t" | ||
210 | "membar #Sync" | ||
211 | : /* No outputs */ | ||
212 | : "r" (0x40), "i" (ASI_IMMU_DEMAP)); | ||
213 | } | ||
214 | |||
215 | static __inline__ void spitfire_flush_dtlb_secondary_context(void) | ||
216 | { | ||
217 | __asm__ __volatile__("stxa %%g0, [%0] %1\n\t" | ||
218 | "membar #Sync" | ||
219 | : /* No outputs */ | ||
220 | : "r" (0x50), "i" (ASI_DMMU_DEMAP)); | ||
221 | } | ||
222 | |||
223 | static __inline__ void spitfire_flush_itlb_secondary_context(void) | ||
224 | { | ||
225 | __asm__ __volatile__("stxa %%g0, [%0] %1\n\t" | ||
226 | "membar #Sync" | ||
227 | : /* No outputs */ | ||
228 | : "r" (0x50), "i" (ASI_IMMU_DEMAP)); | ||
229 | } | ||
230 | |||
231 | static __inline__ void spitfire_flush_dtlb_nucleus_context(void) | ||
232 | { | ||
233 | __asm__ __volatile__("stxa %%g0, [%0] %1\n\t" | ||
234 | "membar #Sync" | ||
235 | : /* No outputs */ | ||
236 | : "r" (0x60), "i" (ASI_DMMU_DEMAP)); | ||
237 | } | ||
238 | |||
239 | static __inline__ void spitfire_flush_itlb_nucleus_context(void) | ||
240 | { | ||
241 | __asm__ __volatile__("stxa %%g0, [%0] %1\n\t" | ||
242 | "membar #Sync" | ||
243 | : /* No outputs */ | ||
244 | : "r" (0x60), "i" (ASI_IMMU_DEMAP)); | ||
245 | } | ||
246 | |||
247 | /* Page level flushes. */ | ||
248 | static __inline__ void spitfire_flush_dtlb_primary_page(unsigned long page) | ||
249 | { | ||
250 | __asm__ __volatile__("stxa %%g0, [%0] %1\n\t" | ||
251 | "membar #Sync" | ||
252 | : /* No outputs */ | ||
253 | : "r" (page), "i" (ASI_DMMU_DEMAP)); | ||
254 | } | ||
255 | |||
256 | static __inline__ void spitfire_flush_itlb_primary_page(unsigned long page) | ||
257 | { | ||
258 | __asm__ __volatile__("stxa %%g0, [%0] %1\n\t" | ||
259 | "membar #Sync" | ||
260 | : /* No outputs */ | ||
261 | : "r" (page), "i" (ASI_IMMU_DEMAP)); | ||
262 | } | ||
263 | |||
264 | static __inline__ void spitfire_flush_dtlb_secondary_page(unsigned long page) | ||
265 | { | ||
266 | __asm__ __volatile__("stxa %%g0, [%0] %1\n\t" | ||
267 | "membar #Sync" | ||
268 | : /* No outputs */ | ||
269 | : "r" (page | 0x10), "i" (ASI_DMMU_DEMAP)); | ||
270 | } | ||
271 | |||
272 | static __inline__ void spitfire_flush_itlb_secondary_page(unsigned long page) | ||
273 | { | ||
274 | __asm__ __volatile__("stxa %%g0, [%0] %1\n\t" | ||
275 | "membar #Sync" | ||
276 | : /* No outputs */ | ||
277 | : "r" (page | 0x10), "i" (ASI_IMMU_DEMAP)); | ||
278 | } | ||
279 | |||
280 | static __inline__ void spitfire_flush_dtlb_nucleus_page(unsigned long page) | 150 | static __inline__ void spitfire_flush_dtlb_nucleus_page(unsigned long page) |
281 | { | 151 | { |
282 | __asm__ __volatile__("stxa %%g0, [%0] %1\n\t" | 152 | __asm__ __volatile__("stxa %%g0, [%0] %1\n\t" |
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h index f9be2c5b4dc9..ee4bdfc6b88f 100644 --- a/include/asm-sparc64/system.h +++ b/include/asm-sparc64/system.h | |||
@@ -190,24 +190,23 @@ do { if (test_thread_flag(TIF_PERFCTR)) { \ | |||
190 | "wrpr %%g1, %%cwp\n\t" \ | 190 | "wrpr %%g1, %%cwp\n\t" \ |
191 | "ldx [%%g6 + %3], %%o6\n\t" \ | 191 | "ldx [%%g6 + %3], %%o6\n\t" \ |
192 | "ldub [%%g6 + %2], %%o5\n\t" \ | 192 | "ldub [%%g6 + %2], %%o5\n\t" \ |
193 | "ldx [%%g6 + %4], %%o7\n\t" \ | 193 | "ldub [%%g6 + %4], %%o7\n\t" \ |
194 | "mov %%g6, %%l2\n\t" \ | 194 | "mov %%g6, %%l2\n\t" \ |
195 | "wrpr %%o5, 0x0, %%wstate\n\t" \ | 195 | "wrpr %%o5, 0x0, %%wstate\n\t" \ |
196 | "ldx [%%sp + 2047 + 0x70], %%i6\n\t" \ | 196 | "ldx [%%sp + 2047 + 0x70], %%i6\n\t" \ |
197 | "ldx [%%sp + 2047 + 0x78], %%i7\n\t" \ | 197 | "ldx [%%sp + 2047 + 0x78], %%i7\n\t" \ |
198 | "wrpr %%g0, 0x94, %%pstate\n\t" \ | 198 | "wrpr %%g0, 0x94, %%pstate\n\t" \ |
199 | "mov %%l2, %%g6\n\t" \ | 199 | "mov %%l2, %%g6\n\t" \ |
200 | "ldx [%%g6 + %7], %%g4\n\t" \ | 200 | "ldx [%%g6 + %6], %%g4\n\t" \ |
201 | "wrpr %%g0, 0x96, %%pstate\n\t" \ | 201 | "wrpr %%g0, 0x96, %%pstate\n\t" \ |
202 | "andcc %%o7, %6, %%g0\n\t" \ | 202 | "brz,pt %%o7, 1f\n\t" \ |
203 | "beq,pt %%icc, 1f\n\t" \ | ||
204 | " mov %%g7, %0\n\t" \ | 203 | " mov %%g7, %0\n\t" \ |
205 | "b,a ret_from_syscall\n\t" \ | 204 | "b,a ret_from_syscall\n\t" \ |
206 | "1:\n\t" \ | 205 | "1:\n\t" \ |
207 | : "=&r" (last) \ | 206 | : "=&r" (last) \ |
208 | : "0" (next->thread_info), \ | 207 | : "0" (next->thread_info), \ |
209 | "i" (TI_WSTATE), "i" (TI_KSP), "i" (TI_FLAGS), "i" (TI_CWP), \ | 208 | "i" (TI_WSTATE), "i" (TI_KSP), "i" (TI_NEW_CHILD), \ |
210 | "i" (_TIF_NEWCHILD), "i" (TI_TASK) \ | 209 | "i" (TI_CWP), "i" (TI_TASK) \ |
211 | : "cc", \ | 210 | : "cc", \ |
212 | "g1", "g2", "g3", "g7", \ | 211 | "g1", "g2", "g3", "g7", \ |
213 | "l2", "l3", "l4", "l5", "l6", "l7", \ | 212 | "l2", "l3", "l4", "l5", "l6", "l7", \ |
diff --git a/include/asm-sparc64/thread_info.h b/include/asm-sparc64/thread_info.h index a1d25c06f92a..352d9943661a 100644 --- a/include/asm-sparc64/thread_info.h +++ b/include/asm-sparc64/thread_info.h | |||
@@ -47,7 +47,9 @@ struct thread_info { | |||
47 | struct pt_regs *kregs; | 47 | struct pt_regs *kregs; |
48 | struct exec_domain *exec_domain; | 48 | struct exec_domain *exec_domain; |
49 | int preempt_count; /* 0 => preemptable, <0 => BUG */ | 49 | int preempt_count; /* 0 => preemptable, <0 => BUG */ |
50 | int __pad; | 50 | __u8 new_child; |
51 | __u8 syscall_noerror; | ||
52 | __u16 __pad; | ||
51 | 53 | ||
52 | unsigned long *utraps; | 54 | unsigned long *utraps; |
53 | 55 | ||
@@ -87,6 +89,8 @@ struct thread_info { | |||
87 | #define TI_KREGS 0x00000028 | 89 | #define TI_KREGS 0x00000028 |
88 | #define TI_EXEC_DOMAIN 0x00000030 | 90 | #define TI_EXEC_DOMAIN 0x00000030 |
89 | #define TI_PRE_COUNT 0x00000038 | 91 | #define TI_PRE_COUNT 0x00000038 |
92 | #define TI_NEW_CHILD 0x0000003c | ||
93 | #define TI_SYS_NOERROR 0x0000003d | ||
90 | #define TI_UTRAPS 0x00000040 | 94 | #define TI_UTRAPS 0x00000040 |
91 | #define TI_REG_WINDOW 0x00000048 | 95 | #define TI_REG_WINDOW 0x00000048 |
92 | #define TI_RWIN_SPTRS 0x000003c8 | 96 | #define TI_RWIN_SPTRS 0x000003c8 |
@@ -219,10 +223,10 @@ register struct thread_info *current_thread_info_reg asm("g6"); | |||
219 | #define TIF_UNALIGNED 5 /* allowed to do unaligned accesses */ | 223 | #define TIF_UNALIGNED 5 /* allowed to do unaligned accesses */ |
220 | #define TIF_NEWSIGNALS 6 /* wants new-style signals */ | 224 | #define TIF_NEWSIGNALS 6 /* wants new-style signals */ |
221 | #define TIF_32BIT 7 /* 32-bit binary */ | 225 | #define TIF_32BIT 7 /* 32-bit binary */ |
222 | #define TIF_NEWCHILD 8 /* just-spawned child process */ | 226 | /* flag bit 8 is available */ |
223 | #define TIF_SECCOMP 9 /* secure computing */ | 227 | #define TIF_SECCOMP 9 /* secure computing */ |
224 | #define TIF_SYSCALL_AUDIT 10 /* syscall auditing active */ | 228 | #define TIF_SYSCALL_AUDIT 10 /* syscall auditing active */ |
225 | #define TIF_SYSCALL_SUCCESS 11 | 229 | /* flag bit 11 is available */ |
226 | /* NOTE: Thread flags >= 12 should be ones we have no interest | 230 | /* NOTE: Thread flags >= 12 should be ones we have no interest |
227 | * in using in assembly, else we can't use the mask as | 231 | * in using in assembly, else we can't use the mask as |
228 | * an immediate value in instructions such as andcc. | 232 | * an immediate value in instructions such as andcc. |
@@ -239,10 +243,8 @@ register struct thread_info *current_thread_info_reg asm("g6"); | |||
239 | #define _TIF_UNALIGNED (1<<TIF_UNALIGNED) | 243 | #define _TIF_UNALIGNED (1<<TIF_UNALIGNED) |
240 | #define _TIF_NEWSIGNALS (1<<TIF_NEWSIGNALS) | 244 | #define _TIF_NEWSIGNALS (1<<TIF_NEWSIGNALS) |
241 | #define _TIF_32BIT (1<<TIF_32BIT) | 245 | #define _TIF_32BIT (1<<TIF_32BIT) |
242 | #define _TIF_NEWCHILD (1<<TIF_NEWCHILD) | ||
243 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) | 246 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) |
244 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) | 247 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) |
245 | #define _TIF_SYSCALL_SUCCESS (1<<TIF_SYSCALL_SUCCESS) | ||
246 | #define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) | 248 | #define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) |
247 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) | 249 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) |
248 | 250 | ||
diff --git a/include/asm-sparc64/timer.h b/include/asm-sparc64/timer.h index ba33a2b6b7bd..edc8e08c3a39 100644 --- a/include/asm-sparc64/timer.h +++ b/include/asm-sparc64/timer.h | |||
@@ -9,49 +9,8 @@ | |||
9 | 9 | ||
10 | #include <linux/types.h> | 10 | #include <linux/types.h> |
11 | 11 | ||
12 | /* How timers work: | ||
13 | * | ||
14 | * On uniprocessors we just use counter zero for the system wide | ||
15 | * ticker, this performs thread scheduling, clock book keeping, | ||
16 | * and runs timer based events. Previously we used the Ultra | ||
17 | * %tick interrupt for this purpose. | ||
18 | * | ||
19 | * On multiprocessors we pick one cpu as the master level 10 tick | ||
20 | * processor. Here this counter zero tick handles clock book | ||
21 | * keeping and timer events only. Each Ultra has it's level | ||
22 | * 14 %tick interrupt set to fire off as well, even the master | ||
23 | * tick cpu runs this locally. This ticker performs thread | ||
24 | * scheduling, system/user tick counting for the current thread, | ||
25 | * and also profiling if enabled. | ||
26 | */ | ||
27 | |||
28 | #include <linux/config.h> | 12 | #include <linux/config.h> |
29 | 13 | ||
30 | /* Two timers, traditionally steered to PIL's 10 and 14 respectively. | ||
31 | * But since INO packets are used on sun5, we could use any PIL level | ||
32 | * we like, however for now we use the normal ones. | ||
33 | * | ||
34 | * The 'reg' and 'interrupts' properties for these live in nodes named | ||
35 | * 'counter-timer'. The first of three 'reg' properties describe where | ||
36 | * the sun5_timer registers are. The other two I have no idea. (XXX) | ||
37 | */ | ||
38 | struct sun5_timer { | ||
39 | u64 count0; | ||
40 | u64 limit0; | ||
41 | u64 count1; | ||
42 | u64 limit1; | ||
43 | }; | ||
44 | |||
45 | #define SUN5_LIMIT_ENABLE 0x80000000 | ||
46 | #define SUN5_LIMIT_TOZERO 0x40000000 | ||
47 | #define SUN5_LIMIT_ZRESTART 0x20000000 | ||
48 | #define SUN5_LIMIT_CMASK 0x1fffffff | ||
49 | |||
50 | /* Given a HZ value, set the limit register to so that the timer IRQ | ||
51 | * gets delivered that often. | ||
52 | */ | ||
53 | #define SUN5_HZ_TO_LIMIT(__hz) (1000000/(__hz)) | ||
54 | |||
55 | struct sparc64_tick_ops { | 14 | struct sparc64_tick_ops { |
56 | void (*init_tick)(unsigned long); | 15 | void (*init_tick)(unsigned long); |
57 | unsigned long (*get_tick)(void); | 16 | unsigned long (*get_tick)(void); |
diff --git a/include/asm-um/emergency-restart.h b/include/asm-um/emergency-restart.h new file mode 100644 index 000000000000..108d8c48e42e --- /dev/null +++ b/include/asm-um/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-v850/emergency-restart.h b/include/asm-v850/emergency-restart.h new file mode 100644 index 000000000000..108d8c48e42e --- /dev/null +++ b/include/asm-v850/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-x86_64/emergency-restart.h b/include/asm-x86_64/emergency-restart.h new file mode 100644 index 000000000000..680c39563345 --- /dev/null +++ b/include/asm-x86_64/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | extern void machine_emergency_restart(void); | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-x86_64/ia32_unistd.h b/include/asm-x86_64/ia32_unistd.h index f3b7111cf33d..d5166ec3868d 100644 --- a/include/asm-x86_64/ia32_unistd.h +++ b/include/asm-x86_64/ia32_unistd.h | |||
@@ -294,7 +294,12 @@ | |||
294 | #define __NR_ia32_add_key 286 | 294 | #define __NR_ia32_add_key 286 |
295 | #define __NR_ia32_request_key 287 | 295 | #define __NR_ia32_request_key 287 |
296 | #define __NR_ia32_keyctl 288 | 296 | #define __NR_ia32_keyctl 288 |
297 | #define __NR_ia32_ioprio_set 289 | ||
298 | #define __NR_ia32_ioprio_get 290 | ||
299 | #define __NR_ia32_inotify_init 291 | ||
300 | #define __NR_ia32_inotify_add_watch 292 | ||
301 | #define __NR_ia32_inotify_rm_watch 293 | ||
297 | 302 | ||
298 | #define IA32_NR_syscalls 290 /* must be > than biggest syscall! */ | 303 | #define IA32_NR_syscalls 294 /* must be > than biggest syscall! */ |
299 | 304 | ||
300 | #endif /* _ASM_X86_64_IA32_UNISTD_H_ */ | 305 | #endif /* _ASM_X86_64_IA32_UNISTD_H_ */ |
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h index 6560439a83e4..11ba931cf82f 100644 --- a/include/asm-x86_64/unistd.h +++ b/include/asm-x86_64/unistd.h | |||
@@ -565,8 +565,14 @@ __SYSCALL(__NR_keyctl, sys_keyctl) | |||
565 | __SYSCALL(__NR_ioprio_set, sys_ioprio_set) | 565 | __SYSCALL(__NR_ioprio_set, sys_ioprio_set) |
566 | #define __NR_ioprio_get 252 | 566 | #define __NR_ioprio_get 252 |
567 | __SYSCALL(__NR_ioprio_get, sys_ioprio_get) | 567 | __SYSCALL(__NR_ioprio_get, sys_ioprio_get) |
568 | 568 | #define __NR_inotify_init 253 | |
569 | #define __NR_syscall_max __NR_ioprio_get | 569 | __SYSCALL(__NR_inotify_init, sys_inotify_init) |
570 | #define __NR_inotify_add_watch 254 | ||
571 | __SYSCALL(__NR_inotify_add_watch, sys_inotify_add_watch) | ||
572 | #define __NR_inotify_rm_watch 255 | ||
573 | __SYSCALL(__NR_inotify_rm_watch, sys_inotify_rm_watch) | ||
574 | |||
575 | #define __NR_syscall_max __NR_inotify_rm_watch | ||
570 | #ifndef __NO_STUBS | 576 | #ifndef __NO_STUBS |
571 | 577 | ||
572 | /* user-visible error numbers are in the range -1 - -4095 */ | 578 | /* user-visible error numbers are in the range -1 - -4095 */ |
diff --git a/include/asm-xtensa/emergency-restart.h b/include/asm-xtensa/emergency-restart.h new file mode 100644 index 000000000000..108d8c48e42e --- /dev/null +++ b/include/asm-xtensa/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h index 3781192ce159..08fe5f7d14a0 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack.h +++ b/include/linux/netfilter_ipv4/ip_conntrack.h | |||
@@ -197,6 +197,9 @@ struct ip_conntrack_expect | |||
197 | /* Timer function; deletes the expectation. */ | 197 | /* Timer function; deletes the expectation. */ |
198 | struct timer_list timeout; | 198 | struct timer_list timeout; |
199 | 199 | ||
200 | /* Usage count. */ | ||
201 | atomic_t use; | ||
202 | |||
200 | #ifdef CONFIG_IP_NF_NAT_NEEDED | 203 | #ifdef CONFIG_IP_NF_NAT_NEEDED |
201 | /* This is the original per-proto part, used to map the | 204 | /* This is the original per-proto part, used to map the |
202 | * expected connection the way the recipient expects. */ | 205 | * expected connection the way the recipient expects. */ |
@@ -236,7 +239,7 @@ ip_conntrack_get(const struct sk_buff *skb, enum ip_conntrack_info *ctinfo) | |||
236 | } | 239 | } |
237 | 240 | ||
238 | /* decrement reference count on a conntrack */ | 241 | /* decrement reference count on a conntrack */ |
239 | extern inline void ip_conntrack_put(struct ip_conntrack *ct); | 242 | extern void ip_conntrack_put(struct ip_conntrack *ct); |
240 | 243 | ||
241 | /* call to create an explicit dependency on ip_conntrack. */ | 244 | /* call to create an explicit dependency on ip_conntrack. */ |
242 | extern void need_ip_conntrack(void); | 245 | extern void need_ip_conntrack(void); |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper.h b/include/linux/netfilter_ipv4/ip_conntrack_helper.h index b1bbba0a12cb..3692daa93dec 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_helper.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_helper.h | |||
@@ -30,9 +30,10 @@ extern int ip_conntrack_helper_register(struct ip_conntrack_helper *); | |||
30 | extern void ip_conntrack_helper_unregister(struct ip_conntrack_helper *); | 30 | extern void ip_conntrack_helper_unregister(struct ip_conntrack_helper *); |
31 | 31 | ||
32 | /* Allocate space for an expectation: this is mandatory before calling | 32 | /* Allocate space for an expectation: this is mandatory before calling |
33 | ip_conntrack_expect_related. */ | 33 | ip_conntrack_expect_related. You will have to call put afterwards. */ |
34 | extern struct ip_conntrack_expect *ip_conntrack_expect_alloc(void); | 34 | extern struct ip_conntrack_expect * |
35 | extern void ip_conntrack_expect_free(struct ip_conntrack_expect *exp); | 35 | ip_conntrack_expect_alloc(struct ip_conntrack *master); |
36 | extern void ip_conntrack_expect_put(struct ip_conntrack_expect *exp); | ||
36 | 37 | ||
37 | /* Add an expected connection: can have more than one per connection */ | 38 | /* Add an expected connection: can have more than one per connection */ |
38 | extern int ip_conntrack_expect_related(struct ip_conntrack_expect *exp); | 39 | extern int ip_conntrack_expect_related(struct ip_conntrack_expect *exp); |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 2f0c085f2c7d..70c2a9dc4b2b 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -5,7 +5,7 @@ | |||
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | 6 | ||
7 | #define NETLINK_ROUTE 0 /* Routing/device hook */ | 7 | #define NETLINK_ROUTE 0 /* Routing/device hook */ |
8 | #define NETLINK_SKIP 1 /* Reserved for ENskip */ | 8 | #define NETLINK_W1 1 /* 1-wire subsystem */ |
9 | #define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */ | 9 | #define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */ |
10 | #define NETLINK_FIREWALL 3 /* Firewalling hook */ | 10 | #define NETLINK_FIREWALL 3 /* Firewalling hook */ |
11 | #define NETLINK_TCPDIAG 4 /* TCP socket monitoring */ | 11 | #define NETLINK_TCPDIAG 4 /* TCP socket monitoring */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 27348c22dacb..d2ad2c4f835a 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -911,6 +911,15 @@ | |||
911 | #define PCI_DEVICE_ID_QLOGIC_ISP1022 0x1022 | 911 | #define PCI_DEVICE_ID_QLOGIC_ISP1022 0x1022 |
912 | #define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100 | 912 | #define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100 |
913 | #define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200 | 913 | #define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200 |
914 | #define PCI_DEVICE_ID_QLOGIC_ISP2300 0x2300 | ||
915 | #define PCI_DEVICE_ID_QLOGIC_ISP2312 0x2312 | ||
916 | #define PCI_DEVICE_ID_QLOGIC_ISP2322 0x2322 | ||
917 | #define PCI_DEVICE_ID_QLOGIC_ISP6312 0x6312 | ||
918 | #define PCI_DEVICE_ID_QLOGIC_ISP6322 0x6322 | ||
919 | #define PCI_DEVICE_ID_QLOGIC_ISP2422 0x2422 | ||
920 | #define PCI_DEVICE_ID_QLOGIC_ISP2432 0x2432 | ||
921 | #define PCI_DEVICE_ID_QLOGIC_ISP2512 0x2512 | ||
922 | #define PCI_DEVICE_ID_QLOGIC_ISP2522 0x2522 | ||
914 | 923 | ||
915 | #define PCI_VENDOR_ID_CYRIX 0x1078 | 924 | #define PCI_VENDOR_ID_CYRIX 0x1078 |
916 | #define PCI_DEVICE_ID_CYRIX_5510 0x0000 | 925 | #define PCI_DEVICE_ID_CYRIX_5510 0x0000 |
@@ -1872,6 +1881,7 @@ | |||
1872 | #define PCI_DEVICE_ID_CBOARDS_DAS1602_16 0x0001 | 1881 | #define PCI_DEVICE_ID_CBOARDS_DAS1602_16 0x0001 |
1873 | 1882 | ||
1874 | #define PCI_VENDOR_ID_SIIG 0x131f | 1883 | #define PCI_VENDOR_ID_SIIG 0x131f |
1884 | #define PCI_SUBVENDOR_ID_SIIG 0x131f | ||
1875 | #define PCI_DEVICE_ID_SIIG_1S_10x_550 0x1000 | 1885 | #define PCI_DEVICE_ID_SIIG_1S_10x_550 0x1000 |
1876 | #define PCI_DEVICE_ID_SIIG_1S_10x_650 0x1001 | 1886 | #define PCI_DEVICE_ID_SIIG_1S_10x_650 0x1001 |
1877 | #define PCI_DEVICE_ID_SIIG_1S_10x_850 0x1002 | 1887 | #define PCI_DEVICE_ID_SIIG_1S_10x_850 0x1002 |
@@ -1909,6 +1919,7 @@ | |||
1909 | #define PCI_DEVICE_ID_SIIG_2S1P_20x_550 0x2060 | 1919 | #define PCI_DEVICE_ID_SIIG_2S1P_20x_550 0x2060 |
1910 | #define PCI_DEVICE_ID_SIIG_2S1P_20x_650 0x2061 | 1920 | #define PCI_DEVICE_ID_SIIG_2S1P_20x_650 0x2061 |
1911 | #define PCI_DEVICE_ID_SIIG_2S1P_20x_850 0x2062 | 1921 | #define PCI_DEVICE_ID_SIIG_2S1P_20x_850 0x2062 |
1922 | #define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050 | ||
1912 | 1923 | ||
1913 | #define PCI_VENDOR_ID_RADISYS 0x1331 | 1924 | #define PCI_VENDOR_ID_RADISYS 0x1331 |
1914 | #define PCI_DEVICE_ID_RADISYS_ENP2611 0x0030 | 1925 | #define PCI_DEVICE_ID_RADISYS_ENP2611 0x0030 |
@@ -2096,6 +2107,8 @@ | |||
2096 | #define PCI_DEVICE_ID_TIGON3_5721 0x1659 | 2107 | #define PCI_DEVICE_ID_TIGON3_5721 0x1659 |
2097 | #define PCI_DEVICE_ID_TIGON3_5705M 0x165d | 2108 | #define PCI_DEVICE_ID_TIGON3_5705M 0x165d |
2098 | #define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e | 2109 | #define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e |
2110 | #define PCI_DEVICE_ID_TIGON3_5780 0x166a | ||
2111 | #define PCI_DEVICE_ID_TIGON3_5780S 0x166b | ||
2099 | #define PCI_DEVICE_ID_TIGON3_5705F 0x166e | 2112 | #define PCI_DEVICE_ID_TIGON3_5705F 0x166e |
2100 | #define PCI_DEVICE_ID_TIGON3_5750 0x1676 | 2113 | #define PCI_DEVICE_ID_TIGON3_5750 0x1676 |
2101 | #define PCI_DEVICE_ID_TIGON3_5751 0x1677 | 2114 | #define PCI_DEVICE_ID_TIGON3_5751 0x1677 |
diff --git a/include/linux/reboot.h b/include/linux/reboot.h index 2d4dd23168dd..3b3266ff1a95 100644 --- a/include/linux/reboot.h +++ b/include/linux/reboot.h | |||
@@ -55,6 +55,22 @@ extern void machine_shutdown(void); | |||
55 | struct pt_regs; | 55 | struct pt_regs; |
56 | extern void machine_crash_shutdown(struct pt_regs *); | 56 | extern void machine_crash_shutdown(struct pt_regs *); |
57 | 57 | ||
58 | /* | ||
59 | * Architecture independent implemenations of sys_reboot commands. | ||
60 | */ | ||
61 | |||
62 | extern void kernel_restart(char *cmd); | ||
63 | extern void kernel_halt(void); | ||
64 | extern void kernel_power_off(void); | ||
65 | extern void kernel_kexec(void); | ||
66 | |||
67 | /* | ||
68 | * Emergency restart, callable from an interrupt handler. | ||
69 | */ | ||
70 | |||
71 | extern void emergency_restart(void); | ||
72 | #include <asm/emergency-restart.h> | ||
73 | |||
58 | #endif | 74 | #endif |
59 | 75 | ||
60 | #endif /* _LINUX_REBOOT_H */ | 76 | #endif /* _LINUX_REBOOT_H */ |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 5d4a990d5577..0061c9470482 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -502,7 +502,8 @@ static inline struct sk_buff *skb_share_check(struct sk_buff *skb, | |||
502 | * | 502 | * |
503 | * %NULL is returned on a memory allocation failure. | 503 | * %NULL is returned on a memory allocation failure. |
504 | */ | 504 | */ |
505 | static inline struct sk_buff *skb_unshare(struct sk_buff *skb, int pri) | 505 | static inline struct sk_buff *skb_unshare(struct sk_buff *skb, |
506 | unsigned int __nocast pri) | ||
506 | { | 507 | { |
507 | might_sleep_if(pri & __GFP_WAIT); | 508 | might_sleep_if(pri & __GFP_WAIT); |
508 | if (skb_cloned(skb)) { | 509 | if (skb_cloned(skb)) { |
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/linux/tc_ematch/tc_em_meta.h index bcb762d93123..081b1ee8516e 100644 --- a/include/linux/tc_ematch/tc_em_meta.h +++ b/include/linux/tc_ematch/tc_em_meta.h | |||
@@ -41,19 +41,14 @@ enum | |||
41 | TCF_META_ID_LOADAVG_1, | 41 | TCF_META_ID_LOADAVG_1, |
42 | TCF_META_ID_LOADAVG_2, | 42 | TCF_META_ID_LOADAVG_2, |
43 | TCF_META_ID_DEV, | 43 | TCF_META_ID_DEV, |
44 | TCF_META_ID_INDEV, | ||
45 | TCF_META_ID_REALDEV, | ||
46 | TCF_META_ID_PRIORITY, | 44 | TCF_META_ID_PRIORITY, |
47 | TCF_META_ID_PROTOCOL, | 45 | TCF_META_ID_PROTOCOL, |
48 | TCF_META_ID_SECURITY, /* obsolete */ | ||
49 | TCF_META_ID_PKTTYPE, | 46 | TCF_META_ID_PKTTYPE, |
50 | TCF_META_ID_PKTLEN, | 47 | TCF_META_ID_PKTLEN, |
51 | TCF_META_ID_DATALEN, | 48 | TCF_META_ID_DATALEN, |
52 | TCF_META_ID_MACLEN, | 49 | TCF_META_ID_MACLEN, |
53 | TCF_META_ID_NFMARK, | 50 | TCF_META_ID_NFMARK, |
54 | TCF_META_ID_TCINDEX, | 51 | TCF_META_ID_TCINDEX, |
55 | TCF_META_ID_TCVERDICT, | ||
56 | TCF_META_ID_TCCLASSID, | ||
57 | TCF_META_ID_RTCLASSID, | 52 | TCF_META_ID_RTCLASSID, |
58 | TCF_META_ID_RTIIF, | 53 | TCF_META_ID_RTIIF, |
59 | TCF_META_ID_SK_FAMILY, | 54 | TCF_META_ID_SK_FAMILY, |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 4a26adfaed71..e1d5ec1c23c0 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -167,15 +167,12 @@ void sctp_unhash_established(struct sctp_association *); | |||
167 | void sctp_hash_endpoint(struct sctp_endpoint *); | 167 | void sctp_hash_endpoint(struct sctp_endpoint *); |
168 | void sctp_unhash_endpoint(struct sctp_endpoint *); | 168 | void sctp_unhash_endpoint(struct sctp_endpoint *); |
169 | struct sock *sctp_err_lookup(int family, struct sk_buff *, | 169 | struct sock *sctp_err_lookup(int family, struct sk_buff *, |
170 | struct sctphdr *, struct sctp_endpoint **, | 170 | struct sctphdr *, struct sctp_association **, |
171 | struct sctp_association **, | ||
172 | struct sctp_transport **); | 171 | struct sctp_transport **); |
173 | void sctp_err_finish(struct sock *, struct sctp_endpoint *, | 172 | void sctp_err_finish(struct sock *, struct sctp_association *); |
174 | struct sctp_association *); | ||
175 | void sctp_icmp_frag_needed(struct sock *, struct sctp_association *, | 173 | void sctp_icmp_frag_needed(struct sock *, struct sctp_association *, |
176 | struct sctp_transport *t, __u32 pmtu); | 174 | struct sctp_transport *t, __u32 pmtu); |
177 | void sctp_icmp_proto_unreachable(struct sock *sk, | 175 | void sctp_icmp_proto_unreachable(struct sock *sk, |
178 | struct sctp_endpoint *ep, | ||
179 | struct sctp_association *asoc, | 176 | struct sctp_association *asoc, |
180 | struct sctp_transport *t); | 177 | struct sctp_transport *t); |
181 | 178 | ||
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 029522a4ceda..868ef88ef971 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -803,7 +803,7 @@ struct xfrm_algo_desc { | |||
803 | /* XFRM tunnel handlers. */ | 803 | /* XFRM tunnel handlers. */ |
804 | struct xfrm_tunnel { | 804 | struct xfrm_tunnel { |
805 | int (*handler)(struct sk_buff *skb); | 805 | int (*handler)(struct sk_buff *skb); |
806 | void (*err_handler)(struct sk_buff *skb, void *info); | 806 | void (*err_handler)(struct sk_buff *skb, __u32 info); |
807 | }; | 807 | }; |
808 | 808 | ||
809 | struct xfrm6_tunnel { | 809 | struct xfrm6_tunnel { |
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 1fb233741513..b361172b576c 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
@@ -28,7 +28,7 @@ extern const unsigned char scsi_command_size[8]; | |||
28 | * SCSI device types | 28 | * SCSI device types |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #define MAX_SCSI_DEVICE_CODE 14 | 31 | #define MAX_SCSI_DEVICE_CODE 15 |
32 | extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE]; | 32 | extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE]; |
33 | 33 | ||
34 | /* | 34 | /* |
@@ -211,8 +211,8 @@ static inline int scsi_status_is_good(int status) | |||
211 | * - treated as TYPE_DISK */ | 211 | * - treated as TYPE_DISK */ |
212 | #define TYPE_MEDIUM_CHANGER 0x08 | 212 | #define TYPE_MEDIUM_CHANGER 0x08 |
213 | #define TYPE_COMM 0x09 /* Communications device */ | 213 | #define TYPE_COMM 0x09 /* Communications device */ |
214 | #define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */ | ||
215 | #define TYPE_RAID 0x0c | 214 | #define TYPE_RAID 0x0c |
215 | #define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */ | ||
216 | #define TYPE_RBC 0x0e | 216 | #define TYPE_RBC 0x0e |
217 | #define TYPE_NO_LUN 0x7f | 217 | #define TYPE_NO_LUN 0x7f |
218 | 218 | ||
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 07f5c699eaa7..9957f16dcc5d 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h | |||
@@ -31,14 +31,11 @@ struct scsi_cmnd { | |||
31 | int sc_magic; | 31 | int sc_magic; |
32 | 32 | ||
33 | struct scsi_device *device; | 33 | struct scsi_device *device; |
34 | unsigned short state; | ||
35 | unsigned short owner; | ||
36 | struct scsi_request *sc_request; | 34 | struct scsi_request *sc_request; |
37 | 35 | ||
38 | struct list_head list; /* scsi_cmnd participates in queue lists */ | 36 | struct list_head list; /* scsi_cmnd participates in queue lists */ |
39 | 37 | ||
40 | struct list_head eh_entry; /* entry for the host eh_cmd_q */ | 38 | struct list_head eh_entry; /* entry for the host eh_cmd_q */ |
41 | int eh_state; /* Used for state tracking in error handlr */ | ||
42 | int eh_eflags; /* Used by error handlr */ | 39 | int eh_eflags; /* Used by error handlr */ |
43 | void (*done) (struct scsi_cmnd *); /* Mid-level done function */ | 40 | void (*done) (struct scsi_cmnd *); /* Mid-level done function */ |
44 | 41 | ||
@@ -80,8 +77,6 @@ struct scsi_cmnd { | |||
80 | * sense info */ | 77 | * sense info */ |
81 | unsigned short use_sg; /* Number of pieces of scatter-gather */ | 78 | unsigned short use_sg; /* Number of pieces of scatter-gather */ |
82 | unsigned short sglist_len; /* size of malloc'd scatter-gather list */ | 79 | unsigned short sglist_len; /* size of malloc'd scatter-gather list */ |
83 | unsigned short abort_reason; /* If the mid-level code requests an | ||
84 | * abort, this is the reason. */ | ||
85 | unsigned bufflen; /* Size of data buffer */ | 80 | unsigned bufflen; /* Size of data buffer */ |
86 | void *buffer; /* Data buffer */ | 81 | void *buffer; /* Data buffer */ |
87 | 82 | ||
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 63c91dd85ca1..835af8ecbb7c 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -9,7 +9,7 @@ | |||
9 | struct request_queue; | 9 | struct request_queue; |
10 | struct scsi_cmnd; | 10 | struct scsi_cmnd; |
11 | struct scsi_mode_data; | 11 | struct scsi_mode_data; |
12 | 12 | struct scsi_lun; | |
13 | 13 | ||
14 | /* | 14 | /* |
15 | * sdev state: If you alter this, you also need to alter scsi_sysfs.c | 15 | * sdev state: If you alter this, you also need to alter scsi_sysfs.c |
@@ -243,6 +243,7 @@ extern void scsi_target_reap(struct scsi_target *); | |||
243 | extern void scsi_target_block(struct device *); | 243 | extern void scsi_target_block(struct device *); |
244 | extern void scsi_target_unblock(struct device *); | 244 | extern void scsi_target_unblock(struct device *); |
245 | extern void scsi_remove_target(struct device *); | 245 | extern void scsi_remove_target(struct device *); |
246 | extern void int_to_scsilun(unsigned int, struct scsi_lun *); | ||
246 | extern const char *scsi_device_state_name(enum scsi_device_state); | 247 | extern const char *scsi_device_state_name(enum scsi_device_state); |
247 | extern int scsi_is_sdev_device(const struct device *); | 248 | extern int scsi_is_sdev_device(const struct device *); |
248 | extern int scsi_is_target_device(const struct device *); | 249 | extern int scsi_is_target_device(const struct device *); |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index db9914adeac9..81d5234f6771 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -641,12 +641,6 @@ static inline void scsi_assign_lock(struct Scsi_Host *shost, spinlock_t *lock) | |||
641 | shost->host_lock = lock; | 641 | shost->host_lock = lock; |
642 | } | 642 | } |
643 | 643 | ||
644 | static inline void scsi_set_device(struct Scsi_Host *shost, | ||
645 | struct device *dev) | ||
646 | { | ||
647 | shost->shost_gendev.parent = dev; | ||
648 | } | ||
649 | |||
650 | static inline struct device *scsi_get_device(struct Scsi_Host *shost) | 644 | static inline struct device *scsi_get_device(struct Scsi_Host *shost) |
651 | { | 645 | { |
652 | return shost->shost_gendev.parent; | 646 | return shost->shost_gendev.parent; |