diff options
Diffstat (limited to 'include')
40 files changed, 486 insertions, 52 deletions
diff --git a/include/asm-alpha/barrier.h b/include/asm-alpha/barrier.h index 681ff581afa5..384dc08d6f53 100644 --- a/include/asm-alpha/barrier.h +++ b/include/asm-alpha/barrier.h | |||
@@ -30,7 +30,4 @@ __asm__ __volatile__("mb": : :"memory") | |||
30 | #define set_mb(var, value) \ | 30 | #define set_mb(var, value) \ |
31 | do { var = value; mb(); } while (0) | 31 | do { var = value; mb(); } while (0) |
32 | 32 | ||
33 | #define set_wmb(var, value) \ | ||
34 | do { var = value; wmb(); } while (0) | ||
35 | |||
36 | #endif /* __BARRIER_H */ | 33 | #endif /* __BARRIER_H */ |
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h index 6001febfe63b..0947cbf9b69a 100644 --- a/include/asm-arm/system.h +++ b/include/asm-arm/system.h | |||
@@ -176,7 +176,6 @@ extern unsigned int user_debug; | |||
176 | #define wmb() mb() | 176 | #define wmb() mb() |
177 | #define read_barrier_depends() do { } while(0) | 177 | #define read_barrier_depends() do { } while(0) |
178 | #define set_mb(var, value) do { var = value; mb(); } while (0) | 178 | #define set_mb(var, value) do { var = value; mb(); } while (0) |
179 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | ||
180 | #define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t"); | 179 | #define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t"); |
181 | 180 | ||
182 | /* | 181 | /* |
diff --git a/include/asm-arm26/system.h b/include/asm-arm26/system.h index d1f69d706198..00ae32aa1dba 100644 --- a/include/asm-arm26/system.h +++ b/include/asm-arm26/system.h | |||
@@ -90,7 +90,6 @@ extern unsigned int user_debug; | |||
90 | 90 | ||
91 | #define read_barrier_depends() do { } while(0) | 91 | #define read_barrier_depends() do { } while(0) |
92 | #define set_mb(var, value) do { var = value; mb(); } while (0) | 92 | #define set_mb(var, value) do { var = value; mb(); } while (0) |
93 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | ||
94 | 93 | ||
95 | /* | 94 | /* |
96 | * We assume knowledge of how | 95 | * We assume knowledge of how |
diff --git a/include/asm-cris/system.h b/include/asm-cris/system.h index b1c593b6dbff..b869f6161aaa 100644 --- a/include/asm-cris/system.h +++ b/include/asm-cris/system.h | |||
@@ -17,7 +17,6 @@ extern struct task_struct *resume(struct task_struct *prev, struct task_struct * | |||
17 | #define wmb() mb() | 17 | #define wmb() mb() |
18 | #define read_barrier_depends() do { } while(0) | 18 | #define read_barrier_depends() do { } while(0) |
19 | #define set_mb(var, value) do { var = value; mb(); } while (0) | 19 | #define set_mb(var, value) do { var = value; mb(); } while (0) |
20 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | ||
21 | 20 | ||
22 | #ifdef CONFIG_SMP | 21 | #ifdef CONFIG_SMP |
23 | #define smp_mb() mb() | 22 | #define smp_mb() mb() |
diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h index 351863dfd06e..1166899317d7 100644 --- a/include/asm-frv/system.h +++ b/include/asm-frv/system.h | |||
@@ -179,7 +179,6 @@ do { \ | |||
179 | #define rmb() asm volatile ("membar" : : :"memory") | 179 | #define rmb() asm volatile ("membar" : : :"memory") |
180 | #define wmb() asm volatile ("membar" : : :"memory") | 180 | #define wmb() asm volatile ("membar" : : :"memory") |
181 | #define set_mb(var, value) do { var = value; mb(); } while (0) | 181 | #define set_mb(var, value) do { var = value; mb(); } while (0) |
182 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | ||
183 | 182 | ||
184 | #define smp_mb() mb() | 183 | #define smp_mb() mb() |
185 | #define smp_rmb() rmb() | 184 | #define smp_rmb() rmb() |
diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm index d8d0bcecd23f..6b16dda18115 100644 --- a/include/asm-generic/Kbuild.asm +++ b/include/asm-generic/Kbuild.asm | |||
@@ -1,11 +1,8 @@ | |||
1 | unifdef-y += a.out.h auxvec.h byteorder.h errno.h fcntl.h ioctl.h \ | 1 | unifdef-y += a.out.h auxvec.h byteorder.h errno.h fcntl.h ioctl.h \ |
2 | ioctls.h ipcbuf.h irq.h mman.h msgbuf.h param.h poll.h \ | 2 | ioctls.h ipcbuf.h mman.h msgbuf.h param.h poll.h \ |
3 | posix_types.h ptrace.h resource.h sembuf.h shmbuf.h shmparam.h \ | 3 | posix_types.h ptrace.h resource.h sembuf.h shmbuf.h shmparam.h \ |
4 | sigcontext.h siginfo.h signal.h socket.h sockios.h stat.h \ | 4 | sigcontext.h siginfo.h signal.h socket.h sockios.h stat.h \ |
5 | statfs.h termbits.h termios.h timex.h types.h unistd.h user.h | 5 | statfs.h termbits.h termios.h timex.h types.h unistd.h user.h |
6 | 6 | ||
7 | # These really shouldn't be exported | ||
8 | unifdef-y += atomic.h io.h | ||
9 | |||
10 | # These probably shouldn't be exported | 7 | # These probably shouldn't be exported |
11 | unifdef-y += elf.h page.h | 8 | unifdef-y += elf.h page.h |
diff --git a/include/asm-h8300/system.h b/include/asm-h8300/system.h index 134e0929fce5..5084a9d42922 100644 --- a/include/asm-h8300/system.h +++ b/include/asm-h8300/system.h | |||
@@ -84,7 +84,6 @@ asmlinkage void resume(void); | |||
84 | #define wmb() asm volatile ("" : : :"memory") | 84 | #define wmb() asm volatile ("" : : :"memory") |
85 | #define set_rmb(var, value) do { xchg(&var, value); } while (0) | 85 | #define set_rmb(var, value) do { xchg(&var, value); } while (0) |
86 | #define set_mb(var, value) set_rmb(var, value) | 86 | #define set_mb(var, value) set_rmb(var, value) |
87 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | ||
88 | 87 | ||
89 | #ifdef CONFIG_SMP | 88 | #ifdef CONFIG_SMP |
90 | #define smp_mb() mb() | 89 | #define smp_mb() mb() |
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h index 2db168ef949f..49928eb33f8b 100644 --- a/include/asm-i386/system.h +++ b/include/asm-i386/system.h | |||
@@ -453,8 +453,6 @@ static inline unsigned long long __cmpxchg64(volatile void *ptr, unsigned long l | |||
453 | #define set_mb(var, value) do { var = value; barrier(); } while (0) | 453 | #define set_mb(var, value) do { var = value; barrier(); } while (0) |
454 | #endif | 454 | #endif |
455 | 455 | ||
456 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | ||
457 | |||
458 | #include <linux/irqflags.h> | 456 | #include <linux/irqflags.h> |
459 | 457 | ||
460 | /* | 458 | /* |
diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h index 65db43ce4de6..fc9677bc87ee 100644 --- a/include/asm-ia64/system.h +++ b/include/asm-ia64/system.h | |||
@@ -98,12 +98,11 @@ extern struct ia64_boot_param { | |||
98 | #endif | 98 | #endif |
99 | 99 | ||
100 | /* | 100 | /* |
101 | * XXX check on these---I suspect what Linus really wants here is | 101 | * XXX check on this ---I suspect what Linus really wants here is |
102 | * acquire vs release semantics but we can't discuss this stuff with | 102 | * acquire vs release semantics but we can't discuss this stuff with |
103 | * Linus just yet. Grrr... | 103 | * Linus just yet. Grrr... |
104 | */ | 104 | */ |
105 | #define set_mb(var, value) do { (var) = (value); mb(); } while (0) | 105 | #define set_mb(var, value) do { (var) = (value); mb(); } while (0) |
106 | #define set_wmb(var, value) do { (var) = (value); mb(); } while (0) | ||
107 | 106 | ||
108 | #define safe_halt() ia64_pal_halt_light() /* PAL_HALT_LIGHT */ | 107 | #define safe_halt() ia64_pal_halt_light() /* PAL_HALT_LIGHT */ |
109 | 108 | ||
diff --git a/include/asm-m32r/system.h b/include/asm-m32r/system.h index 311cebf44eff..9e618afec6ed 100644 --- a/include/asm-m32r/system.h +++ b/include/asm-m32r/system.h | |||
@@ -336,7 +336,6 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) | |||
336 | #endif | 336 | #endif |
337 | 337 | ||
338 | #define set_mb(var, value) do { xchg(&var, value); } while (0) | 338 | #define set_mb(var, value) do { xchg(&var, value); } while (0) |
339 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | ||
340 | 339 | ||
341 | #define arch_align_stack(x) (x) | 340 | #define arch_align_stack(x) (x) |
342 | 341 | ||
diff --git a/include/asm-m68k/system.h b/include/asm-m68k/system.h index d6dd8052cd6f..131a0cb0f491 100644 --- a/include/asm-m68k/system.h +++ b/include/asm-m68k/system.h | |||
@@ -80,7 +80,6 @@ static inline int irqs_disabled(void) | |||
80 | #define wmb() barrier() | 80 | #define wmb() barrier() |
81 | #define read_barrier_depends() do { } while(0) | 81 | #define read_barrier_depends() do { } while(0) |
82 | #define set_mb(var, value) do { xchg(&var, value); } while (0) | 82 | #define set_mb(var, value) do { xchg(&var, value); } while (0) |
83 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | ||
84 | 83 | ||
85 | #define smp_mb() barrier() | 84 | #define smp_mb() barrier() |
86 | #define smp_rmb() barrier() | 85 | #define smp_rmb() barrier() |
diff --git a/include/asm-m68knommu/system.h b/include/asm-m68knommu/system.h index 2bbe2db00a22..2a814498672d 100644 --- a/include/asm-m68knommu/system.h +++ b/include/asm-m68knommu/system.h | |||
@@ -106,7 +106,6 @@ asmlinkage void resume(void); | |||
106 | #define wmb() asm volatile ("" : : :"memory") | 106 | #define wmb() asm volatile ("" : : :"memory") |
107 | #define set_rmb(var, value) do { xchg(&var, value); } while (0) | 107 | #define set_rmb(var, value) do { xchg(&var, value); } while (0) |
108 | #define set_mb(var, value) set_rmb(var, value) | 108 | #define set_mb(var, value) set_rmb(var, value) |
109 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | ||
110 | 109 | ||
111 | #ifdef CONFIG_SMP | 110 | #ifdef CONFIG_SMP |
112 | #define smp_mb() mb() | 111 | #define smp_mb() mb() |
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h index 13c98dde82dc..dcb4701d5728 100644 --- a/include/asm-mips/system.h +++ b/include/asm-mips/system.h | |||
@@ -143,9 +143,6 @@ | |||
143 | #define set_mb(var, value) \ | 143 | #define set_mb(var, value) \ |
144 | do { var = value; mb(); } while (0) | 144 | do { var = value; mb(); } while (0) |
145 | 145 | ||
146 | #define set_wmb(var, value) \ | ||
147 | do { var = value; wmb(); } while (0) | ||
148 | |||
149 | /* | 146 | /* |
150 | * switch_to(n) should switch tasks to task nr n, first | 147 | * switch_to(n) should switch tasks to task nr n, first |
151 | * checking that n isn't the current task, in which case it does nothing. | 148 | * checking that n isn't the current task, in which case it does nothing. |
diff --git a/include/asm-parisc/system.h b/include/asm-parisc/system.h index 5fe2d2329ab5..74f037a39e6f 100644 --- a/include/asm-parisc/system.h +++ b/include/asm-parisc/system.h | |||
@@ -143,8 +143,6 @@ static inline void set_eiem(unsigned long val) | |||
143 | #define read_barrier_depends() do { } while(0) | 143 | #define read_barrier_depends() do { } while(0) |
144 | 144 | ||
145 | #define set_mb(var, value) do { var = value; mb(); } while (0) | 145 | #define set_mb(var, value) do { var = value; mb(); } while (0) |
146 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | ||
147 | |||
148 | 146 | ||
149 | #ifndef CONFIG_PA20 | 147 | #ifndef CONFIG_PA20 |
150 | /* Because kmalloc only guarantees 8-byte alignment for kmalloc'd data, | 148 | /* Because kmalloc only guarantees 8-byte alignment for kmalloc'd data, |
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h index c6569516ba35..7307aa775671 100644 --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h | |||
@@ -39,7 +39,6 @@ | |||
39 | #define read_barrier_depends() do { } while(0) | 39 | #define read_barrier_depends() do { } while(0) |
40 | 40 | ||
41 | #define set_mb(var, value) do { var = value; mb(); } while (0) | 41 | #define set_mb(var, value) do { var = value; mb(); } while (0) |
42 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | ||
43 | 42 | ||
44 | #ifdef __KERNEL__ | 43 | #ifdef __KERNEL__ |
45 | #ifdef CONFIG_SMP | 44 | #ifdef CONFIG_SMP |
diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h index fb49c0c49ea1..738943584c01 100644 --- a/include/asm-ppc/system.h +++ b/include/asm-ppc/system.h | |||
@@ -33,7 +33,6 @@ | |||
33 | #define read_barrier_depends() do { } while(0) | 33 | #define read_barrier_depends() do { } while(0) |
34 | 34 | ||
35 | #define set_mb(var, value) do { var = value; mb(); } while (0) | 35 | #define set_mb(var, value) do { var = value; mb(); } while (0) |
36 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | ||
37 | 36 | ||
38 | #ifdef CONFIG_SMP | 37 | #ifdef CONFIG_SMP |
39 | #define smp_mb() mb() | 38 | #define smp_mb() mb() |
diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h index 9ab186ffde23..36a3a85d611a 100644 --- a/include/asm-s390/system.h +++ b/include/asm-s390/system.h | |||
@@ -299,7 +299,6 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) | |||
299 | 299 | ||
300 | 300 | ||
301 | #define set_mb(var, value) do { var = value; mb(); } while (0) | 301 | #define set_mb(var, value) do { var = value; mb(); } while (0) |
302 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | ||
303 | 302 | ||
304 | #ifdef __s390x__ | 303 | #ifdef __s390x__ |
305 | 304 | ||
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h index ce2e60664a86..ad35ad4958f4 100644 --- a/include/asm-sh/system.h +++ b/include/asm-sh/system.h | |||
@@ -101,7 +101,6 @@ extern void __xchg_called_with_bad_pointer(void); | |||
101 | #endif | 101 | #endif |
102 | 102 | ||
103 | #define set_mb(var, value) do { xchg(&var, value); } while (0) | 103 | #define set_mb(var, value) do { xchg(&var, value); } while (0) |
104 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | ||
105 | 104 | ||
106 | /* Interrupt Control */ | 105 | /* Interrupt Control */ |
107 | static __inline__ void local_irq_enable(void) | 106 | static __inline__ void local_irq_enable(void) |
diff --git a/include/asm-sh64/system.h b/include/asm-sh64/system.h index 7606f6e1f01e..87ef6f1ad5a4 100644 --- a/include/asm-sh64/system.h +++ b/include/asm-sh64/system.h | |||
@@ -66,7 +66,6 @@ extern void __xchg_called_with_bad_pointer(void); | |||
66 | 66 | ||
67 | #define set_rmb(var, value) do { xchg(&var, value); } while (0) | 67 | #define set_rmb(var, value) do { xchg(&var, value); } while (0) |
68 | #define set_mb(var, value) set_rmb(var, value) | 68 | #define set_mb(var, value) set_rmb(var, value) |
69 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | ||
70 | 69 | ||
71 | /* Interrupt Control */ | 70 | /* Interrupt Control */ |
72 | #ifndef HARD_CLI | 71 | #ifndef HARD_CLI |
diff --git a/include/asm-sparc/system.h b/include/asm-sparc/system.h index cb7dda1e5e91..100c3eaf3c1f 100644 --- a/include/asm-sparc/system.h +++ b/include/asm-sparc/system.h | |||
@@ -199,7 +199,6 @@ static inline unsigned long getipl(void) | |||
199 | #define wmb() mb() | 199 | #define wmb() mb() |
200 | #define read_barrier_depends() do { } while(0) | 200 | #define read_barrier_depends() do { } while(0) |
201 | #define set_mb(__var, __value) do { __var = __value; mb(); } while(0) | 201 | #define set_mb(__var, __value) do { __var = __value; mb(); } while(0) |
202 | #define set_wmb(__var, __value) set_mb(__var, __value) | ||
203 | #define smp_mb() __asm__ __volatile__("":::"memory") | 202 | #define smp_mb() __asm__ __volatile__("":::"memory") |
204 | #define smp_rmb() __asm__ __volatile__("":::"memory") | 203 | #define smp_rmb() __asm__ __volatile__("":::"memory") |
205 | #define smp_wmb() __asm__ __volatile__("":::"memory") | 204 | #define smp_wmb() __asm__ __volatile__("":::"memory") |
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h index 4ca68600c670..a8b7432c9a70 100644 --- a/include/asm-sparc64/system.h +++ b/include/asm-sparc64/system.h | |||
@@ -123,8 +123,6 @@ do { __asm__ __volatile__("ba,pt %%xcc, 1f\n\t" \ | |||
123 | #define read_barrier_depends() do { } while(0) | 123 | #define read_barrier_depends() do { } while(0) |
124 | #define set_mb(__var, __value) \ | 124 | #define set_mb(__var, __value) \ |
125 | do { __var = __value; membar_storeload_storestore(); } while(0) | 125 | do { __var = __value; membar_storeload_storestore(); } while(0) |
126 | #define set_wmb(__var, __value) \ | ||
127 | do { __var = __value; wmb(); } while(0) | ||
128 | 126 | ||
129 | #ifdef CONFIG_SMP | 127 | #ifdef CONFIG_SMP |
130 | #define smp_mb() mb() | 128 | #define smp_mb() mb() |
diff --git a/include/asm-v850/system.h b/include/asm-v850/system.h index 7091af4b7866..da39916f10b0 100644 --- a/include/asm-v850/system.h +++ b/include/asm-v850/system.h | |||
@@ -68,7 +68,6 @@ static inline int irqs_disabled (void) | |||
68 | #define read_barrier_depends() ((void)0) | 68 | #define read_barrier_depends() ((void)0) |
69 | #define set_rmb(var, value) do { xchg (&var, value); } while (0) | 69 | #define set_rmb(var, value) do { xchg (&var, value); } while (0) |
70 | #define set_mb(var, value) set_rmb (var, value) | 70 | #define set_mb(var, value) set_rmb (var, value) |
71 | #define set_wmb(var, value) do { var = value; wmb (); } while (0) | ||
72 | 71 | ||
73 | #define smp_mb() mb () | 72 | #define smp_mb() mb () |
74 | #define smp_rmb() rmb () | 73 | #define smp_rmb() rmb () |
diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h index f67f2873a922..6bf170bceae1 100644 --- a/include/asm-x86_64/system.h +++ b/include/asm-x86_64/system.h | |||
@@ -240,7 +240,6 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, | |||
240 | #endif | 240 | #endif |
241 | #define read_barrier_depends() do {} while(0) | 241 | #define read_barrier_depends() do {} while(0) |
242 | #define set_mb(var, value) do { (void) xchg(&var, value); } while (0) | 242 | #define set_mb(var, value) do { (void) xchg(&var, value); } while (0) |
243 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | ||
244 | 243 | ||
245 | #define warn_if_not_ulong(x) do { unsigned long foo; (void) (&(x) == &foo); } while (0) | 244 | #define warn_if_not_ulong(x) do { unsigned long foo; (void) (&(x) == &foo); } while (0) |
246 | 245 | ||
diff --git a/include/asm-xtensa/system.h b/include/asm-xtensa/system.h index f986170bd2a1..932bda92a21c 100644 --- a/include/asm-xtensa/system.h +++ b/include/asm-xtensa/system.h | |||
@@ -99,7 +99,6 @@ static inline void disable_coprocessor(int i) | |||
99 | #endif | 99 | #endif |
100 | 100 | ||
101 | #define set_mb(var, value) do { var = value; mb(); } while (0) | 101 | #define set_mb(var, value) do { var = value; mb(); } while (0) |
102 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | ||
103 | 102 | ||
104 | #if !defined (__ASSEMBLY__) | 103 | #if !defined (__ASSEMBLY__) |
105 | 104 | ||
diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h new file mode 100644 index 000000000000..7e8b6011b8f3 --- /dev/null +++ b/include/linux/delayacct.h | |||
@@ -0,0 +1,119 @@ | |||
1 | /* delayacct.h - per-task delay accounting | ||
2 | * | ||
3 | * Copyright (C) Shailabh Nagar, IBM Corp. 2006 | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See | ||
13 | * the GNU General Public License for more details. | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #ifndef _LINUX_DELAYACCT_H | ||
18 | #define _LINUX_DELAYACCT_H | ||
19 | |||
20 | #include <linux/sched.h> | ||
21 | #include <linux/taskstats_kern.h> | ||
22 | |||
23 | /* | ||
24 | * Per-task flags relevant to delay accounting | ||
25 | * maintained privately to avoid exhausting similar flags in sched.h:PF_* | ||
26 | * Used to set current->delays->flags | ||
27 | */ | ||
28 | #define DELAYACCT_PF_SWAPIN 0x00000001 /* I am doing a swapin */ | ||
29 | |||
30 | #ifdef CONFIG_TASK_DELAY_ACCT | ||
31 | |||
32 | extern int delayacct_on; /* Delay accounting turned on/off */ | ||
33 | extern kmem_cache_t *delayacct_cache; | ||
34 | extern void delayacct_init(void); | ||
35 | extern void __delayacct_tsk_init(struct task_struct *); | ||
36 | extern void __delayacct_tsk_exit(struct task_struct *); | ||
37 | extern void __delayacct_blkio_start(void); | ||
38 | extern void __delayacct_blkio_end(void); | ||
39 | extern int __delayacct_add_tsk(struct taskstats *, struct task_struct *); | ||
40 | extern __u64 __delayacct_blkio_ticks(struct task_struct *); | ||
41 | |||
42 | static inline void delayacct_set_flag(int flag) | ||
43 | { | ||
44 | if (current->delays) | ||
45 | current->delays->flags |= flag; | ||
46 | } | ||
47 | |||
48 | static inline void delayacct_clear_flag(int flag) | ||
49 | { | ||
50 | if (current->delays) | ||
51 | current->delays->flags &= ~flag; | ||
52 | } | ||
53 | |||
54 | static inline void delayacct_tsk_init(struct task_struct *tsk) | ||
55 | { | ||
56 | /* reinitialize in case parent's non-null pointer was dup'ed*/ | ||
57 | tsk->delays = NULL; | ||
58 | if (unlikely(delayacct_on)) | ||
59 | __delayacct_tsk_init(tsk); | ||
60 | } | ||
61 | |||
62 | static inline void delayacct_tsk_exit(struct task_struct *tsk) | ||
63 | { | ||
64 | if (tsk->delays) | ||
65 | __delayacct_tsk_exit(tsk); | ||
66 | } | ||
67 | |||
68 | static inline void delayacct_blkio_start(void) | ||
69 | { | ||
70 | if (current->delays) | ||
71 | __delayacct_blkio_start(); | ||
72 | } | ||
73 | |||
74 | static inline void delayacct_blkio_end(void) | ||
75 | { | ||
76 | if (current->delays) | ||
77 | __delayacct_blkio_end(); | ||
78 | } | ||
79 | |||
80 | static inline int delayacct_add_tsk(struct taskstats *d, | ||
81 | struct task_struct *tsk) | ||
82 | { | ||
83 | if (likely(!delayacct_on)) | ||
84 | return -EINVAL; | ||
85 | if (!tsk->delays) | ||
86 | return 0; | ||
87 | return __delayacct_add_tsk(d, tsk); | ||
88 | } | ||
89 | |||
90 | static inline __u64 delayacct_blkio_ticks(struct task_struct *tsk) | ||
91 | { | ||
92 | if (tsk->delays) | ||
93 | return __delayacct_blkio_ticks(tsk); | ||
94 | return 0; | ||
95 | } | ||
96 | |||
97 | #else | ||
98 | static inline void delayacct_set_flag(int flag) | ||
99 | {} | ||
100 | static inline void delayacct_clear_flag(int flag) | ||
101 | {} | ||
102 | static inline void delayacct_init(void) | ||
103 | {} | ||
104 | static inline void delayacct_tsk_init(struct task_struct *tsk) | ||
105 | {} | ||
106 | static inline void delayacct_tsk_exit(struct task_struct *tsk) | ||
107 | {} | ||
108 | static inline void delayacct_blkio_start(void) | ||
109 | {} | ||
110 | static inline void delayacct_blkio_end(void) | ||
111 | {} | ||
112 | static inline int delayacct_add_tsk(struct taskstats *d, | ||
113 | struct task_struct *tsk) | ||
114 | { return 0; } | ||
115 | static inline __u64 delayacct_blkio_ticks(struct task_struct *tsk) | ||
116 | { return 0; } | ||
117 | #endif /* CONFIG_TASK_DELAY_ACCT */ | ||
118 | |||
119 | #endif | ||
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 21338bb3441d..9418519a55d1 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
@@ -115,6 +115,7 @@ | |||
115 | #define I2C_DRIVERID_BT866 85 /* Conexant bt866 video encoder */ | 115 | #define I2C_DRIVERID_BT866 85 /* Conexant bt866 video encoder */ |
116 | #define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */ | 116 | #define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */ |
117 | #define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */ | 117 | #define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */ |
118 | #define I2C_DRIVERID_ISL1208 88 /* Intersil ISL1208 RTC */ | ||
118 | 119 | ||
119 | #define I2C_DRIVERID_I2CDEV 900 | 120 | #define I2C_DRIVERID_I2CDEV 900 |
120 | #define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ | 121 | #define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ |
diff --git a/include/linux/kthread.h b/include/linux/kthread.h index 7cce5dfa092f..1c65e7a9f186 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h | |||
@@ -28,7 +28,6 @@ struct task_struct *kthread_create(int (*threadfn)(void *data), | |||
28 | 28 | ||
29 | void kthread_bind(struct task_struct *k, unsigned int cpu); | 29 | void kthread_bind(struct task_struct *k, unsigned int cpu); |
30 | int kthread_stop(struct task_struct *k); | 30 | int kthread_stop(struct task_struct *k); |
31 | int kthread_stop_sem(struct task_struct *k, struct semaphore *s); | ||
32 | int kthread_should_stop(void); | 31 | int kthread_should_stop(void); |
33 | 32 | ||
34 | #endif /* _LINUX_KTHREAD_H */ | 33 | #endif /* _LINUX_KTHREAD_H */ |
diff --git a/include/linux/list.h b/include/linux/list.h index 6b74adf5297f..65a5b5ceda49 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -265,6 +265,17 @@ static inline void list_move_tail(struct list_head *list, | |||
265 | } | 265 | } |
266 | 266 | ||
267 | /** | 267 | /** |
268 | * list_is_last - tests whether @list is the last entry in list @head | ||
269 | * @list: the entry to test | ||
270 | * @head: the head of the list | ||
271 | */ | ||
272 | static inline int list_is_last(const struct list_head *list, | ||
273 | const struct list_head *head) | ||
274 | { | ||
275 | return list->next == head; | ||
276 | } | ||
277 | |||
278 | /** | ||
268 | * list_empty - tests whether a list is empty | 279 | * list_empty - tests whether a list is empty |
269 | * @head: the list to test. | 280 | * @head: the list to test. |
270 | */ | 281 | */ |
diff --git a/include/linux/module.h b/include/linux/module.h index d06c74fb8c26..0dfb794c52d3 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -362,10 +362,8 @@ int is_module_address(unsigned long addr); | |||
362 | 362 | ||
363 | /* Returns module and fills in value, defined and namebuf, or NULL if | 363 | /* Returns module and fills in value, defined and namebuf, or NULL if |
364 | symnum out of range. */ | 364 | symnum out of range. */ |
365 | struct module *module_get_kallsym(unsigned int symnum, | 365 | struct module *module_get_kallsym(unsigned int symnum, unsigned long *value, |
366 | unsigned long *value, | 366 | char *type, char *name, size_t namelen); |
367 | char *type, | ||
368 | char namebuf[128]); | ||
369 | 367 | ||
370 | /* Look for this name: can be of form module:name. */ | 368 | /* Look for this name: can be of form module:name. */ |
371 | unsigned long module_kallsyms_lookup_name(const char *name); | 369 | unsigned long module_kallsyms_lookup_name(const char *name); |
@@ -535,8 +533,8 @@ static inline const char *module_address_lookup(unsigned long addr, | |||
535 | 533 | ||
536 | static inline struct module *module_get_kallsym(unsigned int symnum, | 534 | static inline struct module *module_get_kallsym(unsigned int symnum, |
537 | unsigned long *value, | 535 | unsigned long *value, |
538 | char *type, | 536 | char *type, char *name, |
539 | char namebuf[128]) | 537 | size_t namelen) |
540 | { | 538 | { |
541 | return NULL; | 539 | return NULL; |
542 | } | 540 | } |
diff --git a/include/linux/namei.h b/include/linux/namei.h index 58cb3d3d44b4..45511a5918d3 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -11,7 +11,7 @@ struct open_intent { | |||
11 | struct file *file; | 11 | struct file *file; |
12 | }; | 12 | }; |
13 | 13 | ||
14 | enum { MAX_NESTED_LINKS = 5 }; | 14 | enum { MAX_NESTED_LINKS = 8 }; |
15 | 15 | ||
16 | struct nameidata { | 16 | struct nameidata { |
17 | struct dentry *dentry; | 17 | struct dentry *dentry; |
diff --git a/include/linux/nsc_gpio.h b/include/linux/nsc_gpio.h index 135742cfada5..7da0cf3702ee 100644 --- a/include/linux/nsc_gpio.h +++ b/include/linux/nsc_gpio.h | |||
@@ -25,8 +25,6 @@ struct nsc_gpio_ops { | |||
25 | void (*gpio_dump) (struct nsc_gpio_ops *amp, unsigned iminor); | 25 | void (*gpio_dump) (struct nsc_gpio_ops *amp, unsigned iminor); |
26 | int (*gpio_get) (unsigned iminor); | 26 | int (*gpio_get) (unsigned iminor); |
27 | void (*gpio_set) (unsigned iminor, int state); | 27 | void (*gpio_set) (unsigned iminor, int state); |
28 | void (*gpio_set_high)(unsigned iminor); | ||
29 | void (*gpio_set_low) (unsigned iminor); | ||
30 | void (*gpio_change) (unsigned iminor); | 28 | void (*gpio_change) (unsigned iminor); |
31 | int (*gpio_current) (unsigned iminor); | 29 | int (*gpio_current) (unsigned iminor); |
32 | struct device* dev; /* for dev_dbg() support, set in init */ | 30 | struct device* dev; /* for dev_dbg() support, set in init */ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 1c876e27ff93..6afa72e080cb 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -463,6 +463,10 @@ struct signal_struct { | |||
463 | #ifdef CONFIG_BSD_PROCESS_ACCT | 463 | #ifdef CONFIG_BSD_PROCESS_ACCT |
464 | struct pacct_struct pacct; /* per-process accounting information */ | 464 | struct pacct_struct pacct; /* per-process accounting information */ |
465 | #endif | 465 | #endif |
466 | #ifdef CONFIG_TASKSTATS | ||
467 | spinlock_t stats_lock; | ||
468 | struct taskstats *stats; | ||
469 | #endif | ||
466 | }; | 470 | }; |
467 | 471 | ||
468 | /* Context switch must be unlocked if interrupts are to be enabled */ | 472 | /* Context switch must be unlocked if interrupts are to be enabled */ |
@@ -537,7 +541,7 @@ extern struct user_struct root_user; | |||
537 | struct backing_dev_info; | 541 | struct backing_dev_info; |
538 | struct reclaim_state; | 542 | struct reclaim_state; |
539 | 543 | ||
540 | #ifdef CONFIG_SCHEDSTATS | 544 | #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) |
541 | struct sched_info { | 545 | struct sched_info { |
542 | /* cumulative counters */ | 546 | /* cumulative counters */ |
543 | unsigned long cpu_time, /* time spent on the cpu */ | 547 | unsigned long cpu_time, /* time spent on the cpu */ |
@@ -548,9 +552,53 @@ struct sched_info { | |||
548 | unsigned long last_arrival, /* when we last ran on a cpu */ | 552 | unsigned long last_arrival, /* when we last ran on a cpu */ |
549 | last_queued; /* when we were last queued to run */ | 553 | last_queued; /* when we were last queued to run */ |
550 | }; | 554 | }; |
555 | #endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */ | ||
551 | 556 | ||
557 | #ifdef CONFIG_SCHEDSTATS | ||
552 | extern struct file_operations proc_schedstat_operations; | 558 | extern struct file_operations proc_schedstat_operations; |
559 | #endif /* CONFIG_SCHEDSTATS */ | ||
560 | |||
561 | #ifdef CONFIG_TASK_DELAY_ACCT | ||
562 | struct task_delay_info { | ||
563 | spinlock_t lock; | ||
564 | unsigned int flags; /* Private per-task flags */ | ||
565 | |||
566 | /* For each stat XXX, add following, aligned appropriately | ||
567 | * | ||
568 | * struct timespec XXX_start, XXX_end; | ||
569 | * u64 XXX_delay; | ||
570 | * u32 XXX_count; | ||
571 | * | ||
572 | * Atomicity of updates to XXX_delay, XXX_count protected by | ||
573 | * single lock above (split into XXX_lock if contention is an issue). | ||
574 | */ | ||
575 | |||
576 | /* | ||
577 | * XXX_count is incremented on every XXX operation, the delay | ||
578 | * associated with the operation is added to XXX_delay. | ||
579 | * XXX_delay contains the accumulated delay time in nanoseconds. | ||
580 | */ | ||
581 | struct timespec blkio_start, blkio_end; /* Shared by blkio, swapin */ | ||
582 | u64 blkio_delay; /* wait for sync block io completion */ | ||
583 | u64 swapin_delay; /* wait for swapin block io completion */ | ||
584 | u32 blkio_count; /* total count of the number of sync block */ | ||
585 | /* io operations performed */ | ||
586 | u32 swapin_count; /* total count of the number of swapin block */ | ||
587 | /* io operations performed */ | ||
588 | }; | ||
589 | #endif /* CONFIG_TASK_DELAY_ACCT */ | ||
590 | |||
591 | static inline int sched_info_on(void) | ||
592 | { | ||
593 | #ifdef CONFIG_SCHEDSTATS | ||
594 | return 1; | ||
595 | #elif defined(CONFIG_TASK_DELAY_ACCT) | ||
596 | extern int delayacct_on; | ||
597 | return delayacct_on; | ||
598 | #else | ||
599 | return 0; | ||
553 | #endif | 600 | #endif |
601 | } | ||
554 | 602 | ||
555 | enum idle_type | 603 | enum idle_type |
556 | { | 604 | { |
@@ -747,7 +795,7 @@ struct task_struct { | |||
747 | cpumask_t cpus_allowed; | 795 | cpumask_t cpus_allowed; |
748 | unsigned int time_slice, first_time_slice; | 796 | unsigned int time_slice, first_time_slice; |
749 | 797 | ||
750 | #ifdef CONFIG_SCHEDSTATS | 798 | #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) |
751 | struct sched_info sched_info; | 799 | struct sched_info sched_info; |
752 | #endif | 800 | #endif |
753 | 801 | ||
@@ -945,6 +993,10 @@ struct task_struct { | |||
945 | * cache last used pipe for splice | 993 | * cache last used pipe for splice |
946 | */ | 994 | */ |
947 | struct pipe_inode_info *splice_pipe; | 995 | struct pipe_inode_info *splice_pipe; |
996 | #ifdef CONFIG_TASK_DELAY_ACCT | ||
997 | spinlock_t delays_lock; | ||
998 | struct task_delay_info *delays; | ||
999 | #endif | ||
948 | }; | 1000 | }; |
949 | 1001 | ||
950 | static inline pid_t process_group(struct task_struct *tsk) | 1002 | static inline pid_t process_group(struct task_struct *tsk) |
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h new file mode 100644 index 000000000000..f1cb6cddd19d --- /dev/null +++ b/include/linux/taskstats.h | |||
@@ -0,0 +1,137 @@ | |||
1 | /* taskstats.h - exporting per-task statistics | ||
2 | * | ||
3 | * Copyright (C) Shailabh Nagar, IBM Corp. 2006 | ||
4 | * (C) Balbir Singh, IBM Corp. 2006 | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of version 2.1 of the GNU Lesser General Public License | ||
8 | * as published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope that it would be useful, but | ||
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | */ | ||
14 | |||
15 | #ifndef _LINUX_TASKSTATS_H | ||
16 | #define _LINUX_TASKSTATS_H | ||
17 | |||
18 | /* Format for per-task data returned to userland when | ||
19 | * - a task exits | ||
20 | * - listener requests stats for a task | ||
21 | * | ||
22 | * The struct is versioned. Newer versions should only add fields to | ||
23 | * the bottom of the struct to maintain backward compatibility. | ||
24 | * | ||
25 | * | ||
26 | * To add new fields | ||
27 | * a) bump up TASKSTATS_VERSION | ||
28 | * b) add comment indicating new version number at end of struct | ||
29 | * c) add new fields after version comment; maintain 64-bit alignment | ||
30 | */ | ||
31 | |||
32 | #define TASKSTATS_VERSION 1 | ||
33 | |||
34 | struct taskstats { | ||
35 | |||
36 | /* Version 1 */ | ||
37 | __u16 version; | ||
38 | __u16 padding[3]; /* Userspace should not interpret the padding | ||
39 | * field which can be replaced by useful | ||
40 | * fields if struct taskstats is extended. | ||
41 | */ | ||
42 | |||
43 | /* Delay accounting fields start | ||
44 | * | ||
45 | * All values, until comment "Delay accounting fields end" are | ||
46 | * available only if delay accounting is enabled, even though the last | ||
47 | * few fields are not delays | ||
48 | * | ||
49 | * xxx_count is the number of delay values recorded | ||
50 | * xxx_delay_total is the corresponding cumulative delay in nanoseconds | ||
51 | * | ||
52 | * xxx_delay_total wraps around to zero on overflow | ||
53 | * xxx_count incremented regardless of overflow | ||
54 | */ | ||
55 | |||
56 | /* Delay waiting for cpu, while runnable | ||
57 | * count, delay_total NOT updated atomically | ||
58 | */ | ||
59 | __u64 cpu_count; | ||
60 | __u64 cpu_delay_total; | ||
61 | |||
62 | /* Following four fields atomically updated using task->delays->lock */ | ||
63 | |||
64 | /* Delay waiting for synchronous block I/O to complete | ||
65 | * does not account for delays in I/O submission | ||
66 | */ | ||
67 | __u64 blkio_count; | ||
68 | __u64 blkio_delay_total; | ||
69 | |||
70 | /* Delay waiting for page fault I/O (swap in only) */ | ||
71 | __u64 swapin_count; | ||
72 | __u64 swapin_delay_total; | ||
73 | |||
74 | /* cpu "wall-clock" running time | ||
75 | * On some architectures, value will adjust for cpu time stolen | ||
76 | * from the kernel in involuntary waits due to virtualization. | ||
77 | * Value is cumulative, in nanoseconds, without a corresponding count | ||
78 | * and wraps around to zero silently on overflow | ||
79 | */ | ||
80 | __u64 cpu_run_real_total; | ||
81 | |||
82 | /* cpu "virtual" running time | ||
83 | * Uses time intervals seen by the kernel i.e. no adjustment | ||
84 | * for kernel's involuntary waits due to virtualization. | ||
85 | * Value is cumulative, in nanoseconds, without a corresponding count | ||
86 | * and wraps around to zero silently on overflow | ||
87 | */ | ||
88 | __u64 cpu_run_virtual_total; | ||
89 | /* Delay accounting fields end */ | ||
90 | /* version 1 ends here */ | ||
91 | }; | ||
92 | |||
93 | |||
94 | /* | ||
95 | * Commands sent from userspace | ||
96 | * Not versioned. New commands should only be inserted at the enum's end | ||
97 | * prior to __TASKSTATS_CMD_MAX | ||
98 | */ | ||
99 | |||
100 | enum { | ||
101 | TASKSTATS_CMD_UNSPEC = 0, /* Reserved */ | ||
102 | TASKSTATS_CMD_GET, /* user->kernel request/get-response */ | ||
103 | TASKSTATS_CMD_NEW, /* kernel->user event */ | ||
104 | __TASKSTATS_CMD_MAX, | ||
105 | }; | ||
106 | |||
107 | #define TASKSTATS_CMD_MAX (__TASKSTATS_CMD_MAX - 1) | ||
108 | |||
109 | enum { | ||
110 | TASKSTATS_TYPE_UNSPEC = 0, /* Reserved */ | ||
111 | TASKSTATS_TYPE_PID, /* Process id */ | ||
112 | TASKSTATS_TYPE_TGID, /* Thread group id */ | ||
113 | TASKSTATS_TYPE_STATS, /* taskstats structure */ | ||
114 | TASKSTATS_TYPE_AGGR_PID, /* contains pid + stats */ | ||
115 | TASKSTATS_TYPE_AGGR_TGID, /* contains tgid + stats */ | ||
116 | __TASKSTATS_TYPE_MAX, | ||
117 | }; | ||
118 | |||
119 | #define TASKSTATS_TYPE_MAX (__TASKSTATS_TYPE_MAX - 1) | ||
120 | |||
121 | enum { | ||
122 | TASKSTATS_CMD_ATTR_UNSPEC = 0, | ||
123 | TASKSTATS_CMD_ATTR_PID, | ||
124 | TASKSTATS_CMD_ATTR_TGID, | ||
125 | TASKSTATS_CMD_ATTR_REGISTER_CPUMASK, | ||
126 | TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK, | ||
127 | __TASKSTATS_CMD_ATTR_MAX, | ||
128 | }; | ||
129 | |||
130 | #define TASKSTATS_CMD_ATTR_MAX (__TASKSTATS_CMD_ATTR_MAX - 1) | ||
131 | |||
132 | /* NETLINK_GENERIC related info */ | ||
133 | |||
134 | #define TASKSTATS_GENL_NAME "TASKSTATS" | ||
135 | #define TASKSTATS_GENL_VERSION 0x1 | ||
136 | |||
137 | #endif /* _LINUX_TASKSTATS_H */ | ||
diff --git a/include/linux/taskstats_kern.h b/include/linux/taskstats_kern.h new file mode 100644 index 000000000000..16894b7edcc8 --- /dev/null +++ b/include/linux/taskstats_kern.h | |||
@@ -0,0 +1,89 @@ | |||
1 | /* taskstats_kern.h - kernel header for per-task statistics interface | ||
2 | * | ||
3 | * Copyright (C) Shailabh Nagar, IBM Corp. 2006 | ||
4 | * (C) Balbir Singh, IBM Corp. 2006 | ||
5 | */ | ||
6 | |||
7 | #ifndef _LINUX_TASKSTATS_KERN_H | ||
8 | #define _LINUX_TASKSTATS_KERN_H | ||
9 | |||
10 | #include <linux/taskstats.h> | ||
11 | #include <linux/sched.h> | ||
12 | #include <net/genetlink.h> | ||
13 | |||
14 | #ifdef CONFIG_TASKSTATS | ||
15 | extern kmem_cache_t *taskstats_cache; | ||
16 | extern struct mutex taskstats_exit_mutex; | ||
17 | |||
18 | static inline void taskstats_exit_free(struct taskstats *tidstats) | ||
19 | { | ||
20 | if (tidstats) | ||
21 | kmem_cache_free(taskstats_cache, tidstats); | ||
22 | } | ||
23 | |||
24 | static inline void taskstats_tgid_init(struct signal_struct *sig) | ||
25 | { | ||
26 | spin_lock_init(&sig->stats_lock); | ||
27 | sig->stats = NULL; | ||
28 | } | ||
29 | |||
30 | static inline void taskstats_tgid_alloc(struct signal_struct *sig) | ||
31 | { | ||
32 | struct taskstats *stats; | ||
33 | unsigned long flags; | ||
34 | |||
35 | stats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL); | ||
36 | if (!stats) | ||
37 | return; | ||
38 | |||
39 | spin_lock_irqsave(&sig->stats_lock, flags); | ||
40 | if (!sig->stats) { | ||
41 | sig->stats = stats; | ||
42 | stats = NULL; | ||
43 | } | ||
44 | spin_unlock_irqrestore(&sig->stats_lock, flags); | ||
45 | |||
46 | if (stats) | ||
47 | kmem_cache_free(taskstats_cache, stats); | ||
48 | } | ||
49 | |||
50 | static inline void taskstats_tgid_free(struct signal_struct *sig) | ||
51 | { | ||
52 | struct taskstats *stats = NULL; | ||
53 | unsigned long flags; | ||
54 | |||
55 | spin_lock_irqsave(&sig->stats_lock, flags); | ||
56 | if (sig->stats) { | ||
57 | stats = sig->stats; | ||
58 | sig->stats = NULL; | ||
59 | } | ||
60 | spin_unlock_irqrestore(&sig->stats_lock, flags); | ||
61 | if (stats) | ||
62 | kmem_cache_free(taskstats_cache, stats); | ||
63 | } | ||
64 | |||
65 | extern void taskstats_exit_alloc(struct taskstats **, unsigned int *); | ||
66 | extern void taskstats_exit_send(struct task_struct *, struct taskstats *, int, unsigned int); | ||
67 | extern void taskstats_init_early(void); | ||
68 | extern void taskstats_tgid_alloc(struct signal_struct *); | ||
69 | #else | ||
70 | static inline void taskstats_exit_alloc(struct taskstats **ptidstats, unsigned int *mycpu) | ||
71 | {} | ||
72 | static inline void taskstats_exit_free(struct taskstats *ptidstats) | ||
73 | {} | ||
74 | static inline void taskstats_exit_send(struct task_struct *tsk, | ||
75 | struct taskstats *tidstats, | ||
76 | int group_dead, unsigned int cpu) | ||
77 | {} | ||
78 | static inline void taskstats_tgid_init(struct signal_struct *sig) | ||
79 | {} | ||
80 | static inline void taskstats_tgid_alloc(struct signal_struct *sig) | ||
81 | {} | ||
82 | static inline void taskstats_tgid_free(struct signal_struct *sig) | ||
83 | {} | ||
84 | static inline void taskstats_init_early(void) | ||
85 | {} | ||
86 | #endif /* CONFIG_TASKSTATS */ | ||
87 | |||
88 | #endif | ||
89 | |||
diff --git a/include/linux/time.h b/include/linux/time.h index c05f8bb9a323..a5b739967b74 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -71,6 +71,18 @@ extern unsigned long mktime(const unsigned int year, const unsigned int mon, | |||
71 | extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec); | 71 | extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec); |
72 | 72 | ||
73 | /* | 73 | /* |
74 | * sub = lhs - rhs, in normalized form | ||
75 | */ | ||
76 | static inline struct timespec timespec_sub(struct timespec lhs, | ||
77 | struct timespec rhs) | ||
78 | { | ||
79 | struct timespec ts_delta; | ||
80 | set_normalized_timespec(&ts_delta, lhs.tv_sec - rhs.tv_sec, | ||
81 | lhs.tv_nsec - rhs.tv_nsec); | ||
82 | return ts_delta; | ||
83 | } | ||
84 | |||
85 | /* | ||
74 | * Returns true if the timespec is norm, false if denorm: | 86 | * Returns true if the timespec is norm, false if denorm: |
75 | */ | 87 | */ |
76 | #define timespec_valid(ts) \ | 88 | #define timespec_valid(ts) \ |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index f6024ab4eff0..71b6363caaaf 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -11,6 +11,7 @@ struct vm_area_struct; | |||
11 | #define VM_ALLOC 0x00000002 /* vmalloc() */ | 11 | #define VM_ALLOC 0x00000002 /* vmalloc() */ |
12 | #define VM_MAP 0x00000004 /* vmap()ed pages */ | 12 | #define VM_MAP 0x00000004 /* vmap()ed pages */ |
13 | #define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */ | 13 | #define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */ |
14 | #define VM_VPAGES 0x00000010 /* buffer for pages was vmalloc'ed */ | ||
14 | /* bits [20..32] reserved for arch specific ioremap internals */ | 15 | /* bits [20..32] reserved for arch specific ioremap internals */ |
15 | 16 | ||
16 | /* | 17 | /* |
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index 805de50df00d..8c2287264266 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
@@ -150,4 +150,24 @@ static inline int genlmsg_unicast(struct sk_buff *skb, u32 pid) | |||
150 | return nlmsg_unicast(genl_sock, skb, pid); | 150 | return nlmsg_unicast(genl_sock, skb, pid); |
151 | } | 151 | } |
152 | 152 | ||
153 | /** | ||
154 | * gennlmsg_data - head of message payload | ||
155 | * @gnlh: genetlink messsage header | ||
156 | */ | ||
157 | static inline void *genlmsg_data(const struct genlmsghdr *gnlh) | ||
158 | { | ||
159 | return ((unsigned char *) gnlh + GENL_HDRLEN); | ||
160 | } | ||
161 | |||
162 | /** | ||
163 | * genlmsg_len - length of message payload | ||
164 | * @gnlh: genetlink message header | ||
165 | */ | ||
166 | static inline int genlmsg_len(const struct genlmsghdr *gnlh) | ||
167 | { | ||
168 | struct nlmsghdr *nlh = (struct nlmsghdr *)((unsigned char *)gnlh - | ||
169 | NLMSG_HDRLEN); | ||
170 | return (nlh->nlmsg_len - GENL_HDRLEN - NLMSG_HDRLEN); | ||
171 | } | ||
172 | |||
153 | #endif /* __NET_GENERIC_NETLINK_H */ | 173 | #endif /* __NET_GENERIC_NETLINK_H */ |
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h index fcb5ba87dcc5..0ff67398928d 100644 --- a/include/rdma/ib_addr.h +++ b/include/rdma/ib_addr.h | |||
@@ -89,9 +89,10 @@ static inline void ib_addr_set_pkey(struct rdma_dev_addr *dev_addr, u16 pkey) | |||
89 | dev_addr->broadcast[9] = (unsigned char) pkey; | 89 | dev_addr->broadcast[9] = (unsigned char) pkey; |
90 | } | 90 | } |
91 | 91 | ||
92 | static inline union ib_gid *ib_addr_get_sgid(struct rdma_dev_addr *dev_addr) | 92 | static inline void ib_addr_get_sgid(struct rdma_dev_addr *dev_addr, |
93 | union ib_gid *gid) | ||
93 | { | 94 | { |
94 | return (union ib_gid *) (dev_addr->src_dev_addr + 4); | 95 | memcpy(gid, dev_addr->src_dev_addr + 4, sizeof *gid); |
95 | } | 96 | } |
96 | 97 | ||
97 | static inline void ib_addr_set_sgid(struct rdma_dev_addr *dev_addr, | 98 | static inline void ib_addr_set_sgid(struct rdma_dev_addr *dev_addr, |
@@ -100,9 +101,10 @@ static inline void ib_addr_set_sgid(struct rdma_dev_addr *dev_addr, | |||
100 | memcpy(dev_addr->src_dev_addr + 4, gid, sizeof *gid); | 101 | memcpy(dev_addr->src_dev_addr + 4, gid, sizeof *gid); |
101 | } | 102 | } |
102 | 103 | ||
103 | static inline union ib_gid *ib_addr_get_dgid(struct rdma_dev_addr *dev_addr) | 104 | static inline void ib_addr_get_dgid(struct rdma_dev_addr *dev_addr, |
105 | union ib_gid *gid) | ||
104 | { | 106 | { |
105 | return (union ib_gid *) (dev_addr->dst_dev_addr + 4); | 107 | memcpy(gid, dev_addr->dst_dev_addr + 4, sizeof *gid); |
106 | } | 108 | } |
107 | 109 | ||
108 | static inline void ib_addr_set_dgid(struct rdma_dev_addr *dev_addr, | 110 | static inline void ib_addr_set_dgid(struct rdma_dev_addr *dev_addr, |
diff --git a/include/rdma/ib_fmr_pool.h b/include/rdma/ib_fmr_pool.h index 4ace54cd0cce..00dadbf94e1d 100644 --- a/include/rdma/ib_fmr_pool.h +++ b/include/rdma/ib_fmr_pool.h | |||
@@ -88,7 +88,7 @@ int ib_flush_fmr_pool(struct ib_fmr_pool *pool); | |||
88 | struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle, | 88 | struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle, |
89 | u64 *page_list, | 89 | u64 *page_list, |
90 | int list_len, | 90 | int list_len, |
91 | u64 *io_virtual_address); | 91 | u64 io_virtual_address); |
92 | 92 | ||
93 | int ib_fmr_pool_unmap(struct ib_pool_fmr *fmr); | 93 | int ib_fmr_pool_unmap(struct ib_pool_fmr *fmr); |
94 | 94 | ||
diff --git a/include/video/mbxfb.h b/include/video/mbxfb.h new file mode 100644 index 000000000000..3bde0f5cd55c --- /dev/null +++ b/include/video/mbxfb.h | |||
@@ -0,0 +1,28 @@ | |||
1 | #ifndef __MBX_FB_H | ||
2 | #define __MBX_FB_H | ||
3 | |||
4 | struct mbxfb_val { | ||
5 | unsigned int defval; | ||
6 | unsigned int min; | ||
7 | unsigned int max; | ||
8 | }; | ||
9 | |||
10 | struct fb_info; | ||
11 | |||
12 | struct mbxfb_platform_data { | ||
13 | /* Screen info */ | ||
14 | struct mbxfb_val xres; | ||
15 | struct mbxfb_val yres; | ||
16 | struct mbxfb_val bpp; | ||
17 | |||
18 | /* Memory info */ | ||
19 | unsigned long memsize; /* if 0 use ODFB? */ | ||
20 | unsigned long timings1; | ||
21 | unsigned long timings2; | ||
22 | unsigned long timings3; | ||
23 | |||
24 | int (*probe)(struct fb_info *fb); | ||
25 | int (*remove)(struct fb_info *fb); | ||
26 | }; | ||
27 | |||
28 | #endif /* __MBX_FB_H */ | ||