]> git.wh0rd.org - ICEs.git/blob - bfin-get-user/foo.i.0
add bfin ice
[ICEs.git] / bfin-get-user / foo.i.0
1 # 1 "fs/foo.c"
2 # 1 "<built-in>"
3 # 1 "<command line>"
4 # 1 "./include/linux/autoconf.h" 1
5 # 1 "<command line>" 2
6 # 1 "fs/foo.c"
7 # 1 "include/asm/uaccess.h" 1
8 # 12 "include/asm/uaccess.h"
9 # 1 "include/linux/sched.h" 1
10
11
12
13 # 1 "include/linux/auxvec.h" 1
14
15
16
17 # 1 "include/asm/auxvec.h" 1
18 # 5 "include/linux/auxvec.h" 2
19 # 5 "include/linux/sched.h" 2
20 # 40 "include/linux/sched.h"
21 struct sched_param {
22 int sched_priority;
23 };
24
25 # 1 "include/asm/param.h" 1
26 # 45 "include/linux/sched.h" 2
27
28 # 1 "include/linux/capability.h" 1
29 # 16 "include/linux/capability.h"
30 # 1 "include/linux/types.h" 1
31 # 14 "include/linux/types.h"
32 # 1 "include/linux/posix_types.h" 1
33
34
35
36 # 1 "include/linux/stddef.h" 1
37
38
39
40 # 1 "include/linux/compiler.h" 1
41 # 42 "include/linux/compiler.h"
42 # 1 "include/linux/compiler-gcc4.h" 1
43
44
45
46 # 1 "include/linux/compiler-gcc.h" 1
47 # 5 "include/linux/compiler-gcc4.h" 2
48 # 43 "include/linux/compiler.h" 2
49 # 5 "include/linux/stddef.h" 2
50 # 15 "include/linux/stddef.h"
51 enum {
52 false = 0,
53 true = 1
54 };
55 # 5 "include/linux/posix_types.h" 2
56 # 36 "include/linux/posix_types.h"
57 typedef struct {
58 unsigned long fds_bits [(1024/(8 * sizeof(unsigned long)))];
59 } __kernel_fd_set;
60
61
62 typedef void (*__kernel_sighandler_t)(int);
63
64
65 typedef int __kernel_key_t;
66 typedef int __kernel_mqd_t;
67
68 # 1 "include/asm/posix_types.h" 1
69 # 10 "include/asm/posix_types.h"
70 typedef unsigned long __kernel_ino_t;
71 typedef unsigned short __kernel_mode_t;
72 typedef unsigned short __kernel_nlink_t;
73 typedef long __kernel_off_t;
74 typedef int __kernel_pid_t;
75 typedef unsigned int __kernel_ipc_pid_t;
76 typedef unsigned int __kernel_uid_t;
77 typedef unsigned int __kernel_gid_t;
78 typedef unsigned long __kernel_size_t;
79 typedef long __kernel_ssize_t;
80 typedef int __kernel_ptrdiff_t;
81 typedef long __kernel_time_t;
82 typedef long __kernel_suseconds_t;
83 typedef long __kernel_clock_t;
84 typedef int __kernel_timer_t;
85 typedef int __kernel_clockid_t;
86 typedef int __kernel_daddr_t;
87 typedef char *__kernel_caddr_t;
88 typedef unsigned short __kernel_uid16_t;
89 typedef unsigned short __kernel_gid16_t;
90 typedef unsigned int __kernel_uid32_t;
91 typedef unsigned int __kernel_gid32_t;
92
93 typedef unsigned short __kernel_old_uid_t;
94 typedef unsigned short __kernel_old_gid_t;
95 typedef unsigned short __kernel_old_dev_t;
96
97
98 typedef long long __kernel_loff_t;
99
100
101 typedef struct {
102
103 int val[2];
104
105
106
107 } __kernel_fsid_t;
108 # 48 "include/linux/posix_types.h" 2
109 # 15 "include/linux/types.h" 2
110 # 1 "include/asm/types.h" 1
111 # 13 "include/asm/types.h"
112 typedef unsigned short umode_t;
113
114
115
116
117
118
119 typedef __signed__ char __s8;
120 typedef unsigned char __u8;
121
122 typedef __signed__ short __s16;
123 typedef unsigned short __u16;
124
125 typedef __signed__ int __s32;
126 typedef unsigned int __u32;
127
128
129
130 typedef __signed__ long long __s64;
131 typedef unsigned long long __u64;
132 # 45 "include/asm/types.h"
133 typedef signed char s8;
134 typedef unsigned char u8;
135
136 typedef signed short s16;
137 typedef unsigned short u16;
138
139 typedef signed int s32;
140 typedef unsigned int u32;
141
142 typedef signed long long s64;
143 typedef unsigned long long u64;
144
145
146
147 typedef u32 dma_addr_t;
148 typedef u64 dma64_addr_t;
149 # 16 "include/linux/types.h" 2
150
151
152
153 typedef __u32 __kernel_dev_t;
154
155 typedef __kernel_fd_set fd_set;
156 typedef __kernel_dev_t dev_t;
157 typedef __kernel_ino_t ino_t;
158 typedef __kernel_mode_t mode_t;
159 typedef __kernel_nlink_t nlink_t;
160 typedef __kernel_off_t off_t;
161 typedef __kernel_pid_t pid_t;
162 typedef __kernel_daddr_t daddr_t;
163 typedef __kernel_key_t key_t;
164 typedef __kernel_suseconds_t suseconds_t;
165 typedef __kernel_timer_t timer_t;
166 typedef __kernel_clockid_t clockid_t;
167 typedef __kernel_mqd_t mqd_t;
168
169
170 typedef _Bool bool;
171
172 typedef __kernel_uid32_t uid_t;
173 typedef __kernel_gid32_t gid_t;
174 typedef __kernel_uid16_t uid16_t;
175 typedef __kernel_gid16_t gid16_t;
176
177
178
179 typedef __kernel_old_uid_t old_uid_t;
180 typedef __kernel_old_gid_t old_gid_t;
181 # 58 "include/linux/types.h"
182 typedef __kernel_loff_t loff_t;
183 # 67 "include/linux/types.h"
184 typedef __kernel_size_t size_t;
185
186
187
188
189 typedef __kernel_ssize_t ssize_t;
190
191
192
193
194 typedef __kernel_ptrdiff_t ptrdiff_t;
195
196
197
198
199 typedef __kernel_time_t time_t;
200
201
202
203
204 typedef __kernel_clock_t clock_t;
205
206
207
208
209 typedef __kernel_caddr_t caddr_t;
210
211
212
213 typedef unsigned char u_char;
214 typedef unsigned short u_short;
215 typedef unsigned int u_int;
216 typedef unsigned long u_long;
217
218
219 typedef unsigned char unchar;
220 typedef unsigned short ushort;
221 typedef unsigned int uint;
222 typedef unsigned long ulong;
223
224
225
226
227 typedef __u8 u_int8_t;
228 typedef __s8 int8_t;
229 typedef __u16 u_int16_t;
230 typedef __s16 int16_t;
231 typedef __u32 u_int32_t;
232 typedef __s32 int32_t;
233
234
235
236 typedef __u8 uint8_t;
237 typedef __u16 uint16_t;
238 typedef __u32 uint32_t;
239
240
241 typedef __u64 uint64_t;
242 typedef __u64 u_int64_t;
243 typedef __s64 int64_t;
244 # 143 "include/linux/types.h"
245 typedef unsigned long sector_t;
246 # 152 "include/linux/types.h"
247 typedef unsigned long blkcnt_t;
248 # 181 "include/linux/types.h"
249 typedef __u16 __le16;
250 typedef __u16 __be16;
251 typedef __u32 __le32;
252 typedef __u32 __be32;
253
254 typedef __u64 __le64;
255 typedef __u64 __be64;
256
257 typedef __u16 __sum16;
258 typedef __u32 __wsum;
259
260
261 typedef unsigned gfp_t;
262
263
264
265
266 typedef u32 resource_size_t;
267
268
269
270
271 struct ustat {
272 __kernel_daddr_t f_tfree;
273 __kernel_ino_t f_tinode;
274 char f_fname[6];
275 char f_fpack[6];
276 };
277 # 17 "include/linux/capability.h" 2
278 # 32 "include/linux/capability.h"
279 typedef struct __user_cap_header_struct {
280 __u32 version;
281 int pid;
282 } *cap_user_header_t;
283
284 typedef struct __user_cap_data_struct {
285 __u32 effective;
286 __u32 permitted;
287 __u32 inheritable;
288 } *cap_user_data_t;
289
290
291
292 # 1 "include/linux/spinlock.h" 1
293 # 49 "include/linux/spinlock.h"
294 # 1 "include/linux/preempt.h" 1
295 # 9 "include/linux/preempt.h"
296 # 1 "include/linux/thread_info.h" 1
297 # 13 "include/linux/thread_info.h"
298 struct restart_block {
299 long (*fn)(struct restart_block *);
300 unsigned long arg0, arg1, arg2, arg3;
301 };
302
303 extern long do_no_restart_syscall(struct restart_block *parm);
304
305 # 1 "include/linux/bitops.h" 1
306 # 9 "include/linux/bitops.h"
307 # 1 "include/asm/bitops.h" 1
308 # 9 "include/asm/bitops.h"
309 # 1 "include/asm/byteorder.h" 1
310 # 9 "include/asm/byteorder.h"
311 static __inline__ __attribute__((always_inline)) __attribute__((__const__)) __u32 ___arch__swahb32(__u32 xx)
312 {
313 __u32 tmp;
314 __asm__("%1 = %0 >> 8 (V);\n\t"
315 "%0 = %0 << 8 (V);\n\t"
316 "%0 = %0 | %1;\n\t"
317 : "+d"(xx), "=&d"(tmp));
318 return xx;
319 }
320
321 static __inline__ __attribute__((always_inline)) __attribute__((__const__)) __u32 ___arch__swahw32(__u32 xx)
322 {
323 __u32 rv;
324 __asm__("%0 = PACK(%1.L, %1.H);\n\t": "=d"(rv): "d"(xx));
325 return rv;
326 }
327
328
329
330
331
332 static __inline__ __attribute__((always_inline)) __attribute__((__const__)) __u16 ___arch__swab16(__u16 xx)
333 {
334 __u32 xw = xx;
335 __asm__("%0 <<= 8;\n %0.L = %0.L + %0.H (NS);\n": "+d"(xw));
336 return (__u16)xw;
337 }
338 # 46 "include/asm/byteorder.h"
339 # 1 "include/linux/byteorder/little_endian.h" 1
340 # 12 "include/linux/byteorder/little_endian.h"
341 # 1 "include/linux/byteorder/swab.h" 1
342 # 133 "include/linux/byteorder/swab.h"
343 static __inline__ __attribute__((always_inline)) __attribute__((__const__)) __u16 __fswab16(__u16 x)
344 {
345 return ___arch__swab16(x);
346 }
347 static __inline__ __attribute__((always_inline)) __u16 __swab16p(const __u16 *x)
348 {
349 return ___arch__swab16(*(x));
350 }
351 static __inline__ __attribute__((always_inline)) void __swab16s(__u16 *addr)
352 {
353 do { *(addr) = ___arch__swab16(*((addr))); } while (0);
354 }
355
356 static __inline__ __attribute__((always_inline)) __attribute__((__const__)) __u32 __fswab32(__u32 x)
357 {
358 return ___arch__swahb32(___arch__swahw32(x));
359 }
360 static __inline__ __attribute__((always_inline)) __u32 __swab32p(const __u32 *x)
361 {
362 return ___arch__swahb32(___arch__swahw32(*(x)));
363 }
364 static __inline__ __attribute__((always_inline)) void __swab32s(__u32 *addr)
365 {
366 do { *(addr) = ___arch__swahb32(___arch__swahw32(*((addr)))); } while (0);
367 }
368
369
370 static __inline__ __attribute__((always_inline)) __attribute__((__const__)) __u64 __fswab64(__u64 x)
371 {
372
373 __u32 h = x >> 32;
374 __u32 l = x & ((1ULL<<32)-1);
375 return (((__u64)(__builtin_constant_p((__u32)(l)) ? ({ __u32 __x = ((l)); ((__u32)( (((__u32)(__x) & (__u32)0x000000ffUL) << 24) | (((__u32)(__x) & (__u32)0x0000ff00UL) << 8) | (((__u32)(__x) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); }) : __fswab32((l)))) << 32) | ((__u64)((__builtin_constant_p((__u32)(h)) ? ({ __u32 __x = ((h)); ((__u32)( (((__u32)(__x) & (__u32)0x000000ffUL) << 24) | (((__u32)(__x) & (__u32)0x0000ff00UL) << 8) | (((__u32)(__x) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); }) : __fswab32((h)))));
376
377
378
379 }
380 static __inline__ __attribute__((always_inline)) __u64 __swab64p(const __u64 *x)
381 {
382 return ({ __u64 __tmp = (*(x)) ; ({ __u64 __x = (__tmp); ((__u64)( (__u64)(((__u64)(__x) & (__u64)0x00000000000000ffULL) << 56) | (__u64)(((__u64)(__x) & (__u64)0x000000000000ff00ULL) << 40) | (__u64)(((__u64)(__x) & (__u64)0x0000000000ff0000ULL) << 24) | (__u64)(((__u64)(__x) & (__u64)0x00000000ff000000ULL) << 8) | (__u64)(((__u64)(__x) & (__u64)0x000000ff00000000ULL) >> 8) | (__u64)(((__u64)(__x) & (__u64)0x0000ff0000000000ULL) >> 24) | (__u64)(((__u64)(__x) & (__u64)0x00ff000000000000ULL) >> 40) | (__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56) )); }); });
383 }
384 static __inline__ __attribute__((always_inline)) void __swab64s(__u64 *addr)
385 {
386 do { *(addr) = ({ __u64 __tmp = (*((addr))) ; ({ __u64 __x = (__tmp); ((__u64)( (__u64)(((__u64)(__x) & (__u64)0x00000000000000ffULL) << 56) | (__u64)(((__u64)(__x) & (__u64)0x000000000000ff00ULL) << 40) | (__u64)(((__u64)(__x) & (__u64)0x0000000000ff0000ULL) << 24) | (__u64)(((__u64)(__x) & (__u64)0x00000000ff000000ULL) << 8) | (__u64)(((__u64)(__x) & (__u64)0x000000ff00000000ULL) >> 8) | (__u64)(((__u64)(__x) & (__u64)0x0000ff0000000000ULL) >> 24) | (__u64)(((__u64)(__x) & (__u64)0x00ff000000000000ULL) >> 40) | (__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56) )); }); }); } while (0);
387 }
388 # 13 "include/linux/byteorder/little_endian.h" 2
389 # 43 "include/linux/byteorder/little_endian.h"
390 static inline __attribute__((always_inline)) __le64 __cpu_to_le64p(const __u64 *p)
391 {
392 return ( __le64)*p;
393 }
394 static inline __attribute__((always_inline)) __u64 __le64_to_cpup(const __le64 *p)
395 {
396 return ( __u64)*p;
397 }
398 static inline __attribute__((always_inline)) __le32 __cpu_to_le32p(const __u32 *p)
399 {
400 return ( __le32)*p;
401 }
402 static inline __attribute__((always_inline)) __u32 __le32_to_cpup(const __le32 *p)
403 {
404 return ( __u32)*p;
405 }
406 static inline __attribute__((always_inline)) __le16 __cpu_to_le16p(const __u16 *p)
407 {
408 return ( __le16)*p;
409 }
410 static inline __attribute__((always_inline)) __u16 __le16_to_cpup(const __le16 *p)
411 {
412 return ( __u16)*p;
413 }
414 static inline __attribute__((always_inline)) __be64 __cpu_to_be64p(const __u64 *p)
415 {
416 return ( __be64)__swab64p(p);
417 }
418 static inline __attribute__((always_inline)) __u64 __be64_to_cpup(const __be64 *p)
419 {
420 return __swab64p((__u64 *)p);
421 }
422 static inline __attribute__((always_inline)) __be32 __cpu_to_be32p(const __u32 *p)
423 {
424 return ( __be32)__swab32p(p);
425 }
426 static inline __attribute__((always_inline)) __u32 __be32_to_cpup(const __be32 *p)
427 {
428 return __swab32p((__u32 *)p);
429 }
430 static inline __attribute__((always_inline)) __be16 __cpu_to_be16p(const __u16 *p)
431 {
432 return ( __be16)__swab16p(p);
433 }
434 static inline __attribute__((always_inline)) __u16 __be16_to_cpup(const __be16 *p)
435 {
436 return __swab16p((__u16 *)p);
437 }
438 # 104 "include/linux/byteorder/little_endian.h"
439 # 1 "include/linux/byteorder/generic.h" 1
440 # 154 "include/linux/byteorder/generic.h"
441 extern __u32 ntohl(__be32);
442 extern __be32 htonl(__u32);
443 extern __u16 ntohs(__be16);
444 extern __be16 htons(__u16);
445 # 105 "include/linux/byteorder/little_endian.h" 2
446 # 47 "include/asm/byteorder.h" 2
447 # 10 "include/asm/bitops.h" 2
448 # 1 "include/asm/system.h" 1
449 # 37 "include/asm/system.h"
450 # 1 "include/linux/linkage.h" 1
451
452
453
454 # 1 "include/asm/linkage.h" 1
455 # 5 "include/linux/linkage.h" 2
456 # 38 "include/asm/system.h" 2
457
458
459
460
461
462
463 extern unsigned long irq_flags;
464 # 143 "include/asm/system.h"
465 struct __xchg_dummy {
466 unsigned long a[100];
467 };
468
469
470 static inline __attribute__((always_inline)) unsigned long __xchg(unsigned long x, volatile void *ptr,
471 int size)
472 {
473 unsigned long tmp = 0;
474 unsigned long flags = 0;
475
476 do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0);
477
478 switch (size) {
479 case 1:
480 __asm__ __volatile__
481 ("%0 = b%2 (z);\n\t"
482 "b%2 = %1;\n\t"
483 : "=&d" (tmp) : "d" (x), "m" (*((volatile struct __xchg_dummy *)(ptr))) : "memory");
484 break;
485 case 2:
486 __asm__ __volatile__
487 ("%0 = w%2 (z);\n\t"
488 "w%2 = %1;\n\t"
489 : "=&d" (tmp) : "d" (x), "m" (*((volatile struct __xchg_dummy *)(ptr))) : "memory");
490 break;
491 case 4:
492 __asm__ __volatile__
493 ("%0 = %2;\n\t"
494 "%2 = %1;\n\t"
495 : "=&d" (tmp) : "d" (x), "m" (*((volatile struct __xchg_dummy *)(ptr))) : "memory");
496 break;
497 }
498 do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0);
499 return tmp;
500 }
501
502
503
504
505
506
507 static inline __attribute__((always_inline)) unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
508 unsigned long new, int size)
509 {
510 unsigned long tmp = 0;
511 unsigned long flags = 0;
512
513 do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0);
514
515 switch (size) {
516 case 1:
517 __asm__ __volatile__
518 ("%0 = b%3 (z);\n\t"
519 "CC = %1 == %0;\n\t"
520 "IF !CC JUMP 1f;\n\t"
521 "b%3 = %2;\n\t"
522 "1:\n\t"
523 : "=&d" (tmp) : "d" (old), "d" (new), "m" (*((volatile struct __xchg_dummy *)(ptr))) : "memory");
524 break;
525 case 2:
526 __asm__ __volatile__
527 ("%0 = w%3 (z);\n\t"
528 "CC = %1 == %0;\n\t"
529 "IF !CC JUMP 1f;\n\t"
530 "w%3 = %2;\n\t"
531 "1:\n\t"
532 : "=&d" (tmp) : "d" (old), "d" (new), "m" (*((volatile struct __xchg_dummy *)(ptr))) : "memory");
533 break;
534 case 4:
535 __asm__ __volatile__
536 ("%0 = %3;\n\t"
537 "CC = %1 == %0;\n\t"
538 "IF !CC JUMP 1f;\n\t"
539 "%3 = %2;\n\t"
540 "1:\n\t"
541 : "=&d" (tmp) : "d" (old), "d" (new), "m" (*((volatile struct __xchg_dummy *)(ptr))) : "memory");
542 break;
543 }
544 do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0);
545 return tmp;
546 }
547 # 237 "include/asm/system.h"
548 # 1 "include/asm/blackfin.h" 1
549 # 14 "include/asm/blackfin.h"
550 # 1 "include/asm/mach/blackfin.h" 1
551 # 36 "include/asm/mach/blackfin.h"
552 # 1 "include/asm/mach/bf533.h" 1
553 # 37 "include/asm/mach/blackfin.h" 2
554 # 1 "include/asm/mach/mem_map.h" 1
555 # 38 "include/asm/mach/blackfin.h" 2
556 # 1 "include/asm/mach/defBF532.h" 1
557 # 51 "include/asm/mach/defBF532.h"
558 # 1 "include/asm/mach-common/def_LPBlackfin.h" 1
559 # 34 "include/asm/mach-common/def_LPBlackfin.h"
560 # 1 "include/asm/mach/anomaly.h" 1
561 # 35 "include/asm/mach-common/def_LPBlackfin.h" 2
562 # 52 "include/asm/mach/defBF532.h" 2
563 # 39 "include/asm/mach/blackfin.h" 2
564 # 1 "include/asm/mach/anomaly.h" 1
565 # 40 "include/asm/mach/blackfin.h" 2
566
567
568 # 1 "include/asm/mach/cdefBF532.h" 1
569 # 42 "include/asm/mach/cdefBF532.h"
570 # 1 "include/asm/mach-common/cdef_LPBlackfin.h" 1
571 # 43 "include/asm/mach/cdefBF532.h" 2
572
573 # 1 "include/asm/system.h" 1
574 # 45 "include/asm/mach/cdefBF532.h" 2
575 # 58 "include/asm/mach/cdefBF532.h"
576 static __inline__ __attribute__((always_inline)) void bfin_write_VR_CTL(unsigned int val)
577 {
578 unsigned long flags, iwr;
579
580
581 iwr = ({ unsigned __v; __asm__ __volatile__ ("NOP;\n\t" "%0 = [%1];\n\t" : "=d"(__v) : "a"(0xFFC00124)); __v; });
582
583 ({ __asm__ __volatile__ ("NOP;\n\t" "[%0] = %1;\n\t" : : "a"(0xFFC00124) , "d"((1 << (0))) : "memory");});
584
585 ({ __asm__ __volatile__ ("NOP;\n\t" "w[%0] = %1;\n\t" : : "a"(0xFFC00008) , "d"(val) : "memory");});
586 __builtin_bfin_ssync();
587
588 do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0);
589 asm("IDLE;");
590 do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0);
591 ({ __asm__ __volatile__ ("NOP;\n\t" "[%0] = %1;\n\t" : : "a"(0xFFC00124) , "d"(iwr) : "memory");});
592 }
593 # 43 "include/asm/mach/blackfin.h" 2
594 # 15 "include/asm/blackfin.h" 2
595 # 1 "include/asm/bfin-global.h" 1
596 # 34 "include/asm/bfin-global.h"
597 # 1 "include/asm-generic/sections.h" 1
598
599
600
601
602
603 extern char _text[], _stext[], _etext[];
604 extern char _data[], _sdata[], _edata[];
605 extern char __bss_start[], __bss_stop[];
606 extern char __init_begin[], __init_end[];
607 extern char _sinittext[], _einittext[];
608 extern char _sextratext[] __attribute__((weak));
609 extern char _eextratext[] __attribute__((weak));
610 extern char _end[];
611 extern char __per_cpu_start[], __per_cpu_end[];
612 extern char __kprobes_text_start[], __kprobes_text_end[];
613 extern char __initdata_begin[], __initdata_end[];
614 extern char __start_rodata[], __end_rodata[];
615 # 35 "include/asm/bfin-global.h" 2
616 # 1 "include/asm/ptrace.h" 1
617 # 24 "include/asm/ptrace.h"
618 struct pt_regs {
619 long orig_pc;
620 long ipend;
621 long seqstat;
622 long rete;
623 long retn;
624 long retx;
625 long pc;
626 long rets;
627 long reserved;
628 long astat;
629 long lb1;
630 long lb0;
631 long lt1;
632 long lt0;
633 long lc1;
634 long lc0;
635 long a1w;
636 long a1x;
637 long a0w;
638 long a0x;
639 long b3;
640 long b2;
641 long b1;
642 long b0;
643 long l3;
644 long l2;
645 long l1;
646 long l0;
647 long m3;
648 long m2;
649 long m1;
650 long m0;
651 long i3;
652 long i2;
653 long i1;
654 long i0;
655 long usp;
656 long fp;
657 long p5;
658 long p4;
659 long p3;
660 long p2;
661 long p1;
662 long p0;
663 long r7;
664 long r6;
665 long r5;
666 long r4;
667 long r3;
668 long r2;
669 long r1;
670 long r0;
671 long orig_r0;
672 long orig_p0;
673 long syscfg;
674 };
675 # 99 "include/asm/ptrace.h"
676 extern void show_regs(struct pt_regs *);
677 # 36 "include/asm/bfin-global.h" 2
678 # 1 "include/asm/user.h" 1
679 # 36 "include/asm/user.h"
680 struct user_bfinfp_struct {
681 };
682
683
684
685
686 struct user_regs_struct {
687 long r0, r1, r2, r3, r4, r5, r6, r7;
688 long p0, p1, p2, p3, p4, p5, usp, fp;
689 long i0, i1, i2, i3;
690 long l0, l1, l2, l3;
691 long b0, b1, b2, b3;
692 long m0, m1, m2, m3;
693 long a0w, a1w;
694 long a0x, a1x;
695 unsigned long rets;
696 unsigned long astat;
697 unsigned long pc;
698 unsigned long orig_p0;
699 };
700
701
702
703
704
705 struct user {
706
707
708
709 struct user_regs_struct regs;
710
711
712 unsigned long int u_tsize;
713 unsigned long int u_dsize;
714 unsigned long int u_ssize;
715 unsigned long start_code;
716 unsigned long start_stack;
717
718
719
720 long int signal;
721 int reserved;
722 struct user_regs_struct *u_ar0;
723
724
725 unsigned long magic;
726 char u_comm[32];
727 };
728 # 37 "include/asm/bfin-global.h" 2
729 # 48 "include/asm/bfin-global.h"
730 extern unsigned long get_cclk(void);
731 extern unsigned long get_sclk(void);
732
733 extern void dump_thread(struct pt_regs *regs, struct user *dump);
734 extern void dump_bfin_regs(struct pt_regs *fp, void *retaddr);
735 extern void dump_bfin_trace_buffer(void);
736
737 extern int init_arch_irq(void);
738 extern void bfin_reset(void);
739 extern void _cplb_hdr(void);
740
741 extern void bfin_icache_init(void);
742 extern void bfin_dcache_init(void);
743 extern int read_iloc(void);
744 extern int bfin_console_init(void);
745 extern void lower_to_irq14(void);
746 extern void init_dma(void);
747 extern void program_IAR(void);
748 extern void evt14_softirq(void);
749 extern void asm_do_IRQ(unsigned int irq, struct pt_regs *regs);
750 extern void bfin_gpio_interrupt_setup(int irq, int irq_pfx, int type);
751
752 extern void finish_atomic_sections (struct pt_regs *regs);
753 extern char fixed_code_start;
754 extern char fixed_code_end;
755 extern int atomic_xchg32(void);
756 extern int atomic_cas32(void);
757 extern int atomic_add32(void);
758 extern int atomic_sub32(void);
759 extern int atomic_ior32(void);
760 extern int atomic_and32(void);
761 extern int atomic_xor32(void);
762 extern void sigreturn_stub(void);
763
764 extern void *l1_data_A_sram_alloc(size_t);
765 extern void *l1_data_B_sram_alloc(size_t);
766 extern void *l1_inst_sram_alloc(size_t);
767 extern void *l1_data_sram_alloc(size_t);
768 extern void *l1_data_sram_zalloc(size_t);
769 extern int l1_data_A_sram_free(const void*);
770 extern int l1_data_B_sram_free(const void*);
771 extern int l1_inst_sram_free(const void*);
772 extern int l1_data_sram_free(const void*);
773 extern int sram_free(const void*);
774
775
776
777
778
779 extern void *sram_alloc_with_lsl(size_t, unsigned long);
780 extern int sram_free_with_lsl(const void*);
781
782 extern void led_on(int);
783 extern void led_off(int);
784 extern void led_toggle(int);
785 extern void led_disp_num(int);
786 extern void led_toggle_num(int);
787 extern void init_leds(void);
788
789 extern char *bfin_board_name __attribute__ ((weak));
790 extern unsigned long wall_jiffies;
791 extern unsigned long ipdt_table[];
792 extern unsigned long dpdt_table[];
793 extern unsigned long icplb_table[];
794 extern unsigned long dcplb_table[];
795
796 extern unsigned long ipdt_swapcount_table[];
797 extern unsigned long dpdt_swapcount_table[];
798
799 extern unsigned long table_start, table_end;
800
801 extern u16 _bfin_swrst;
802 extern struct file_operations dpmc_fops;
803 extern char _start;
804 extern unsigned long _ramstart, _ramend, _rambase;
805 extern unsigned long memory_start, memory_end, physical_mem_end;
806 extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[],
807 _ebss_l1[], _l1_lma_start[], _sdata_b_l1[], _ebss_b_l1[];
808 # 16 "include/asm/blackfin.h" 2
809
810
811
812
813
814 static inline __attribute__((always_inline)) void SSYNC (void)
815 {
816 int _tmp;
817 __asm__ __volatile__ ("cli %0;\n\t"
818 "nop;nop;\n\t"
819 "ssync;\n\t"
820 "sti %0;\n\t"
821 :"=d"(_tmp):);
822 }
823 # 55 "include/asm/blackfin.h"
824 static inline __attribute__((always_inline)) void CSYNC (void)
825 {
826 int _tmp;
827 __asm__ __volatile__ ("cli %0;\n\t"
828 "nop;nop;\n\t"
829 "csync;\n\t"
830 "sti %0;\n\t"
831 :"=d"(_tmp):);
832 }
833 # 238 "include/asm/system.h" 2
834
835 struct task_struct *resume(struct task_struct *prev, struct task_struct *next);
836 # 11 "include/asm/bitops.h" 2
837
838
839
840 # 1 "include/asm-generic/bitops/ffs.h" 1
841 # 12 "include/asm-generic/bitops/ffs.h"
842 static inline __attribute__((always_inline)) int ffs(int x)
843 {
844 int r = 1;
845
846 if (!x)
847 return 0;
848 if (!(x & 0xffff)) {
849 x >>= 16;
850 r += 16;
851 }
852 if (!(x & 0xff)) {
853 x >>= 8;
854 r += 8;
855 }
856 if (!(x & 0xf)) {
857 x >>= 4;
858 r += 4;
859 }
860 if (!(x & 3)) {
861 x >>= 2;
862 r += 2;
863 }
864 if (!(x & 1)) {
865 x >>= 1;
866 r += 1;
867 }
868 return r;
869 }
870 # 15 "include/asm/bitops.h" 2
871 # 1 "include/asm-generic/bitops/__ffs.h" 1
872 # 12 "include/asm-generic/bitops/__ffs.h"
873 static inline __attribute__((always_inline)) unsigned long __ffs(unsigned long word)
874 {
875 int num = 0;
876
877
878
879
880
881
882
883 if ((word & 0xffff) == 0) {
884 num += 16;
885 word >>= 16;
886 }
887 if ((word & 0xff) == 0) {
888 num += 8;
889 word >>= 8;
890 }
891 if ((word & 0xf) == 0) {
892 num += 4;
893 word >>= 4;
894 }
895 if ((word & 0x3) == 0) {
896 num += 2;
897 word >>= 2;
898 }
899 if ((word & 0x1) == 0)
900 num += 1;
901 return num;
902 }
903 # 16 "include/asm/bitops.h" 2
904 # 1 "include/asm-generic/bitops/sched.h" 1
905 # 13 "include/asm-generic/bitops/sched.h"
906 static inline __attribute__((always_inline)) int sched_find_first_bit(const unsigned long *b)
907 {
908
909
910
911
912
913
914
915 if (__builtin_expect(!!(b[0]), 0))
916 return __ffs(b[0]);
917 if (__builtin_expect(!!(b[1]), 0))
918 return __ffs(b[1]) + 32;
919 if (__builtin_expect(!!(b[2]), 0))
920 return __ffs(b[2]) + 64;
921 if (b[3])
922 return __ffs(b[3]) + 96;
923 return __ffs(b[4]) + 128;
924
925
926
927 }
928 # 17 "include/asm/bitops.h" 2
929 # 1 "include/asm-generic/bitops/ffz.h" 1
930 # 18 "include/asm/bitops.h" 2
931
932 static __inline__ __attribute__((always_inline)) void set_bit(int nr, volatile unsigned long *addr)
933 {
934 int *a = (int *)addr;
935 int mask;
936 unsigned long flags;
937
938 a += nr >> 5;
939 mask = 1 << (nr & 0x1f);
940 do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0);
941 *a |= mask;
942 do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0);
943 }
944
945 static __inline__ __attribute__((always_inline)) void __set_bit(int nr, volatile unsigned long *addr)
946 {
947 int *a = (int *)addr;
948 int mask;
949
950 a += nr >> 5;
951 mask = 1 << (nr & 0x1f);
952 *a |= mask;
953 }
954
955
956
957
958
959
960
961 static __inline__ __attribute__((always_inline)) void clear_bit(int nr, volatile unsigned long *addr)
962 {
963 int *a = (int *)addr;
964 int mask;
965 unsigned long flags;
966 a += nr >> 5;
967 mask = 1 << (nr & 0x1f);
968 do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0);
969 *a &= ~mask;
970 do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0);
971 }
972
973 static __inline__ __attribute__((always_inline)) void __clear_bit(int nr, volatile unsigned long *addr)
974 {
975 int *a = (int *)addr;
976 int mask;
977
978 a += nr >> 5;
979 mask = 1 << (nr & 0x1f);
980 *a &= ~mask;
981 }
982
983 static __inline__ __attribute__((always_inline)) void change_bit(int nr, volatile unsigned long *addr)
984 {
985 int mask, flags;
986 unsigned long *ADDR = (unsigned long *)addr;
987
988 ADDR += nr >> 5;
989 mask = 1 << (nr & 31);
990 do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0);
991 *ADDR ^= mask;
992 do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0);
993 }
994
995 static __inline__ __attribute__((always_inline)) void __change_bit(int nr, volatile unsigned long *addr)
996 {
997 int mask;
998 unsigned long *ADDR = (unsigned long *)addr;
999
1000 ADDR += nr >> 5;
1001 mask = 1 << (nr & 31);
1002 *ADDR ^= mask;
1003 }
1004
1005 static __inline__ __attribute__((always_inline)) int test_and_set_bit(int nr, void *addr)
1006 {
1007 int mask, retval;
1008 volatile unsigned int *a = (volatile unsigned int *)addr;
1009 unsigned long flags;
1010
1011 a += nr >> 5;
1012 mask = 1 << (nr & 0x1f);
1013 do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0);
1014 retval = (mask & *a) != 0;
1015 *a |= mask;
1016 do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0);
1017
1018 return retval;
1019 }
1020
1021 static __inline__ __attribute__((always_inline)) int __test_and_set_bit(int nr, volatile unsigned long *addr)
1022 {
1023 int mask, retval;
1024 volatile unsigned int *a = (volatile unsigned int *)addr;
1025
1026 a += nr >> 5;
1027 mask = 1 << (nr & 0x1f);
1028 retval = (mask & *a) != 0;
1029 *a |= mask;
1030 return retval;
1031 }
1032
1033 static __inline__ __attribute__((always_inline)) int test_and_clear_bit(int nr, volatile unsigned long *addr)
1034 {
1035 int mask, retval;
1036 volatile unsigned int *a = (volatile unsigned int *)addr;
1037 unsigned long flags;
1038
1039 a += nr >> 5;
1040 mask = 1 << (nr & 0x1f);
1041 do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0);
1042 retval = (mask & *a) != 0;
1043 *a &= ~mask;
1044 do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0);
1045
1046 return retval;
1047 }
1048
1049 static __inline__ __attribute__((always_inline)) int __test_and_clear_bit(int nr, volatile unsigned long *addr)
1050 {
1051 int mask, retval;
1052 volatile unsigned int *a = (volatile unsigned int *)addr;
1053
1054 a += nr >> 5;
1055 mask = 1 << (nr & 0x1f);
1056 retval = (mask & *a) != 0;
1057 *a &= ~mask;
1058 return retval;
1059 }
1060
1061 static __inline__ __attribute__((always_inline)) int test_and_change_bit(int nr, volatile unsigned long *addr)
1062 {
1063 int mask, retval;
1064 volatile unsigned int *a = (volatile unsigned int *)addr;
1065 unsigned long flags;
1066
1067 a += nr >> 5;
1068 mask = 1 << (nr & 0x1f);
1069 do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0);
1070 retval = (mask & *a) != 0;
1071 *a ^= mask;
1072 do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0);
1073 return retval;
1074 }
1075
1076 static __inline__ __attribute__((always_inline)) int __test_and_change_bit(int nr,
1077 volatile unsigned long *addr)
1078 {
1079 int mask, retval;
1080 volatile unsigned int *a = (volatile unsigned int *)addr;
1081
1082 a += nr >> 5;
1083 mask = 1 << (nr & 0x1f);
1084 retval = (mask & *a) != 0;
1085 *a ^= mask;
1086 return retval;
1087 }
1088
1089
1090
1091
1092 static __inline__ __attribute__((always_inline)) int __constant_test_bit(int nr, const void *addr)
1093 {
1094 return ((1UL << (nr & 31)) &
1095 (((const volatile unsigned int *)addr)[nr >> 5])) != 0;
1096 }
1097
1098 static __inline__ __attribute__((always_inline)) int __test_bit(int nr, const void *addr)
1099 {
1100 int *a = (int *)addr;
1101 int mask;
1102
1103 a += nr >> 5;
1104 mask = 1 << (nr & 0x1f);
1105 return ((mask & *a) != 0);
1106 }
1107
1108
1109
1110
1111
1112
1113 # 1 "include/asm-generic/bitops/find.h" 1
1114
1115
1116
1117 extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
1118 size, unsigned long offset);
1119
1120 extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
1121 long size, unsigned long offset);
1122 # 201 "include/asm/bitops.h" 2
1123 # 1 "include/asm-generic/bitops/hweight.h" 1
1124
1125
1126
1127
1128
1129 extern unsigned int hweight32(unsigned int w);
1130 extern unsigned int hweight16(unsigned int w);
1131 extern unsigned int hweight8(unsigned int w);
1132 extern unsigned long hweight64(__u64 w);
1133 # 202 "include/asm/bitops.h" 2
1134
1135 # 1 "include/asm-generic/bitops/ext2-atomic.h" 1
1136 # 204 "include/asm/bitops.h" 2
1137 # 1 "include/asm-generic/bitops/ext2-non-atomic.h" 1
1138
1139
1140
1141 # 1 "include/asm-generic/bitops/le.h" 1
1142 # 5 "include/asm-generic/bitops/ext2-non-atomic.h" 2
1143 # 205 "include/asm/bitops.h" 2
1144
1145 # 1 "include/asm-generic/bitops/minix.h" 1
1146 # 207 "include/asm/bitops.h" 2
1147
1148
1149
1150 # 1 "include/asm-generic/bitops/fls.h" 1
1151 # 12 "include/asm-generic/bitops/fls.h"
1152 static inline __attribute__((always_inline)) int fls(int x)
1153 {
1154 int r = 32;
1155
1156 if (!x)
1157 return 0;
1158 if (!(x & 0xffff0000u)) {
1159 x <<= 16;
1160 r -= 16;
1161 }
1162 if (!(x & 0xff000000u)) {
1163 x <<= 8;
1164 r -= 8;
1165 }
1166 if (!(x & 0xf0000000u)) {
1167 x <<= 4;
1168 r -= 4;
1169 }
1170 if (!(x & 0xc0000000u)) {
1171 x <<= 2;
1172 r -= 2;
1173 }
1174 if (!(x & 0x80000000u)) {
1175 x <<= 1;
1176 r -= 1;
1177 }
1178 return r;
1179 }
1180 # 211 "include/asm/bitops.h" 2
1181 # 1 "include/asm-generic/bitops/fls64.h" 1
1182
1183
1184
1185
1186
1187 static inline __attribute__((always_inline)) int fls64(__u64 x)
1188 {
1189 __u32 h = x >> 32;
1190 if (h)
1191 return fls(h) + 32;
1192 return fls(x);
1193 }
1194 # 212 "include/asm/bitops.h" 2
1195 # 10 "include/linux/bitops.h" 2
1196
1197 static __inline__ __attribute__((always_inline)) int get_bitmask_order(unsigned int count)
1198 {
1199 int order;
1200
1201 order = fls(count);
1202 return order;
1203 }
1204
1205 static __inline__ __attribute__((always_inline)) int get_count_order(unsigned int count)
1206 {
1207 int order;
1208
1209 order = fls(count) - 1;
1210 if (count & (count - 1))
1211 order++;
1212 return order;
1213 }
1214
1215 static inline __attribute__((always_inline)) unsigned long hweight_long(unsigned long w)
1216 {
1217 return sizeof(w) == 4 ? hweight32(w) : hweight64(w);
1218 }
1219
1220
1221
1222
1223
1224
1225 static inline __attribute__((always_inline)) __u32 rol32(__u32 word, unsigned int shift)
1226 {
1227 return (word << shift) | (word >> (32 - shift));
1228 }
1229
1230
1231
1232
1233
1234
1235 static inline __attribute__((always_inline)) __u32 ror32(__u32 word, unsigned int shift)
1236 {
1237 return (word >> shift) | (word << (32 - shift));
1238 }
1239
1240 static inline __attribute__((always_inline)) unsigned fls_long(unsigned long l)
1241 {
1242 if (sizeof(l) == 4)
1243 return fls(l);
1244 return fls64(l);
1245 }
1246 # 21 "include/linux/thread_info.h" 2
1247 # 1 "include/asm/thread_info.h" 1
1248 # 30 "include/asm/thread_info.h"
1249 # 1 "include/asm/page.h" 1
1250 # 12 "include/asm/page.h"
1251 # 1 "include/asm/setup.h" 1
1252 # 13 "include/asm/page.h" 2
1253 # 28 "include/asm/page.h"
1254 typedef struct {
1255 unsigned long pte;
1256 } pte_t;
1257 typedef struct {
1258 unsigned long pmd[16];
1259 } pmd_t;
1260 typedef struct {
1261 unsigned long pgd;
1262 } pgd_t;
1263 typedef struct {
1264 unsigned long pgprot;
1265 } pgprot_t;
1266 # 54 "include/asm/page.h"
1267 extern unsigned long memory_start;
1268 extern unsigned long memory_end;
1269
1270
1271
1272 # 1 "include/asm/page_offset.h" 1
1273 # 60 "include/asm/page.h" 2
1274 # 1 "include/asm/io.h" 1
1275 # 23 "include/asm/io.h"
1276 static inline __attribute__((always_inline)) unsigned char readb(const volatile void *addr)
1277 {
1278 unsigned int val;
1279 int tmp;
1280
1281 __asm__ __volatile__ ("cli %1;\n\t"
1282 "NOP; NOP; SSYNC;\n\t"
1283 "%0 = b [%2] (z);\n\t"
1284 "sti %1;\n\t"
1285 : "=d"(val), "=d"(tmp): "a"(addr)
1286 );
1287
1288 return (unsigned char) val;
1289 }
1290
1291 static inline __attribute__((always_inline)) unsigned short readw(const volatile void *addr)
1292 {
1293 unsigned int val;
1294 int tmp;
1295
1296 __asm__ __volatile__ ("cli %1;\n\t"
1297 "NOP; NOP; SSYNC;\n\t"
1298 "%0 = w [%2] (z);\n\t"
1299 "sti %1;\n\t"
1300 : "=d"(val), "=d"(tmp): "a"(addr)
1301 );
1302
1303 return (unsigned short) val;
1304 }
1305
1306 static inline __attribute__((always_inline)) unsigned int readl(const volatile void *addr)
1307 {
1308 unsigned int val;
1309 int tmp;
1310
1311 __asm__ __volatile__ ("cli %1;\n\t"
1312 "NOP; NOP; SSYNC;\n\t"
1313 "%0 = [%2];\n\t"
1314 "sti %1;\n\t"
1315 : "=d"(val), "=d"(tmp): "a"(addr)
1316 );
1317 return val;
1318 }
1319 # 118 "include/asm/io.h"
1320 extern void outsb(void *port, const void *addr, unsigned short count);
1321 extern void outsw(void *port, const void *addr, unsigned short count);
1322 extern void outsl(void *port, const void *addr, unsigned short count);
1323
1324 extern void insb(const void *port, void *addr, unsigned short count);
1325 extern void insw(const void *port, void *addr, unsigned short count);
1326 extern void insl(const void *port, void *addr, unsigned short count);
1327
1328 extern void dma_outsb(void *port, const void *addr, unsigned short count);
1329 extern void dma_outsw(void *port, const void *addr, unsigned short count);
1330 extern void dma_outsl(void *port, const void *addr, unsigned short count);
1331
1332 extern void dma_insb(const void *port, void *addr, unsigned short count);
1333 extern void dma_insw(const void *port, void *addr, unsigned short count);
1334 extern void dma_insl(const void *port, void *addr, unsigned short count);
1335
1336
1337
1338
1339 static inline __attribute__((always_inline)) void *__ioremap(unsigned long physaddr, unsigned long size,
1340 int cacheflag)
1341 {
1342 return (void *)physaddr;
1343 }
1344
1345
1346
1347
1348 static inline __attribute__((always_inline)) void iounmap(void *addr)
1349 {
1350 }
1351
1352
1353
1354
1355
1356
1357 static inline __attribute__((always_inline)) void __iounmap(void *addr, unsigned long size)
1358 {
1359 }
1360
1361
1362
1363
1364
1365
1366 static inline __attribute__((always_inline)) void kernel_set_cachemode(void *addr, unsigned long size,
1367 int cmode)
1368 {
1369 }
1370
1371 static inline __attribute__((always_inline)) void *ioremap(unsigned long physaddr, unsigned long size)
1372 {
1373 return __ioremap(physaddr, size, 1);
1374 }
1375 static inline __attribute__((always_inline)) void *ioremap_nocache(unsigned long physaddr,
1376 unsigned long size)
1377 {
1378 return __ioremap(physaddr, size, 1);
1379 }
1380
1381 extern void blkfin_inv_cache_all(void);
1382 # 61 "include/asm/page.h" 2
1383 # 84 "include/asm/page.h"
1384 # 1 "include/asm-generic/page.h" 1
1385 # 10 "include/asm-generic/page.h"
1386 static __inline__ __attribute__((always_inline)) __attribute__((__const__)) int get_order(unsigned long size)
1387 {
1388 int order;
1389
1390 size = (size - 1) >> (12 - 1);
1391 order = -1;
1392 do {
1393 size >>= 1;
1394 order++;
1395 } while (size);
1396 return order;
1397 }
1398 # 85 "include/asm/page.h" 2
1399 # 31 "include/asm/thread_info.h" 2
1400 # 1 "include/asm/entry.h" 1
1401 # 32 "include/asm/thread_info.h" 2
1402 # 1 "include/asm/l1layout.h" 1
1403 # 16 "include/asm/l1layout.h"
1404 struct l1_scratch_task_info
1405 {
1406
1407 void *stack_start;
1408
1409
1410
1411 void *lowest_sp;
1412 };
1413 # 33 "include/asm/thread_info.h" 2
1414 # 44 "include/asm/thread_info.h"
1415 typedef unsigned long mm_segment_t;
1416
1417
1418
1419
1420
1421
1422 struct thread_info {
1423 struct task_struct *task;
1424 struct exec_domain *exec_domain;
1425 unsigned long flags;
1426 int cpu;
1427 int preempt_count;
1428 mm_segment_t addr_limit;
1429 struct restart_block restart_block;
1430 struct l1_scratch_task_info l1_task_info;
1431 };
1432 # 86 "include/asm/thread_info.h"
1433 static inline __attribute__((always_inline)) struct thread_info *current_thread_info(void)
1434 __attribute__ ((__const__));
1435
1436
1437
1438
1439 static inline __attribute__((always_inline)) struct thread_info *current_thread_info(void)
1440 {
1441 struct thread_info *ti;
1442 __asm__("%0 = sp;": "=&d"(ti):
1443 );
1444 return (struct thread_info *)((long)ti & ~8191UL);
1445 }
1446 # 22 "include/linux/thread_info.h" 2
1447 # 30 "include/linux/thread_info.h"
1448 static inline __attribute__((always_inline)) void set_ti_thread_flag(struct thread_info *ti, int flag)
1449 {
1450 set_bit(flag,&ti->flags);
1451 }
1452
1453 static inline __attribute__((always_inline)) void clear_ti_thread_flag(struct thread_info *ti, int flag)
1454 {
1455 clear_bit(flag,&ti->flags);
1456 }
1457
1458 static inline __attribute__((always_inline)) int test_and_set_ti_thread_flag(struct thread_info *ti, int flag)
1459 {
1460 return test_and_set_bit(flag,&ti->flags);
1461 }
1462
1463 static inline __attribute__((always_inline)) int test_and_clear_ti_thread_flag(struct thread_info *ti, int flag)
1464 {
1465 return test_and_clear_bit(flag,&ti->flags);
1466 }
1467
1468 static inline __attribute__((always_inline)) int test_ti_thread_flag(struct thread_info *ti, int flag)
1469 {
1470 return (__builtin_constant_p(flag) ? __constant_test_bit((flag),(&ti->flags)) : __test_bit((flag),(&ti->flags)));
1471 }
1472 # 10 "include/linux/preempt.h" 2
1473 # 50 "include/linux/spinlock.h" 2
1474
1475
1476
1477 # 1 "include/linux/kernel.h" 1
1478 # 10 "include/linux/kernel.h"
1479 # 1 "/usr/local/src/blackfin/toolchains/20070613/out-uclinux/lib/gcc/bfin-uclinux/4.1.2/include/stdarg.h" 1 3 4
1480 # 43 "/usr/local/src/blackfin/toolchains/20070613/out-uclinux/lib/gcc/bfin-uclinux/4.1.2/include/stdarg.h" 3 4
1481 typedef __builtin_va_list __gnuc_va_list;
1482 # 105 "/usr/local/src/blackfin/toolchains/20070613/out-uclinux/lib/gcc/bfin-uclinux/4.1.2/include/stdarg.h" 3 4
1483 typedef __gnuc_va_list va_list;
1484 # 11 "include/linux/kernel.h" 2
1485
1486
1487
1488
1489
1490 # 1 "include/linux/log2.h" 1
1491 # 21 "include/linux/log2.h"
1492 extern __attribute__((const, noreturn))
1493 int ____ilog2_NaN(void);
1494 # 31 "include/linux/log2.h"
1495 static inline __attribute__((always_inline)) __attribute__((const))
1496 int __ilog2_u32(u32 n)
1497 {
1498 return fls(n) - 1;
1499 }
1500
1501
1502
1503 static inline __attribute__((always_inline)) __attribute__((const))
1504 int __ilog2_u64(u64 n)
1505 {
1506 return fls64(n) - 1;
1507 }
1508
1509
1510
1511
1512
1513
1514
1515 static inline __attribute__((always_inline)) __attribute__((const))
1516 bool is_power_of_2(unsigned long n)
1517 {
1518 return (n != 0 && ((n & (n - 1)) == 0));
1519 }
1520
1521
1522
1523
1524 static inline __attribute__((always_inline)) __attribute__((const))
1525 unsigned long __roundup_pow_of_two(unsigned long n)
1526 {
1527 return 1UL << fls_long(n - 1);
1528 }
1529 # 17 "include/linux/kernel.h" 2
1530
1531 # 1 "include/asm/bug.h" 1
1532
1533
1534 # 1 "include/asm-generic/bug.h" 1
1535 # 4 "include/asm/bug.h" 2
1536 # 19 "include/linux/kernel.h" 2
1537
1538 extern const char linux_banner[];
1539 extern const char linux_proc_banner[];
1540 # 52 "include/linux/kernel.h"
1541 extern int console_printk[];
1542
1543
1544
1545
1546
1547
1548 struct completion;
1549 struct pt_regs;
1550 struct user;
1551 # 74 "include/linux/kernel.h"
1552 extern int cond_resched(void);
1553 # 95 "include/linux/kernel.h"
1554 extern struct atomic_notifier_head panic_notifier_list;
1555 extern long (*panic_blink)(long time);
1556 void panic(const char * fmt, ...)
1557 __attribute__ ((noreturn, format (printf, 1, 2)));
1558 extern void oops_enter(void);
1559 extern void oops_exit(void);
1560 extern int oops_may_print(void);
1561 void do_exit(long error_code)
1562 __attribute__((noreturn));
1563 void complete_and_exit(struct completion *, long)
1564 __attribute__((noreturn));
1565 extern unsigned long simple_strtoul(const char *,char **,unsigned int);
1566 extern long simple_strtol(const char *,char **,unsigned int);
1567 extern unsigned long long simple_strtoull(const char *,char **,unsigned int);
1568 extern long long simple_strtoll(const char *,char **,unsigned int);
1569 extern int sprintf(char * buf, const char * fmt, ...)
1570 __attribute__ ((format (printf, 2, 3)));
1571 extern int vsprintf(char *buf, const char *, va_list)
1572 __attribute__ ((format (printf, 2, 0)));
1573 extern int snprintf(char * buf, size_t size, const char * fmt, ...)
1574 __attribute__ ((format (printf, 3, 4)));
1575 extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
1576 __attribute__ ((format (printf, 3, 0)));
1577 extern int scnprintf(char * buf, size_t size, const char * fmt, ...)
1578 __attribute__ ((format (printf, 3, 4)));
1579 extern int vscnprintf(char *buf, size_t size, const char *fmt, va_list args)
1580 __attribute__ ((format (printf, 3, 0)));
1581 extern char *kasprintf(gfp_t gfp, const char *fmt, ...)
1582 __attribute__ ((format (printf, 2, 3)));
1583
1584 extern int sscanf(const char *, const char *, ...)
1585 __attribute__ ((format (scanf, 2, 3)));
1586 extern int vsscanf(const char *, const char *, va_list)
1587 __attribute__ ((format (scanf, 2, 0)));
1588
1589 extern int get_option(char **str, int *pint);
1590 extern char *get_options(const char *str, int nints, int *ints);
1591 extern unsigned long long memparse(char *ptr, char **retptr);
1592
1593 extern int core_kernel_text(unsigned long addr);
1594 extern int __kernel_text_address(unsigned long addr);
1595 extern int kernel_text_address(unsigned long addr);
1596 struct pid;
1597 extern struct pid *session_of_pgrp(struct pid *pgrp);
1598
1599 extern void dump_thread(struct pt_regs *regs, struct user *dump);
1600
1601
1602 int vprintk(const char *fmt, va_list args)
1603 __attribute__ ((format (printf, 1, 0)));
1604 int printk(const char * fmt, ...)
1605 __attribute__ ((format (printf, 1, 2)));
1606 # 156 "include/linux/kernel.h"
1607 unsigned long int_sqrt(unsigned long);
1608
1609 extern int printk_ratelimit(void);
1610 extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst);
1611 extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
1612 unsigned int interval_msec);
1613
1614 static inline __attribute__((always_inline)) void console_silent(void)
1615 {
1616 (console_printk[0]) = 0;
1617 }
1618
1619 static inline __attribute__((always_inline)) void console_verbose(void)
1620 {
1621 if ((console_printk[0]))
1622 (console_printk[0]) = 15;
1623 }
1624
1625 extern void bust_spinlocks(int yes);
1626 extern void wake_up_klogd(void);
1627 extern int oops_in_progress;
1628 extern int panic_timeout;
1629 extern int panic_on_oops;
1630 extern int panic_on_unrecovered_nmi;
1631 extern int tainted;
1632 extern const char *print_tainted(void);
1633 extern void add_taint(unsigned);
1634
1635
1636 extern enum system_states {
1637 SYSTEM_BOOTING,
1638 SYSTEM_RUNNING,
1639 SYSTEM_HALT,
1640 SYSTEM_POWER_OFF,
1641 SYSTEM_RESTART,
1642 SYSTEM_SUSPEND_DISK,
1643 } system_state;
1644 # 202 "include/linux/kernel.h"
1645 extern void dump_stack(void);
1646
1647
1648
1649
1650
1651
1652 static inline __attribute__((always_inline)) int __attribute__ ((format (printf, 1, 2))) pr_debug(const char * fmt, ...)
1653 {
1654 return 0;
1655 }
1656 # 313 "include/linux/kernel.h"
1657 struct sysinfo;
1658 extern int do_sysinfo(struct sysinfo *info);
1659
1660
1661
1662
1663 struct sysinfo {
1664 long uptime;
1665 unsigned long loads[3];
1666 unsigned long totalram;
1667 unsigned long freeram;
1668 unsigned long sharedram;
1669 unsigned long bufferram;
1670 unsigned long totalswap;
1671 unsigned long freeswap;
1672 unsigned short procs;
1673 unsigned short pad;
1674 unsigned long totalhigh;
1675 unsigned long freehigh;
1676 unsigned int mem_unit;
1677 char _f[20-2*sizeof(long)-sizeof(int)];
1678 };
1679 # 54 "include/linux/spinlock.h" 2
1680 # 1 "include/linux/stringify.h" 1
1681 # 55 "include/linux/spinlock.h" 2
1682 # 1 "include/linux/bottom_half.h" 1
1683
1684
1685
1686 extern void local_bh_disable(void);
1687 extern void __local_bh_enable(void);
1688 extern void _local_bh_enable(void);
1689 extern void local_bh_enable(void);
1690 extern void local_bh_enable_ip(unsigned long ip);
1691 # 56 "include/linux/spinlock.h" 2
1692 # 79 "include/linux/spinlock.h"
1693 # 1 "include/linux/spinlock_types.h" 1
1694 # 12 "include/linux/spinlock_types.h"
1695 # 1 "include/linux/lockdep.h" 1
1696 # 11 "include/linux/lockdep.h"
1697 struct task_struct;
1698 # 252 "include/linux/lockdep.h"
1699 static inline __attribute__((always_inline)) void lockdep_off(void)
1700 {
1701 }
1702
1703 static inline __attribute__((always_inline)) void lockdep_on(void)
1704 {
1705 }
1706 # 278 "include/linux/lockdep.h"
1707 struct lock_class_key { };
1708 # 287 "include/linux/lockdep.h"
1709 static inline __attribute__((always_inline)) void early_init_irq_lock_class(void)
1710 {
1711 }
1712
1713
1714
1715
1716
1717
1718
1719 static inline __attribute__((always_inline)) void early_boot_irqs_off(void)
1720 {
1721 }
1722 static inline __attribute__((always_inline)) void early_boot_irqs_on(void)
1723 {
1724 }
1725 static inline __attribute__((always_inline)) void print_irqtrace_events(struct task_struct *curr)
1726 {
1727 }
1728 # 13 "include/linux/spinlock_types.h" 2
1729
1730
1731
1732
1733 # 1 "include/linux/spinlock_types_up.h" 1
1734 # 29 "include/linux/spinlock_types_up.h"
1735 typedef struct { } raw_spinlock_t;
1736
1737
1738
1739
1740
1741 typedef struct {
1742
1743
1744
1745
1746 } raw_rwlock_t;
1747 # 18 "include/linux/spinlock_types.h" 2
1748
1749
1750 typedef struct {
1751 raw_spinlock_t raw_lock;
1752 # 32 "include/linux/spinlock_types.h"
1753 } spinlock_t;
1754
1755
1756
1757 typedef struct {
1758 raw_rwlock_t raw_lock;
1759 # 48 "include/linux/spinlock_types.h"
1760 } rwlock_t;
1761 # 80 "include/linux/spinlock.h" 2
1762
1763 extern int __attribute__((section(".spinlock.text"))) generic__raw_read_trylock(raw_rwlock_t *lock);
1764
1765
1766
1767
1768
1769
1770
1771 # 1 "include/linux/spinlock_up.h" 1
1772 # 90 "include/linux/spinlock.h" 2
1773 # 135 "include/linux/spinlock.h"
1774 # 1 "include/linux/spinlock_api_up.h" 1
1775 # 136 "include/linux/spinlock.h" 2
1776 # 289 "include/linux/spinlock.h"
1777 static inline __attribute__((always_inline)) void double_spin_lock(spinlock_t *l1, spinlock_t *l2,
1778 bool l1_first)
1779
1780
1781 {
1782 if (l1_first) {
1783 do { do { } while (0); (void)0; (void)(l1); } while (0);
1784 do { do { } while (0); (void)0; (void)(l2); } while (0);
1785 } else {
1786 do { do { } while (0); (void)0; (void)(l2); } while (0);
1787 do { do { } while (0); (void)0; (void)(l1); } while (0);
1788 }
1789 }
1790
1791
1792
1793
1794
1795
1796 static inline __attribute__((always_inline)) void double_spin_unlock(spinlock_t *l1, spinlock_t *l2,
1797 bool l1_taken_first)
1798
1799
1800 {
1801 if (l1_taken_first) {
1802 do { do { } while (0); (void)0; (void)(l2); } while (0);
1803 do { do { } while (0); (void)0; (void)(l1); } while (0);
1804 } else {
1805 do { do { } while (0); (void)0; (void)(l1); } while (0);
1806 do { do { } while (0); (void)0; (void)(l2); } while (0);
1807 }
1808 }
1809
1810
1811
1812
1813
1814 # 1 "include/asm/atomic.h" 1
1815 # 16 "include/asm/atomic.h"
1816 typedef struct {
1817 int counter;
1818 } atomic_t;
1819
1820
1821
1822
1823
1824 static __inline__ __attribute__((always_inline)) void atomic_add(int i, atomic_t * v)
1825 {
1826 long flags;
1827
1828 do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0);
1829 v->counter += i;
1830 do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0);
1831 }
1832
1833 static __inline__ __attribute__((always_inline)) void atomic_sub(int i, atomic_t * v)
1834 {
1835 long flags;
1836
1837 do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0);
1838 v->counter -= i;
1839 do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0);
1840
1841 }
1842
1843 static inline __attribute__((always_inline)) int atomic_add_return(int i, atomic_t * v)
1844 {
1845 int __temp = 0;
1846 long flags;
1847
1848 do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0);
1849 v->counter += i;
1850 __temp = v->counter;
1851 do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0);
1852
1853
1854 return __temp;
1855 }
1856
1857
1858 static inline __attribute__((always_inline)) int atomic_sub_return(int i, atomic_t * v)
1859 {
1860 int __temp = 0;
1861 long flags;
1862
1863 do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0);
1864 v->counter -= i;
1865 __temp = v->counter;
1866 do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0);
1867
1868 return __temp;
1869 }
1870
1871 static __inline__ __attribute__((always_inline)) void atomic_inc(volatile atomic_t * v)
1872 {
1873 long flags;
1874
1875 do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0);
1876 v->counter++;
1877 do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0);
1878 }
1879 # 93 "include/asm/atomic.h"
1880 static __inline__ __attribute__((always_inline)) void atomic_dec(volatile atomic_t * v)
1881 {
1882 long flags;
1883
1884 do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0);
1885 v->counter--;
1886 do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0);
1887 }
1888
1889 static __inline__ __attribute__((always_inline)) void atomic_clear_mask(unsigned int mask, atomic_t * v)
1890 {
1891 long flags;
1892
1893 do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0);
1894 v->counter &= ~mask;
1895 do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0);
1896 }
1897
1898 static __inline__ __attribute__((always_inline)) void atomic_set_mask(unsigned int mask, atomic_t * v)
1899 {
1900 long flags;
1901
1902 do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0);
1903 v->counter |= mask;
1904 do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0);
1905 }
1906 # 142 "include/asm/atomic.h"
1907 # 1 "include/asm-generic/atomic.h" 1
1908 # 71 "include/asm-generic/atomic.h"
1909 typedef atomic_t atomic_long_t;
1910
1911
1912 static inline __attribute__((always_inline)) long atomic_long_read(atomic_long_t *l)
1913 {
1914 atomic_t *v = (atomic_t *)l;
1915
1916 return (long)((v)->counter);
1917 }
1918
1919 static inline __attribute__((always_inline)) void atomic_long_set(atomic_long_t *l, long i)
1920 {
1921 atomic_t *v = (atomic_t *)l;
1922
1923 (((v)->counter) = i);
1924 }
1925
1926 static inline __attribute__((always_inline)) void atomic_long_inc(atomic_long_t *l)
1927 {
1928 atomic_t *v = (atomic_t *)l;
1929
1930 atomic_inc(v);
1931 }
1932
1933 static inline __attribute__((always_inline)) void atomic_long_dec(atomic_long_t *l)
1934 {
1935 atomic_t *v = (atomic_t *)l;
1936
1937 atomic_dec(v);
1938 }
1939
1940 static inline __attribute__((always_inline)) void atomic_long_add(long i, atomic_long_t *l)
1941 {
1942 atomic_t *v = (atomic_t *)l;
1943
1944 atomic_add(i, v);
1945 }
1946
1947 static inline __attribute__((always_inline)) void atomic_long_sub(long i, atomic_long_t *l)
1948 {
1949 atomic_t *v = (atomic_t *)l;
1950
1951 atomic_sub(i, v);
1952 }
1953 # 143 "include/asm/atomic.h" 2
1954 # 327 "include/linux/spinlock.h" 2
1955
1956
1957
1958
1959
1960 extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock);
1961 # 46 "include/linux/capability.h" 2
1962 # 1 "include/asm/current.h" 1
1963 # 13 "include/asm/current.h"
1964 struct task_struct;
1965
1966 static inline __attribute__((always_inline)) struct task_struct *get_current(void) __attribute__ ((__const__));
1967 static inline __attribute__((always_inline)) struct task_struct *get_current(void)
1968 {
1969 return (current_thread_info()->task);
1970 }
1971 # 47 "include/linux/capability.h" 2
1972 # 58 "include/linux/capability.h"
1973 typedef __u32 kernel_cap_t;
1974 # 295 "include/linux/capability.h"
1975 extern kernel_cap_t cap_bset;
1976 # 323 "include/linux/capability.h"
1977 static inline __attribute__((always_inline)) kernel_cap_t cap_combine(kernel_cap_t a, kernel_cap_t b)
1978 {
1979 kernel_cap_t dest;
1980 (dest) = (a) | (b);
1981 return dest;
1982 }
1983
1984 static inline __attribute__((always_inline)) kernel_cap_t cap_intersect(kernel_cap_t a, kernel_cap_t b)
1985 {
1986 kernel_cap_t dest;
1987 (dest) = (a) & (b);
1988 return dest;
1989 }
1990
1991 static inline __attribute__((always_inline)) kernel_cap_t cap_drop(kernel_cap_t a, kernel_cap_t drop)
1992 {
1993 kernel_cap_t dest;
1994 (dest) = (a) & ~(drop);
1995 return dest;
1996 }
1997
1998 static inline __attribute__((always_inline)) kernel_cap_t cap_invert(kernel_cap_t c)
1999 {
2000 kernel_cap_t dest;
2001 (dest) = ~(c);
2002 return dest;
2003 }
2004 # 360 "include/linux/capability.h"
2005 int capable(int cap);
2006 int __capable(struct task_struct *t, int cap);
2007 # 47 "include/linux/sched.h" 2
2008 # 1 "include/linux/threads.h" 1
2009 # 48 "include/linux/sched.h" 2
2010
2011
2012 # 1 "include/linux/timex.h" 1
2013 # 57 "include/linux/timex.h"
2014 # 1 "include/linux/time.h" 1
2015
2016
2017
2018
2019
2020
2021 # 1 "include/linux/seqlock.h" 1
2022 # 32 "include/linux/seqlock.h"
2023 typedef struct {
2024 unsigned sequence;
2025 spinlock_t lock;
2026 } seqlock_t;
2027 # 60 "include/linux/seqlock.h"
2028 static inline __attribute__((always_inline)) void write_seqlock(seqlock_t *sl)
2029 {
2030 do { do { } while (0); (void)0; (void)(&sl->lock); } while (0);
2031 ++sl->sequence;
2032 __asm__ __volatile__("": : :"memory");
2033 }
2034
2035 static inline __attribute__((always_inline)) void write_sequnlock(seqlock_t *sl)
2036 {
2037 __asm__ __volatile__("": : :"memory");
2038 sl->sequence++;
2039 do { do { } while (0); (void)0; (void)(&sl->lock); } while (0);
2040 }
2041
2042 static inline __attribute__((always_inline)) int write_tryseqlock(seqlock_t *sl)
2043 {
2044 int ret = (({ do { do { } while (0); (void)0; (void)(&sl->lock); } while (0); 1; }));
2045
2046 if (ret) {
2047 ++sl->sequence;
2048 __asm__ __volatile__("": : :"memory");
2049 }
2050 return ret;
2051 }
2052
2053
2054 static inline __attribute__((always_inline)) __attribute__((always_inline)) unsigned read_seqbegin(const seqlock_t *sl)
2055 {
2056 unsigned ret = sl->sequence;
2057 __asm__ __volatile__("": : :"memory");
2058 return ret;
2059 }
2060 # 101 "include/linux/seqlock.h"
2061 static inline __attribute__((always_inline)) __attribute__((always_inline)) int read_seqretry(const seqlock_t *sl, unsigned iv)
2062 {
2063 __asm__ __volatile__("": : :"memory");
2064 return (iv & 1) | (sl->sequence ^ iv);
2065 }
2066 # 115 "include/linux/seqlock.h"
2067 typedef struct seqcount {
2068 unsigned sequence;
2069 } seqcount_t;
2070
2071
2072
2073
2074
2075 static inline __attribute__((always_inline)) unsigned read_seqcount_begin(const seqcount_t *s)
2076 {
2077 unsigned ret = s->sequence;
2078 __asm__ __volatile__("": : :"memory");
2079 return ret;
2080 }
2081
2082
2083
2084
2085
2086
2087 static inline __attribute__((always_inline)) int read_seqcount_retry(const seqcount_t *s, unsigned iv)
2088 {
2089 __asm__ __volatile__("": : :"memory");
2090 return (iv & 1) | (s->sequence ^ iv);
2091 }
2092
2093
2094
2095
2096
2097
2098 static inline __attribute__((always_inline)) void write_seqcount_begin(seqcount_t *s)
2099 {
2100 s->sequence++;
2101 __asm__ __volatile__("": : :"memory");
2102 }
2103
2104 static inline __attribute__((always_inline)) void write_seqcount_end(seqcount_t *s)
2105 {
2106 __asm__ __volatile__("": : :"memory");
2107 s->sequence++;
2108 }
2109 # 8 "include/linux/time.h" 2
2110
2111
2112
2113
2114 struct timespec {
2115 time_t tv_sec;
2116 long tv_nsec;
2117 };
2118
2119
2120 struct timeval {
2121 time_t tv_sec;
2122 suseconds_t tv_usec;
2123 };
2124
2125 struct timezone {
2126 int tz_minuteswest;
2127 int tz_dsttime;
2128 };
2129 # 39 "include/linux/time.h"
2130 static inline __attribute__((always_inline)) int timespec_equal(struct timespec *a, struct timespec *b)
2131 {
2132 return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec);
2133 }
2134
2135
2136
2137
2138
2139
2140 static inline __attribute__((always_inline)) int timespec_compare(const struct timespec *lhs, const struct timespec *rhs)
2141 {
2142 if (lhs->tv_sec < rhs->tv_sec)
2143 return -1;
2144 if (lhs->tv_sec > rhs->tv_sec)
2145 return 1;
2146 return lhs->tv_nsec - rhs->tv_nsec;
2147 }
2148
2149 static inline __attribute__((always_inline)) int timeval_compare(const struct timeval *lhs, const struct timeval *rhs)
2150 {
2151 if (lhs->tv_sec < rhs->tv_sec)
2152 return -1;
2153 if (lhs->tv_sec > rhs->tv_sec)
2154 return 1;
2155 return lhs->tv_usec - rhs->tv_usec;
2156 }
2157
2158 extern unsigned long mktime(const unsigned int year, const unsigned int mon,
2159 const unsigned int day, const unsigned int hour,
2160 const unsigned int min, const unsigned int sec);
2161
2162 extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec);
2163
2164
2165
2166
2167 static inline __attribute__((always_inline)) struct timespec timespec_sub(struct timespec lhs,
2168 struct timespec rhs)
2169 {
2170 struct timespec ts_delta;
2171 set_normalized_timespec(&ts_delta, lhs.tv_sec - rhs.tv_sec,
2172 lhs.tv_nsec - rhs.tv_nsec);
2173 return ts_delta;
2174 }
2175
2176
2177
2178
2179
2180
2181
2182 extern struct timespec xtime;
2183 extern struct timespec wall_to_monotonic;
2184 extern seqlock_t xtime_lock __attribute__((weak));
2185
2186 extern unsigned long read_persistent_clock(void);
2187 void timekeeping_init(void);
2188
2189 static inline __attribute__((always_inline)) unsigned long get_seconds(void)
2190 {
2191 return xtime.tv_sec;
2192 }
2193
2194 struct timespec current_kernel_time(void);
2195
2196
2197
2198
2199 extern void do_gettimeofday(struct timeval *tv);
2200 extern int do_settimeofday(struct timespec *tv);
2201 extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz);
2202
2203 extern long do_utimes(int dfd, char *filename, struct timeval *times);
2204 struct itimerval;
2205 extern int do_setitimer(int which, struct itimerval *value,
2206 struct itimerval *ovalue);
2207 extern unsigned int alarm_setitimer(unsigned int seconds);
2208 extern int do_getitimer(int which, struct itimerval *value);
2209 extern void getnstimeofday(struct timespec *tv);
2210
2211 extern struct timespec timespec_trunc(struct timespec t, unsigned gran);
2212 extern int timekeeping_is_continuous(void);
2213 # 130 "include/linux/time.h"
2214 static inline __attribute__((always_inline)) s64 timespec_to_ns(const struct timespec *ts)
2215 {
2216 return ((s64) ts->tv_sec * 1000000000L) + ts->tv_nsec;
2217 }
2218 # 142 "include/linux/time.h"
2219 static inline __attribute__((always_inline)) s64 timeval_to_ns(const struct timeval *tv)
2220 {
2221 return ((s64) tv->tv_sec * 1000000000L) +
2222 tv->tv_usec * 1000L;
2223 }
2224
2225
2226
2227
2228
2229
2230
2231 extern struct timespec ns_to_timespec(const s64 nsec);
2232
2233
2234
2235
2236
2237
2238
2239 extern struct timeval ns_to_timeval(const s64 nsec);
2240
2241
2242
2243
2244
2245
2246 static inline __attribute__((always_inline)) void timespec_add_ns(struct timespec *a, u64 ns)
2247 {
2248 ns += a->tv_nsec;
2249 while(__builtin_expect(!!(ns >= 1000000000L), 0)) {
2250 ns -= 1000000000L;
2251 a->tv_sec++;
2252 }
2253 a->tv_nsec = ns;
2254 }
2255 # 196 "include/linux/time.h"
2256 struct itimerspec {
2257 struct timespec it_interval;
2258 struct timespec it_value;
2259 };
2260
2261 struct itimerval {
2262 struct timeval it_interval;
2263 struct timeval it_value;
2264 };
2265 # 58 "include/linux/timex.h" 2
2266 # 100 "include/linux/timex.h"
2267 struct timex {
2268 unsigned int modes;
2269 long offset;
2270 long freq;
2271 long maxerror;
2272 long esterror;
2273 int status;
2274 long constant;
2275 long precision;
2276 long tolerance;
2277
2278
2279 struct timeval time;
2280 long tick;
2281
2282 long ppsfreq;
2283 long jitter;
2284 int shift;
2285 long stabil;
2286 long jitcnt;
2287 long calcnt;
2288 long errcnt;
2289 long stbcnt;
2290
2291 int :32; int :32; int :32; int :32;
2292 int :32; int :32; int :32; int :32;
2293 int :32; int :32; int :32; int :32;
2294 };
2295 # 187 "include/linux/timex.h"
2296 # 1 "include/asm/timex.h" 1
2297 # 11 "include/asm/timex.h"
2298 typedef unsigned long cycles_t;
2299
2300 static inline __attribute__((always_inline)) cycles_t get_cycles(void)
2301 {
2302 return 0;
2303 }
2304 # 188 "include/linux/timex.h" 2
2305
2306
2307
2308
2309
2310
2311 extern unsigned long tick_usec;
2312 extern unsigned long tick_nsec;
2313 extern int tickadj;
2314
2315
2316
2317
2318 extern int time_status;
2319 extern long time_maxerror;
2320 extern long time_esterror;
2321
2322 extern long time_freq;
2323
2324 extern long time_adjust;
2325
2326 extern void ntp_clear(void);
2327
2328
2329
2330
2331
2332 static inline __attribute__((always_inline)) int ntp_synced(void)
2333 {
2334 return !(time_status & 0x0040);
2335 }
2336 # 277 "include/linux/timex.h"
2337 static inline __attribute__((always_inline)) void time_interpolator_reset(void)
2338 {
2339 }
2340
2341 static inline __attribute__((always_inline)) void time_interpolator_update(long delta_nsec)
2342 {
2343 }
2344 # 297 "include/linux/timex.h"
2345 extern u64 current_tick_length(void);
2346
2347 extern void second_overflow(void);
2348 extern void update_ntp_one_tick(void);
2349 extern int do_adjtimex(struct timex *);
2350 # 51 "include/linux/sched.h" 2
2351 # 1 "include/linux/jiffies.h" 1
2352
2353
2354
2355 # 1 "include/linux/calc64.h" 1
2356
2357
2358
2359
2360 # 1 "include/asm/div64.h" 1
2361 # 1 "include/asm-generic/div64.h" 1
2362 # 35 "include/asm-generic/div64.h"
2363 extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
2364 # 1 "include/asm/div64.h" 2
2365 # 6 "include/linux/calc64.h" 2
2366 # 20 "include/linux/calc64.h"
2367 static inline __attribute__((always_inline)) unsigned long do_div_llr(const long long dividend,
2368 const long divisor, long *remainder)
2369 {
2370 u64 result = dividend;
2371
2372 *(remainder) = ({ uint32_t __base = (divisor); uint32_t __rem; (void)(((typeof((result)) *)0) == ((uint64_t *)0)); if (__builtin_expect(!!(((result) >> 32) == 0), 1)) { __rem = (uint32_t)(result) % __base; (result) = (uint32_t)(result) / __base; } else __rem = __div64_32(&(result), __base); __rem; });
2373 return (unsigned long) result;
2374 }
2375
2376
2377
2378
2379
2380
2381
2382 static inline __attribute__((always_inline)) long div_long_long_rem_signed(const long long dividend,
2383 const long divisor, long *remainder)
2384 {
2385 long res;
2386
2387 if (__builtin_expect(!!(dividend < 0), 0)) {
2388 res = -do_div_llr((-dividend), divisor, remainder);
2389 *remainder = -(*remainder);
2390 } else
2391 res = do_div_llr((dividend), divisor, remainder);
2392
2393 return res;
2394 }
2395 # 5 "include/linux/jiffies.h" 2
2396 # 81 "include/linux/jiffies.h"
2397 extern u64 __attribute__((section(".data"))) jiffies_64;
2398 extern unsigned long volatile __attribute__((section(".data"))) jiffies;
2399
2400
2401 u64 get_jiffies_64(void);
2402 # 264 "include/linux/jiffies.h"
2403 extern unsigned int jiffies_to_msecs(const unsigned long j);
2404 extern unsigned int jiffies_to_usecs(const unsigned long j);
2405 extern unsigned long msecs_to_jiffies(const unsigned int m);
2406 extern unsigned long usecs_to_jiffies(const unsigned int u);
2407 extern unsigned long timespec_to_jiffies(const struct timespec *value);
2408 extern void jiffies_to_timespec(const unsigned long jiffies,
2409 struct timespec *value);
2410 extern unsigned long timeval_to_jiffies(const struct timeval *value);
2411 extern void jiffies_to_timeval(const unsigned long jiffies,
2412 struct timeval *value);
2413 extern clock_t jiffies_to_clock_t(long x);
2414 extern unsigned long clock_t_to_jiffies(unsigned long x);
2415 extern u64 jiffies_64_to_clock_t(u64 x);
2416 extern u64 nsec_to_clock_t(u64 x);
2417 # 52 "include/linux/sched.h" 2
2418 # 1 "include/linux/rbtree.h" 1
2419 # 100 "include/linux/rbtree.h"
2420 struct rb_node
2421 {
2422 unsigned long rb_parent_color;
2423
2424
2425 struct rb_node *rb_right;
2426 struct rb_node *rb_left;
2427 } __attribute__((aligned(sizeof(long))));
2428
2429
2430 struct rb_root
2431 {
2432 struct rb_node *rb_node;
2433 };
2434 # 123 "include/linux/rbtree.h"
2435 static inline __attribute__((always_inline)) void rb_set_parent(struct rb_node *rb, struct rb_node *p)
2436 {
2437 rb->rb_parent_color = (rb->rb_parent_color & 3) | (unsigned long)p;
2438 }
2439 static inline __attribute__((always_inline)) void rb_set_color(struct rb_node *rb, int color)
2440 {
2441 rb->rb_parent_color = (rb->rb_parent_color & ~1) | color;
2442 }
2443 # 139 "include/linux/rbtree.h"
2444 extern void rb_insert_color(struct rb_node *, struct rb_root *);
2445 extern void rb_erase(struct rb_node *, struct rb_root *);
2446
2447
2448 extern struct rb_node *rb_next(struct rb_node *);
2449 extern struct rb_node *rb_prev(struct rb_node *);
2450 extern struct rb_node *rb_first(struct rb_root *);
2451 extern struct rb_node *rb_last(struct rb_root *);
2452
2453
2454 extern void rb_replace_node(struct rb_node *victim, struct rb_node *new,
2455 struct rb_root *root);
2456
2457 static inline __attribute__((always_inline)) void rb_link_node(struct rb_node * node, struct rb_node * parent,
2458 struct rb_node ** rb_link)
2459 {
2460 node->rb_parent_color = (unsigned long )parent;
2461 node->rb_left = node->rb_right = ((void *)0);
2462
2463 *rb_link = node;
2464 }
2465 # 53 "include/linux/sched.h" 2
2466
2467 # 1 "include/linux/cpumask.h" 1
2468 # 86 "include/linux/cpumask.h"
2469 # 1 "include/linux/bitmap.h" 1
2470
2471
2472
2473
2474
2475
2476
2477 # 1 "include/linux/string.h" 1
2478 # 16 "include/linux/string.h"
2479 extern char *strndup_user(const char *, long);
2480
2481
2482
2483
2484 # 1 "include/asm/string.h" 1
2485
2486
2487
2488
2489
2490
2491 extern inline __attribute__((always_inline)) char *strcpy(char *dest, const char *src)
2492 {
2493 char *xdest = dest;
2494 char temp = 0;
2495
2496 __asm__ __volatile__
2497 ("1:\t%2 = B [%1++] (Z);\n\t"
2498 "B [%0++] = %2;\n\t"
2499 "CC = %2;\n\t"
2500 "if cc jump 1b (bp);\n"
2501 : "+&a" (dest), "+&a" (src), "=&d" (temp)
2502 ::"memory", "CC");
2503 return xdest;
2504 }
2505
2506
2507 extern inline __attribute__((always_inline)) char *strncpy(char *dest, const char *src, size_t n)
2508 {
2509 char *xdest = dest;
2510 char temp = 0;
2511
2512 if (n == 0)
2513 return xdest;
2514
2515 __asm__ __volatile__
2516 ("1:\t%3 = B [%1++] (Z);\n\t"
2517 "B [%0++] = %3;\n\t"
2518 "CC = %3;\n\t"
2519 "if ! cc jump 2f;\n\t"
2520 "%2 += -1;\n\t"
2521 "CC = %2 == 0;\n\t"
2522 "if ! cc jump 1b (bp);\n"
2523 "2:\n"
2524 : "+&a" (dest), "+&a" (src), "+&da" (n), "=&d" (temp)
2525 ::"memory", "CC");
2526 return xdest;
2527 }
2528
2529
2530 extern inline __attribute__((always_inline)) int strcmp(const char *cs, const char *ct)
2531 {
2532 char __res1, __res2;
2533
2534 __asm__
2535 ("1:\t%2 = B[%0++] (Z);\n\t"
2536 "%3 = B[%1++] (Z);\n\t"
2537 "CC = %2 == %3;\n\t"
2538 "if ! cc jump 2f;\n\t"
2539 "CC = %2;\n\t"
2540 "if cc jump 1b (bp);\n\t"
2541 "jump.s 3f;\n"
2542 "2:\t%2 = %2 - %3;\n"
2543 "3:\n"
2544 : "+&a" (cs), "+&a" (ct), "=&d" (__res1), "=&d" (__res2)
2545 : : "CC");
2546
2547 return __res1;
2548 }
2549
2550
2551 extern inline __attribute__((always_inline)) int strncmp(const char *cs, const char *ct, size_t count)
2552 {
2553 char __res1, __res2;
2554
2555 if (!count)
2556 return 0;
2557 __asm__
2558 ("1:\t%3 = B[%0++] (Z);\n\t"
2559 "%4 = B[%1++] (Z);\n\t"
2560 "CC = %3 == %4;\n\t"
2561 "if ! cc jump 3f;\n\t"
2562 "CC = %3;\n\t"
2563 "if ! cc jump 4f;\n\t"
2564 "%2 += -1;\n\t"
2565 "CC = %2 == 0;\n\t"
2566 "if ! cc jump 1b;\n"
2567 "2:\t%3 = 0;\n\t"
2568 "jump.s 4f;\n"
2569 "3:\t%3 = %3 - %4;\n"
2570 "4:"
2571 : "+&a" (cs), "+&a" (ct), "+&da" (count), "=&d" (__res1), "=&d" (__res2)
2572 : : "CC");
2573 return __res1;
2574 }
2575
2576
2577 extern void *memset(void *s, int c, size_t count);
2578
2579 extern void *memcpy(void *d, const void *s, size_t count);
2580
2581 extern int memcmp(const void *, const void *, __kernel_size_t);
2582
2583 extern void *memchr(const void *s, int c, size_t n);
2584
2585 extern void *memmove(void *dest, const void *src, size_t count);
2586 # 22 "include/linux/string.h" 2
2587 # 30 "include/linux/string.h"
2588 size_t strlcpy(char *, const char *, size_t);
2589
2590
2591 extern char * strcat(char *, const char *);
2592
2593
2594 extern char * strncat(char *, const char *, __kernel_size_t);
2595
2596
2597 extern size_t strlcat(char *, const char *, __kernel_size_t);
2598 # 48 "include/linux/string.h"
2599 extern int strnicmp(const char *, const char *, __kernel_size_t);
2600
2601
2602 extern char * strchr(const char *,int);
2603
2604
2605 extern char * strnchr(const char *, size_t, int);
2606
2607
2608 extern char * strrchr(const char *,int);
2609
2610 extern char * strstrip(char *);
2611
2612 extern char * strstr(const char *,const char *);
2613
2614
2615 extern __kernel_size_t strlen(const char *);
2616
2617
2618 extern __kernel_size_t strnlen(const char *,__kernel_size_t);
2619
2620
2621 extern char * strpbrk(const char *,const char *);
2622
2623
2624 extern char * strsep(char **,const char *);
2625
2626
2627 extern __kernel_size_t strspn(const char *,const char *);
2628
2629
2630 extern __kernel_size_t strcspn(const char *,const char *);
2631 # 92 "include/linux/string.h"
2632 extern void * memscan(void *,int,__kernel_size_t);
2633 # 101 "include/linux/string.h"
2634 extern char *kstrdup(const char *s, gfp_t gfp);
2635 extern void *kmemdup(const void *src, size_t len, gfp_t gfp);
2636 # 9 "include/linux/bitmap.h" 2
2637 # 84 "include/linux/bitmap.h"
2638 extern int __bitmap_empty(const unsigned long *bitmap, int bits);
2639 extern int __bitmap_full(const unsigned long *bitmap, int bits);
2640 extern int __bitmap_equal(const unsigned long *bitmap1,
2641 const unsigned long *bitmap2, int bits);
2642 extern void __bitmap_complement(unsigned long *dst, const unsigned long *src,
2643 int bits);
2644 extern void __bitmap_shift_right(unsigned long *dst,
2645 const unsigned long *src, int shift, int bits);
2646 extern void __bitmap_shift_left(unsigned long *dst,
2647 const unsigned long *src, int shift, int bits);
2648 extern void __bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
2649 const unsigned long *bitmap2, int bits);
2650 extern void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1,
2651 const unsigned long *bitmap2, int bits);
2652 extern void __bitmap_xor(unsigned long *dst, const unsigned long *bitmap1,
2653 const unsigned long *bitmap2, int bits);
2654 extern void __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1,
2655 const unsigned long *bitmap2, int bits);
2656 extern int __bitmap_intersects(const unsigned long *bitmap1,
2657 const unsigned long *bitmap2, int bits);
2658 extern int __bitmap_subset(const unsigned long *bitmap1,
2659 const unsigned long *bitmap2, int bits);
2660 extern int __bitmap_weight(const unsigned long *bitmap, int bits);
2661
2662 extern int bitmap_scnprintf(char *buf, unsigned int len,
2663 const unsigned long *src, int nbits);
2664 extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user,
2665 unsigned long *dst, int nbits);
2666 extern int bitmap_parse_user(const char *ubuf, unsigned int ulen,
2667 unsigned long *dst, int nbits);
2668 extern int bitmap_scnlistprintf(char *buf, unsigned int len,
2669 const unsigned long *src, int nbits);
2670 extern int bitmap_parselist(const char *buf, unsigned long *maskp,
2671 int nmaskbits);
2672 extern void bitmap_remap(unsigned long *dst, const unsigned long *src,
2673 const unsigned long *old, const unsigned long *new, int bits);
2674 extern int bitmap_bitremap(int oldbit,
2675 const unsigned long *old, const unsigned long *new, int bits);
2676 extern int bitmap_find_free_region(unsigned long *bitmap, int bits, int order);
2677 extern void bitmap_release_region(unsigned long *bitmap, int pos, int order);
2678 extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order);
2679
2680
2681
2682
2683
2684
2685
2686 static inline __attribute__((always_inline)) void bitmap_zero(unsigned long *dst, int nbits)
2687 {
2688 if (nbits <= 32)
2689 *dst = 0UL;
2690 else {
2691 int len = (((nbits)+32 -1)/32) * sizeof(unsigned long);
2692 memset(dst, 0, len);
2693 }
2694 }
2695
2696 static inline __attribute__((always_inline)) void bitmap_fill(unsigned long *dst, int nbits)
2697 {
2698 size_t nlongs = (((nbits)+32 -1)/32);
2699 if (nlongs > 1) {
2700 int len = (nlongs - 1) * sizeof(unsigned long);
2701 memset(dst, 0xff, len);
2702 }
2703 dst[nlongs - 1] = ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL );
2704 }
2705
2706 static inline __attribute__((always_inline)) void bitmap_copy(unsigned long *dst, const unsigned long *src,
2707 int nbits)
2708 {
2709 if (nbits <= 32)
2710 *dst = *src;
2711 else {
2712 int len = (((nbits)+32 -1)/32) * sizeof(unsigned long);
2713 memcpy(dst, src, len);
2714 }
2715 }
2716
2717 static inline __attribute__((always_inline)) void bitmap_and(unsigned long *dst, const unsigned long *src1,
2718 const unsigned long *src2, int nbits)
2719 {
2720 if (nbits <= 32)
2721 *dst = *src1 & *src2;
2722 else
2723 __bitmap_and(dst, src1, src2, nbits);
2724 }
2725
2726 static inline __attribute__((always_inline)) void bitmap_or(unsigned long *dst, const unsigned long *src1,
2727 const unsigned long *src2, int nbits)
2728 {
2729 if (nbits <= 32)
2730 *dst = *src1 | *src2;
2731 else
2732 __bitmap_or(dst, src1, src2, nbits);
2733 }
2734
2735 static inline __attribute__((always_inline)) void bitmap_xor(unsigned long *dst, const unsigned long *src1,
2736 const unsigned long *src2, int nbits)
2737 {
2738 if (nbits <= 32)
2739 *dst = *src1 ^ *src2;
2740 else
2741 __bitmap_xor(dst, src1, src2, nbits);
2742 }
2743
2744 static inline __attribute__((always_inline)) void bitmap_andnot(unsigned long *dst, const unsigned long *src1,
2745 const unsigned long *src2, int nbits)
2746 {
2747 if (nbits <= 32)
2748 *dst = *src1 & ~(*src2);
2749 else
2750 __bitmap_andnot(dst, src1, src2, nbits);
2751 }
2752
2753 static inline __attribute__((always_inline)) void bitmap_complement(unsigned long *dst, const unsigned long *src,
2754 int nbits)
2755 {
2756 if (nbits <= 32)
2757 *dst = ~(*src) & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL );
2758 else
2759 __bitmap_complement(dst, src, nbits);
2760 }
2761
2762 static inline __attribute__((always_inline)) int bitmap_equal(const unsigned long *src1,
2763 const unsigned long *src2, int nbits)
2764 {
2765 if (nbits <= 32)
2766 return ! ((*src1 ^ *src2) & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL ));
2767 else
2768 return __bitmap_equal(src1, src2, nbits);
2769 }
2770
2771 static inline __attribute__((always_inline)) int bitmap_intersects(const unsigned long *src1,
2772 const unsigned long *src2, int nbits)
2773 {
2774 if (nbits <= 32)
2775 return ((*src1 & *src2) & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL )) != 0;
2776 else
2777 return __bitmap_intersects(src1, src2, nbits);
2778 }
2779
2780 static inline __attribute__((always_inline)) int bitmap_subset(const unsigned long *src1,
2781 const unsigned long *src2, int nbits)
2782 {
2783 if (nbits <= 32)
2784 return ! ((*src1 & ~(*src2)) & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL ));
2785 else
2786 return __bitmap_subset(src1, src2, nbits);
2787 }
2788
2789 static inline __attribute__((always_inline)) int bitmap_empty(const unsigned long *src, int nbits)
2790 {
2791 if (nbits <= 32)
2792 return ! (*src & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL ));
2793 else
2794 return __bitmap_empty(src, nbits);
2795 }
2796
2797 static inline __attribute__((always_inline)) int bitmap_full(const unsigned long *src, int nbits)
2798 {
2799 if (nbits <= 32)
2800 return ! (~(*src) & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL ));
2801 else
2802 return __bitmap_full(src, nbits);
2803 }
2804
2805 static inline __attribute__((always_inline)) int bitmap_weight(const unsigned long *src, int nbits)
2806 {
2807 if (nbits <= 32)
2808 return hweight_long(*src & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL ));
2809 return __bitmap_weight(src, nbits);
2810 }
2811
2812 static inline __attribute__((always_inline)) void bitmap_shift_right(unsigned long *dst,
2813 const unsigned long *src, int n, int nbits)
2814 {
2815 if (nbits <= 32)
2816 *dst = *src >> n;
2817 else
2818 __bitmap_shift_right(dst, src, n, nbits);
2819 }
2820
2821 static inline __attribute__((always_inline)) void bitmap_shift_left(unsigned long *dst,
2822 const unsigned long *src, int n, int nbits)
2823 {
2824 if (nbits <= 32)
2825 *dst = (*src << n) & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL );
2826 else
2827 __bitmap_shift_left(dst, src, n, nbits);
2828 }
2829
2830 static inline __attribute__((always_inline)) int bitmap_parse(const char *buf, unsigned int buflen,
2831 unsigned long *maskp, int nmaskbits)
2832 {
2833 return __bitmap_parse(buf, buflen, 0, maskp, nmaskbits);
2834 }
2835 # 87 "include/linux/cpumask.h" 2
2836
2837 typedef struct { unsigned long bits[(((1)+32 -1)/32)]; } cpumask_t;
2838 extern cpumask_t _unused_cpumask_arg_;
2839
2840
2841 static inline __attribute__((always_inline)) void __cpu_set(int cpu, volatile cpumask_t *dstp)
2842 {
2843 set_bit(cpu, dstp->bits);
2844 }
2845
2846
2847 static inline __attribute__((always_inline)) void __cpu_clear(int cpu, volatile cpumask_t *dstp)
2848 {
2849 clear_bit(cpu, dstp->bits);
2850 }
2851
2852
2853 static inline __attribute__((always_inline)) void __cpus_setall(cpumask_t *dstp, int nbits)
2854 {
2855 bitmap_fill(dstp->bits, nbits);
2856 }
2857
2858
2859 static inline __attribute__((always_inline)) void __cpus_clear(cpumask_t *dstp, int nbits)
2860 {
2861 bitmap_zero(dstp->bits, nbits);
2862 }
2863
2864
2865
2866
2867
2868 static inline __attribute__((always_inline)) int __cpu_test_and_set(int cpu, cpumask_t *addr)
2869 {
2870 return test_and_set_bit(cpu, addr->bits);
2871 }
2872
2873
2874 static inline __attribute__((always_inline)) void __cpus_and(cpumask_t *dstp, const cpumask_t *src1p,
2875 const cpumask_t *src2p, int nbits)
2876 {
2877 bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits);
2878 }
2879
2880
2881 static inline __attribute__((always_inline)) void __cpus_or(cpumask_t *dstp, const cpumask_t *src1p,
2882 const cpumask_t *src2p, int nbits)
2883 {
2884 bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits);
2885 }
2886
2887
2888 static inline __attribute__((always_inline)) void __cpus_xor(cpumask_t *dstp, const cpumask_t *src1p,
2889 const cpumask_t *src2p, int nbits)
2890 {
2891 bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits);
2892 }
2893
2894
2895
2896 static inline __attribute__((always_inline)) void __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p,
2897 const cpumask_t *src2p, int nbits)
2898 {
2899 bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);
2900 }
2901
2902
2903 static inline __attribute__((always_inline)) void __cpus_complement(cpumask_t *dstp,
2904 const cpumask_t *srcp, int nbits)
2905 {
2906 bitmap_complement(dstp->bits, srcp->bits, nbits);
2907 }
2908
2909
2910 static inline __attribute__((always_inline)) int __cpus_equal(const cpumask_t *src1p,
2911 const cpumask_t *src2p, int nbits)
2912 {
2913 return bitmap_equal(src1p->bits, src2p->bits, nbits);
2914 }
2915
2916
2917 static inline __attribute__((always_inline)) int __cpus_intersects(const cpumask_t *src1p,
2918 const cpumask_t *src2p, int nbits)
2919 {
2920 return bitmap_intersects(src1p->bits, src2p->bits, nbits);
2921 }
2922
2923
2924 static inline __attribute__((always_inline)) int __cpus_subset(const cpumask_t *src1p,
2925 const cpumask_t *src2p, int nbits)
2926 {
2927 return bitmap_subset(src1p->bits, src2p->bits, nbits);
2928 }
2929
2930
2931 static inline __attribute__((always_inline)) int __cpus_empty(const cpumask_t *srcp, int nbits)
2932 {
2933 return bitmap_empty(srcp->bits, nbits);
2934 }
2935
2936
2937 static inline __attribute__((always_inline)) int __cpus_full(const cpumask_t *srcp, int nbits)
2938 {
2939 return bitmap_full(srcp->bits, nbits);
2940 }
2941
2942
2943 static inline __attribute__((always_inline)) int __cpus_weight(const cpumask_t *srcp, int nbits)
2944 {
2945 return bitmap_weight(srcp->bits, nbits);
2946 }
2947
2948
2949
2950 static inline __attribute__((always_inline)) void __cpus_shift_right(cpumask_t *dstp,
2951 const cpumask_t *srcp, int n, int nbits)
2952 {
2953 bitmap_shift_right(dstp->bits, srcp->bits, n, nbits);
2954 }
2955
2956
2957
2958 static inline __attribute__((always_inline)) void __cpus_shift_left(cpumask_t *dstp,
2959 const cpumask_t *srcp, int n, int nbits)
2960 {
2961 bitmap_shift_left(dstp->bits, srcp->bits, n, nbits);
2962 }
2963 # 270 "include/linux/cpumask.h"
2964 static inline __attribute__((always_inline)) int __cpumask_scnprintf(char *buf, int len,
2965 const cpumask_t *srcp, int nbits)
2966 {
2967 return bitmap_scnprintf(buf, len, srcp->bits, nbits);
2968 }
2969
2970
2971
2972 static inline __attribute__((always_inline)) int __cpumask_parse_user(const char *buf, int len,
2973 cpumask_t *dstp, int nbits)
2974 {
2975 return bitmap_parse_user(buf, len, dstp->bits, nbits);
2976 }
2977
2978
2979
2980 static inline __attribute__((always_inline)) int __cpulist_scnprintf(char *buf, int len,
2981 const cpumask_t *srcp, int nbits)
2982 {
2983 return bitmap_scnlistprintf(buf, len, srcp->bits, nbits);
2984 }
2985
2986
2987 static inline __attribute__((always_inline)) int __cpulist_parse(const char *buf, cpumask_t *dstp, int nbits)
2988 {
2989 return bitmap_parselist(buf, dstp->bits, nbits);
2990 }
2991
2992
2993
2994 static inline __attribute__((always_inline)) int __cpu_remap(int oldbit,
2995 const cpumask_t *oldp, const cpumask_t *newp, int nbits)
2996 {
2997 return bitmap_bitremap(oldbit, oldp->bits, newp->bits, nbits);
2998 }
2999
3000
3001
3002 static inline __attribute__((always_inline)) void __cpus_remap(cpumask_t *dstp, const cpumask_t *srcp,
3003 const cpumask_t *oldp, const cpumask_t *newp, int nbits)
3004 {
3005 bitmap_remap(dstp->bits, srcp->bits, oldp->bits, newp->bits, nbits);
3006 }
3007 # 380 "include/linux/cpumask.h"
3008 extern cpumask_t cpu_possible_map;
3009 extern cpumask_t cpu_online_map;
3010 extern cpumask_t cpu_present_map;
3011 # 55 "include/linux/sched.h" 2
3012 # 1 "include/linux/errno.h" 1
3013
3014
3015
3016 # 1 "include/asm/errno.h" 1
3017
3018
3019
3020 # 1 "include/asm-generic/errno.h" 1
3021
3022
3023
3024 # 1 "include/asm-generic/errno-base.h" 1
3025 # 5 "include/asm-generic/errno.h" 2
3026 # 5 "include/asm/errno.h" 2
3027 # 5 "include/linux/errno.h" 2
3028 # 56 "include/linux/sched.h" 2
3029 # 1 "include/linux/nodemask.h" 1
3030 # 86 "include/linux/nodemask.h"
3031 # 1 "include/linux/numa.h" 1
3032 # 87 "include/linux/nodemask.h" 2
3033
3034 typedef struct { unsigned long bits[((((1 << 0))+32 -1)/32)]; } nodemask_t;
3035 extern nodemask_t _unused_nodemask_arg_;
3036
3037
3038 static inline __attribute__((always_inline)) void __node_set(int node, volatile nodemask_t *dstp)
3039 {
3040 set_bit(node, dstp->bits);
3041 }
3042
3043
3044 static inline __attribute__((always_inline)) void __node_clear(int node, volatile nodemask_t *dstp)
3045 {
3046 clear_bit(node, dstp->bits);
3047 }
3048
3049
3050 static inline __attribute__((always_inline)) void __nodes_setall(nodemask_t *dstp, int nbits)
3051 {
3052 bitmap_fill(dstp->bits, nbits);
3053 }
3054
3055
3056 static inline __attribute__((always_inline)) void __nodes_clear(nodemask_t *dstp, int nbits)
3057 {
3058 bitmap_zero(dstp->bits, nbits);
3059 }
3060
3061
3062
3063
3064
3065
3066 static inline __attribute__((always_inline)) int __node_test_and_set(int node, nodemask_t *addr)
3067 {
3068 return test_and_set_bit(node, addr->bits);
3069 }
3070
3071
3072
3073 static inline __attribute__((always_inline)) void __nodes_and(nodemask_t *dstp, const nodemask_t *src1p,
3074 const nodemask_t *src2p, int nbits)
3075 {
3076 bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits);
3077 }
3078
3079
3080
3081 static inline __attribute__((always_inline)) void __nodes_or(nodemask_t *dstp, const nodemask_t *src1p,
3082 const nodemask_t *src2p, int nbits)
3083 {
3084 bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits);
3085 }
3086
3087
3088
3089 static inline __attribute__((always_inline)) void __nodes_xor(nodemask_t *dstp, const nodemask_t *src1p,
3090 const nodemask_t *src2p, int nbits)
3091 {
3092 bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits);
3093 }
3094
3095
3096
3097 static inline __attribute__((always_inline)) void __nodes_andnot(nodemask_t *dstp, const nodemask_t *src1p,
3098 const nodemask_t *src2p, int nbits)
3099 {
3100 bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);
3101 }
3102
3103
3104
3105 static inline __attribute__((always_inline)) void __nodes_complement(nodemask_t *dstp,
3106 const nodemask_t *srcp, int nbits)
3107 {
3108 bitmap_complement(dstp->bits, srcp->bits, nbits);
3109 }
3110
3111
3112
3113 static inline __attribute__((always_inline)) int __nodes_equal(const nodemask_t *src1p,
3114 const nodemask_t *src2p, int nbits)
3115 {
3116 return bitmap_equal(src1p->bits, src2p->bits, nbits);
3117 }
3118
3119
3120
3121 static inline __attribute__((always_inline)) int __nodes_intersects(const nodemask_t *src1p,
3122 const nodemask_t *src2p, int nbits)
3123 {
3124 return bitmap_intersects(src1p->bits, src2p->bits, nbits);
3125 }
3126
3127
3128
3129 static inline __attribute__((always_inline)) int __nodes_subset(const nodemask_t *src1p,
3130 const nodemask_t *src2p, int nbits)
3131 {
3132 return bitmap_subset(src1p->bits, src2p->bits, nbits);
3133 }
3134
3135
3136 static inline __attribute__((always_inline)) int __nodes_empty(const nodemask_t *srcp, int nbits)
3137 {
3138 return bitmap_empty(srcp->bits, nbits);
3139 }
3140
3141
3142 static inline __attribute__((always_inline)) int __nodes_full(const nodemask_t *srcp, int nbits)
3143 {
3144 return bitmap_full(srcp->bits, nbits);
3145 }
3146
3147
3148 static inline __attribute__((always_inline)) int __nodes_weight(const nodemask_t *srcp, int nbits)
3149 {
3150 return bitmap_weight(srcp->bits, nbits);
3151 }
3152
3153
3154
3155 static inline __attribute__((always_inline)) void __nodes_shift_right(nodemask_t *dstp,
3156 const nodemask_t *srcp, int n, int nbits)
3157 {
3158 bitmap_shift_right(dstp->bits, srcp->bits, n, nbits);
3159 }
3160
3161
3162
3163 static inline __attribute__((always_inline)) void __nodes_shift_left(nodemask_t *dstp,
3164 const nodemask_t *srcp, int n, int nbits)
3165 {
3166 bitmap_shift_left(dstp->bits, srcp->bits, n, nbits);
3167 }
3168
3169
3170
3171
3172
3173 static inline __attribute__((always_inline)) int __first_node(const nodemask_t *srcp)
3174 {
3175 return ({ int __x = ((1 << 0)); int __y = (find_next_bit((srcp->bits), ((1 << 0)), 0)); __x < __y ? __x: __y; });
3176 }
3177
3178
3179 static inline __attribute__((always_inline)) int __next_node(int n, const nodemask_t *srcp)
3180 {
3181 return ({ int __x = ((1 << 0)); int __y = (find_next_bit(srcp->bits, (1 << 0), n+1)); __x < __y ? __x: __y; });
3182 }
3183 # 251 "include/linux/nodemask.h"
3184 static inline __attribute__((always_inline)) int __first_unset_node(const nodemask_t *maskp)
3185 {
3186 return ({ int __x = ((1 << 0)); int __y = (find_next_zero_bit((maskp->bits), ((1 << 0)), 0)); __x < __y ? __x: __y; });
3187
3188 }
3189 # 285 "include/linux/nodemask.h"
3190 static inline __attribute__((always_inline)) int __nodemask_scnprintf(char *buf, int len,
3191 const nodemask_t *srcp, int nbits)
3192 {
3193 return bitmap_scnprintf(buf, len, srcp->bits, nbits);
3194 }
3195
3196
3197
3198 static inline __attribute__((always_inline)) int __nodemask_parse_user(const char *buf, int len,
3199 nodemask_t *dstp, int nbits)
3200 {
3201 return bitmap_parse_user(buf, len, dstp->bits, nbits);
3202 }
3203
3204
3205
3206 static inline __attribute__((always_inline)) int __nodelist_scnprintf(char *buf, int len,
3207 const nodemask_t *srcp, int nbits)
3208 {
3209 return bitmap_scnlistprintf(buf, len, srcp->bits, nbits);
3210 }
3211
3212
3213 static inline __attribute__((always_inline)) int __nodelist_parse(const char *buf, nodemask_t *dstp, int nbits)
3214 {
3215 return bitmap_parselist(buf, dstp->bits, nbits);
3216 }
3217
3218
3219
3220 static inline __attribute__((always_inline)) int __node_remap(int oldbit,
3221 const nodemask_t *oldp, const nodemask_t *newp, int nbits)
3222 {
3223 return bitmap_bitremap(oldbit, oldp->bits, newp->bits, nbits);
3224 }
3225
3226
3227
3228 static inline __attribute__((always_inline)) void __nodes_remap(nodemask_t *dstp, const nodemask_t *srcp,
3229 const nodemask_t *oldp, const nodemask_t *newp, int nbits)
3230 {
3231 bitmap_remap(dstp->bits, srcp->bits, oldp->bits, newp->bits, nbits);
3232 }
3233 # 345 "include/linux/nodemask.h"
3234 extern nodemask_t node_online_map;
3235 extern nodemask_t node_possible_map;
3236 # 57 "include/linux/sched.h" 2
3237
3238
3239 # 1 "include/asm/semaphore.h" 1
3240
3241
3242
3243
3244
3245
3246 # 1 "include/linux/wait.h" 1
3247 # 22 "include/linux/wait.h"
3248 # 1 "include/linux/list.h" 1
3249
3250
3251
3252
3253
3254
3255 # 1 "include/linux/poison.h" 1
3256 # 8 "include/linux/list.h" 2
3257 # 1 "include/linux/prefetch.h" 1
3258 # 14 "include/linux/prefetch.h"
3259 # 1 "include/asm/processor.h" 1
3260 # 11 "include/asm/processor.h"
3261 # 1 "include/asm/segment.h" 1
3262 # 12 "include/asm/processor.h" 2
3263
3264
3265 static inline __attribute__((always_inline)) unsigned long rdusp(void)
3266 {
3267 unsigned long usp;
3268
3269 __asm__ __volatile__("%0 = usp;\n\t":"=da"(usp));
3270 return usp;
3271 }
3272
3273 static inline __attribute__((always_inline)) void wrusp(unsigned long usp)
3274 {
3275 __asm__ __volatile__("usp = %0;\n\t"::"da"(usp));
3276 }
3277
3278
3279
3280
3281 extern unsigned long memory_end;
3282
3283
3284
3285
3286 struct thread_struct {
3287 unsigned long ksp;
3288 unsigned long usp;
3289 unsigned short seqstat;
3290 unsigned long esp0;
3291 unsigned long pc;
3292 void * debuggerinfo;
3293 };
3294 # 70 "include/asm/processor.h"
3295 struct task_struct;
3296
3297
3298 static inline __attribute__((always_inline)) void release_thread(struct task_struct *dead_task)
3299 {
3300 }
3301
3302
3303
3304 extern int kernel_thread(int (*fn) (void *), void *arg, unsigned long flags);
3305
3306
3307
3308
3309 static inline __attribute__((always_inline)) void exit_thread(void)
3310 {
3311 }
3312
3313
3314
3315
3316
3317
3318 unsigned long get_wchan(struct task_struct *p);
3319 # 107 "include/asm/processor.h"
3320 static inline __attribute__((always_inline)) __attribute__((pure)) uint32_t bfin_revid(void)
3321 {
3322
3323 return ({ unsigned __v; __asm__ __volatile__ ("NOP;\n\t" "%0 = [%1];\n\t" : "=d"(__v) : "a"(0xFFC00014)); __v; }) >> 28;
3324 }
3325
3326 static inline __attribute__((always_inline)) __attribute__((pure)) uint32_t bfin_compiled_revid(void)
3327 {
3328
3329
3330
3331
3332
3333
3334
3335 return 3;
3336
3337
3338
3339
3340
3341 }
3342 # 15 "include/linux/prefetch.h" 2
3343 # 1 "include/asm/cache.h" 1
3344 # 16 "include/linux/prefetch.h" 2
3345 # 43 "include/linux/prefetch.h"
3346 static inline __attribute__((always_inline)) void prefetch(const void *x) {;}
3347
3348
3349
3350 static inline __attribute__((always_inline)) void prefetchw(const void *x) {;}
3351 # 58 "include/linux/prefetch.h"
3352 static inline __attribute__((always_inline)) void prefetch_range(void *addr, size_t len)
3353 {
3354
3355
3356
3357
3358
3359
3360
3361 }
3362 # 9 "include/linux/list.h" 2
3363 # 21 "include/linux/list.h"
3364 struct list_head {
3365 struct list_head *next, *prev;
3366 };
3367
3368
3369
3370
3371
3372
3373 static inline __attribute__((always_inline)) void INIT_LIST_HEAD(struct list_head *list)
3374 {
3375 list->next = list;
3376 list->prev = list;
3377 }
3378 # 43 "include/linux/list.h"
3379 static inline __attribute__((always_inline)) void __list_add(struct list_head *new,
3380 struct list_head *prev,
3381 struct list_head *next)
3382 {
3383 next->prev = new;
3384 new->next = next;
3385 new->prev = prev;
3386 prev->next = new;
3387 }
3388 # 67 "include/linux/list.h"
3389 static inline __attribute__((always_inline)) void list_add(struct list_head *new, struct list_head *head)
3390 {
3391 __list_add(new, head, head->next);
3392 }
3393 # 84 "include/linux/list.h"
3394 static inline __attribute__((always_inline)) void list_add_tail(struct list_head *new, struct list_head *head)
3395 {
3396 __list_add(new, head->prev, head);
3397 }
3398
3399
3400
3401
3402
3403
3404
3405 static inline __attribute__((always_inline)) void __list_add_rcu(struct list_head * new,
3406 struct list_head * prev, struct list_head * next)
3407 {
3408 new->next = next;
3409 new->prev = prev;
3410 __asm__ __volatile__("": : :"memory");
3411 next->prev = new;
3412 prev->next = new;
3413 }
3414 # 121 "include/linux/list.h"
3415 static inline __attribute__((always_inline)) void list_add_rcu(struct list_head *new, struct list_head *head)
3416 {
3417 __list_add_rcu(new, head, head->next);
3418 }
3419 # 142 "include/linux/list.h"
3420 static inline __attribute__((always_inline)) void list_add_tail_rcu(struct list_head *new,
3421 struct list_head *head)
3422 {
3423 __list_add_rcu(new, head->prev, head);
3424 }
3425 # 155 "include/linux/list.h"
3426 static inline __attribute__((always_inline)) void __list_del(struct list_head * prev, struct list_head * next)
3427 {
3428 next->prev = prev;
3429 prev->next = next;
3430 }
3431 # 168 "include/linux/list.h"
3432 static inline __attribute__((always_inline)) void list_del(struct list_head *entry)
3433 {
3434 __list_del(entry->prev, entry->next);
3435 entry->next = ((void *) 0x00100100);
3436 entry->prev = ((void *) 0x00200200);
3437 }
3438 # 202 "include/linux/list.h"
3439 static inline __attribute__((always_inline)) void list_del_rcu(struct list_head *entry)
3440 {
3441 __list_del(entry->prev, entry->next);
3442 entry->prev = ((void *) 0x00200200);
3443 }
3444 # 215 "include/linux/list.h"
3445 static inline __attribute__((always_inline)) void list_replace(struct list_head *old,
3446 struct list_head *new)
3447 {
3448 new->next = old->next;
3449 new->next->prev = new;
3450 new->prev = old->prev;
3451 new->prev->next = new;
3452 }
3453
3454 static inline __attribute__((always_inline)) void list_replace_init(struct list_head *old,
3455 struct list_head *new)
3456 {
3457 list_replace(old, new);
3458 INIT_LIST_HEAD(old);
3459 }
3460 # 239 "include/linux/list.h"
3461 static inline __attribute__((always_inline)) void list_replace_rcu(struct list_head *old,
3462 struct list_head *new)
3463 {
3464 new->next = old->next;
3465 new->prev = old->prev;
3466 __asm__ __volatile__("": : :"memory");
3467 new->next->prev = new;
3468 new->prev->next = new;
3469 old->prev = ((void *) 0x00200200);
3470 }
3471
3472
3473
3474
3475
3476 static inline __attribute__((always_inline)) void list_del_init(struct list_head *entry)
3477 {
3478 __list_del(entry->prev, entry->next);
3479 INIT_LIST_HEAD(entry);
3480 }
3481
3482
3483
3484
3485
3486
3487 static inline __attribute__((always_inline)) void list_move(struct list_head *list, struct list_head *head)
3488 {
3489 __list_del(list->prev, list->next);
3490 list_add(list, head);
3491 }
3492
3493
3494
3495
3496
3497
3498 static inline __attribute__((always_inline)) void list_move_tail(struct list_head *list,
3499 struct list_head *head)
3500 {
3501 __list_del(list->prev, list->next);
3502 list_add_tail(list, head);
3503 }
3504
3505
3506
3507
3508
3509
3510 static inline __attribute__((always_inline)) int list_is_last(const struct list_head *list,
3511 const struct list_head *head)
3512 {
3513 return list->next == head;
3514 }
3515
3516
3517
3518
3519
3520 static inline __attribute__((always_inline)) int list_empty(const struct list_head *head)
3521 {
3522 return head->next == head;
3523 }
3524 # 316 "include/linux/list.h"
3525 static inline __attribute__((always_inline)) int list_empty_careful(const struct list_head *head)
3526 {
3527 struct list_head *next = head->next;
3528 return (next == head) && (next == head->prev);
3529 }
3530
3531 static inline __attribute__((always_inline)) void __list_splice(struct list_head *list,
3532 struct list_head *head)
3533 {
3534 struct list_head *first = list->next;
3535 struct list_head *last = list->prev;
3536 struct list_head *at = head->next;
3537
3538 first->prev = head;
3539 head->next = first;
3540
3541 last->next = at;
3542 at->prev = last;
3543 }
3544
3545
3546
3547
3548
3549
3550 static inline __attribute__((always_inline)) void list_splice(struct list_head *list, struct list_head *head)
3551 {
3552 if (!list_empty(list))
3553 __list_splice(list, head);
3554 }
3555 # 354 "include/linux/list.h"
3556 static inline __attribute__((always_inline)) void list_splice_init(struct list_head *list,
3557 struct list_head *head)
3558 {
3559 if (!list_empty(list)) {
3560 __list_splice(list, head);
3561 INIT_LIST_HEAD(list);
3562 }
3563 }
3564 # 380 "include/linux/list.h"
3565 static inline __attribute__((always_inline)) void list_splice_init_rcu(struct list_head *list,
3566 struct list_head *head,
3567 void (*sync)(void))
3568 {
3569 struct list_head *first = list->next;
3570 struct list_head *last = list->prev;
3571 struct list_head *at = head->next;
3572
3573 if (list_empty(head))
3574 return;
3575
3576
3577
3578 INIT_LIST_HEAD(list);
3579 # 402 "include/linux/list.h"
3580 sync();
3581 # 412 "include/linux/list.h"
3582 last->next = at;
3583 __asm__ __volatile__("": : :"memory");
3584 head->next = first;
3585 first->prev = head;
3586 at->prev = last;
3587 }
3588 # 664 "include/linux/list.h"
3589 struct hlist_head {
3590 struct hlist_node *first;
3591 };
3592
3593 struct hlist_node {
3594 struct hlist_node *next, **pprev;
3595 };
3596
3597
3598
3599
3600 static inline __attribute__((always_inline)) void INIT_HLIST_NODE(struct hlist_node *h)
3601 {
3602 h->next = ((void *)0);
3603 h->pprev = ((void *)0);
3604 }
3605
3606 static inline __attribute__((always_inline)) int hlist_unhashed(const struct hlist_node *h)
3607 {
3608 return !h->pprev;
3609 }
3610
3611 static inline __attribute__((always_inline)) int hlist_empty(const struct hlist_head *h)
3612 {
3613 return !h->first;
3614 }
3615
3616 static inline __attribute__((always_inline)) void __hlist_del(struct hlist_node *n)
3617 {
3618 struct hlist_node *next = n->next;
3619 struct hlist_node **pprev = n->pprev;
3620 *pprev = next;
3621 if (next)
3622 next->pprev = pprev;
3623 }
3624
3625 static inline __attribute__((always_inline)) void hlist_del(struct hlist_node *n)
3626 {
3627 __hlist_del(n);
3628 n->next = ((void *) 0x00100100);
3629 n->pprev = ((void *) 0x00200200);
3630 }
3631 # 726 "include/linux/list.h"
3632 static inline __attribute__((always_inline)) void hlist_del_rcu(struct hlist_node *n)
3633 {
3634 __hlist_del(n);
3635 n->pprev = ((void *) 0x00200200);
3636 }
3637
3638 static inline __attribute__((always_inline)) void hlist_del_init(struct hlist_node *n)
3639 {
3640 if (!hlist_unhashed(n)) {
3641 __hlist_del(n);
3642 INIT_HLIST_NODE(n);
3643 }
3644 }
3645 # 747 "include/linux/list.h"
3646 static inline __attribute__((always_inline)) void hlist_replace_rcu(struct hlist_node *old,
3647 struct hlist_node *new)
3648 {
3649 struct hlist_node *next = old->next;
3650
3651 new->next = next;
3652 new->pprev = old->pprev;
3653 __asm__ __volatile__("": : :"memory");
3654 if (next)
3655 new->next->pprev = &new->next;
3656 *new->pprev = new;
3657 old->pprev = ((void *) 0x00200200);
3658 }
3659
3660 static inline __attribute__((always_inline)) void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
3661 {
3662 struct hlist_node *first = h->first;
3663 n->next = first;
3664 if (first)
3665 first->pprev = &n->next;
3666 h->first = n;
3667 n->pprev = &h->first;
3668 }
3669 # 791 "include/linux/list.h"
3670 static inline __attribute__((always_inline)) void hlist_add_head_rcu(struct hlist_node *n,
3671 struct hlist_head *h)
3672 {
3673 struct hlist_node *first = h->first;
3674 n->next = first;
3675 n->pprev = &h->first;
3676 __asm__ __volatile__("": : :"memory");
3677 if (first)
3678 first->pprev = &n->next;
3679 h->first = n;
3680 }
3681
3682
3683 static inline __attribute__((always_inline)) void hlist_add_before(struct hlist_node *n,
3684 struct hlist_node *next)
3685 {
3686 n->pprev = next->pprev;
3687 n->next = next;
3688 next->pprev = &n->next;
3689 *(n->pprev) = n;
3690 }
3691
3692 static inline __attribute__((always_inline)) void hlist_add_after(struct hlist_node *n,
3693 struct hlist_node *next)
3694 {
3695 next->next = n->next;
3696 n->next = next;
3697 next->pprev = &n->next;
3698
3699 if(next->next)
3700 next->next->pprev = &next->next;
3701 }
3702 # 842 "include/linux/list.h"
3703 static inline __attribute__((always_inline)) void hlist_add_before_rcu(struct hlist_node *n,
3704 struct hlist_node *next)
3705 {
3706 n->pprev = next->pprev;
3707 n->next = next;
3708 __asm__ __volatile__("": : :"memory");
3709 next->pprev = &n->next;
3710 *(n->pprev) = n;
3711 }
3712 # 870 "include/linux/list.h"
3713 static inline __attribute__((always_inline)) void hlist_add_after_rcu(struct hlist_node *prev,
3714 struct hlist_node *n)
3715 {
3716 n->next = prev->next;
3717 n->pprev = &prev->next;
3718 __asm__ __volatile__("": : :"memory");
3719 prev->next = n;
3720 if (n->next)
3721 n->next->pprev = &n->next;
3722 }
3723 # 23 "include/linux/wait.h" 2
3724
3725
3726
3727
3728
3729 typedef struct __wait_queue wait_queue_t;
3730 typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int sync, void *key);
3731 int default_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
3732
3733 struct __wait_queue {
3734 unsigned int flags;
3735
3736 void *private;
3737 wait_queue_func_t func;
3738 struct list_head task_list;
3739 };
3740
3741 struct wait_bit_key {
3742 void *flags;
3743 int bit_nr;
3744 };
3745
3746 struct wait_bit_queue {
3747 struct wait_bit_key key;
3748 wait_queue_t wait;
3749 };
3750
3751 struct __wait_queue_head {
3752 spinlock_t lock;
3753 struct list_head task_list;
3754 };
3755 typedef struct __wait_queue_head wait_queue_head_t;
3756
3757 struct task_struct;
3758 # 80 "include/linux/wait.h"
3759 extern void init_waitqueue_head(wait_queue_head_t *q);
3760 # 91 "include/linux/wait.h"
3761 static inline __attribute__((always_inline)) void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p)
3762 {
3763 q->flags = 0;
3764 q->private = p;
3765 q->func = default_wake_function;
3766 }
3767
3768 static inline __attribute__((always_inline)) void init_waitqueue_func_entry(wait_queue_t *q,
3769 wait_queue_func_t func)
3770 {
3771 q->flags = 0;
3772 q->private = ((void *)0);
3773 q->func = func;
3774 }
3775
3776 static inline __attribute__((always_inline)) int waitqueue_active(wait_queue_head_t *q)
3777 {
3778 return !list_empty(&q->task_list);
3779 }
3780 # 120 "include/linux/wait.h"
3781 extern void add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait);
3782 extern void add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t * wait);
3783 extern void remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait);
3784
3785 static inline __attribute__((always_inline)) void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new)
3786 {
3787 list_add(&new->task_list, &head->task_list);
3788 }
3789
3790
3791
3792
3793 static inline __attribute__((always_inline)) void __add_wait_queue_tail(wait_queue_head_t *head,
3794 wait_queue_t *new)
3795 {
3796 list_add_tail(&new->task_list, &head->task_list);
3797 }
3798
3799 static inline __attribute__((always_inline)) void __remove_wait_queue(wait_queue_head_t *head,
3800 wait_queue_t *old)
3801 {
3802 list_del(&old->task_list);
3803 }
3804
3805 void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key);
3806 extern void __wake_up_locked(wait_queue_head_t *q, unsigned int mode);
3807 extern void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr);
3808 void __wake_up_bit(wait_queue_head_t *, void *, int);
3809 int __wait_on_bit(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned);
3810 int __wait_on_bit_lock(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned);
3811 void wake_up_bit(void *, int);
3812 int out_of_line_wait_on_bit(void *, int, int (*)(void *), unsigned);
3813 int out_of_line_wait_on_bit_lock(void *, int, int (*)(void *), unsigned);
3814 wait_queue_head_t *bit_waitqueue(void *, int);
3815 # 351 "include/linux/wait.h"
3816 static inline __attribute__((always_inline)) void add_wait_queue_exclusive_locked(wait_queue_head_t *q,
3817 wait_queue_t * wait)
3818 {
3819 wait->flags |= 0x01;
3820 __add_wait_queue_tail(q, wait);
3821 }
3822
3823
3824
3825
3826 static inline __attribute__((always_inline)) void remove_wait_queue_locked(wait_queue_head_t *q,
3827 wait_queue_t * wait)
3828 {
3829 __remove_wait_queue(q, wait);
3830 }
3831
3832
3833
3834
3835
3836
3837 extern void sleep_on(wait_queue_head_t *q);
3838 extern long sleep_on_timeout(wait_queue_head_t *q, signed long timeout);
3839
3840 extern void interruptible_sleep_on(wait_queue_head_t *q);
3841 extern long interruptible_sleep_on_timeout(wait_queue_head_t *q, signed long timeout);
3842
3843
3844
3845
3846
3847 void prepare_to_wait(wait_queue_head_t *q, wait_queue_t *wait, int state);
3848
3849 void prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int state);
3850
3851 void finish_wait(wait_queue_head_t *q, wait_queue_t *wait);
3852 int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
3853 int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
3854 # 429 "include/linux/wait.h"
3855 static inline __attribute__((always_inline)) int wait_on_bit(void *word, int bit,
3856 int (*action)(void *), unsigned mode)
3857 {
3858 if (!(__builtin_constant_p(bit) ? __constant_test_bit((bit),(word)) : __test_bit((bit),(word))))
3859 return 0;
3860 return out_of_line_wait_on_bit(word, bit, action, mode);
3861 }
3862 # 453 "include/linux/wait.h"
3863 static inline __attribute__((always_inline)) int wait_on_bit_lock(void *word, int bit,
3864 int (*action)(void *), unsigned mode)
3865 {
3866 if (!test_and_set_bit(bit, word))
3867 return 0;
3868 return out_of_line_wait_on_bit_lock(word, bit, action, mode);
3869 }
3870 # 8 "include/asm/semaphore.h" 2
3871
3872 # 1 "include/linux/rwsem.h" 1
3873 # 19 "include/linux/rwsem.h"
3874 struct rw_semaphore;
3875
3876
3877 # 1 "include/linux/rwsem-spinlock.h" 1
3878 # 22 "include/linux/rwsem-spinlock.h"
3879 struct rwsem_waiter;
3880 # 31 "include/linux/rwsem-spinlock.h"
3881 struct rw_semaphore {
3882 __s32 activity;
3883 spinlock_t wait_lock;
3884 struct list_head wait_list;
3885
3886
3887
3888 };
3889 # 53 "include/linux/rwsem-spinlock.h"
3890 extern void __init_rwsem(struct rw_semaphore *sem, const char *name,
3891 struct lock_class_key *key);
3892 # 63 "include/linux/rwsem-spinlock.h"
3893 extern void __down_read(struct rw_semaphore *sem);
3894 extern int __down_read_trylock(struct rw_semaphore *sem);
3895 extern void __down_write(struct rw_semaphore *sem);
3896 extern void __down_write_nested(struct rw_semaphore *sem, int subclass);
3897 extern int __down_write_trylock(struct rw_semaphore *sem);
3898 extern void __up_read(struct rw_semaphore *sem);
3899 extern void __up_write(struct rw_semaphore *sem);
3900 extern void __downgrade_write(struct rw_semaphore *sem);
3901
3902 static inline __attribute__((always_inline)) int rwsem_is_locked(struct rw_semaphore *sem)
3903 {
3904 return (sem->activity != 0);
3905 }
3906 # 23 "include/linux/rwsem.h" 2
3907
3908
3909
3910
3911
3912
3913
3914 extern void down_read(struct rw_semaphore *sem);
3915
3916
3917
3918
3919 extern int down_read_trylock(struct rw_semaphore *sem);
3920
3921
3922
3923
3924 extern void down_write(struct rw_semaphore *sem);
3925
3926
3927
3928
3929 extern int down_write_trylock(struct rw_semaphore *sem);
3930
3931
3932
3933
3934 extern void up_read(struct rw_semaphore *sem);
3935
3936
3937
3938
3939 extern void up_write(struct rw_semaphore *sem);
3940
3941
3942
3943
3944 extern void downgrade_write(struct rw_semaphore *sem);
3945 # 10 "include/asm/semaphore.h" 2
3946 # 21 "include/asm/semaphore.h"
3947 struct semaphore {
3948 atomic_t count;
3949 int sleepers;
3950 wait_queue_head_t wait;
3951 };
3952 # 40 "include/asm/semaphore.h"
3953 static inline __attribute__((always_inline)) void sema_init(struct semaphore *sem, int val)
3954 {
3955 *sem = (struct semaphore){ .count = { (val) }, .sleepers = 0, .wait = { .lock = (spinlock_t) { .raw_lock = { }, }, .task_list = { &((*sem).wait).task_list, &((*sem).wait).task_list } } };
3956 }
3957
3958 static inline __attribute__((always_inline)) void init_MUTEX(struct semaphore *sem)
3959 {
3960 sema_init(sem, 1);
3961 }
3962
3963 static inline __attribute__((always_inline)) void init_MUTEX_LOCKED(struct semaphore *sem)
3964 {
3965 sema_init(sem, 0);
3966 }
3967
3968 void __down(struct semaphore *sem);
3969 int __down_interruptible(struct semaphore *sem);
3970 int __down_trylock(struct semaphore *sem);
3971 void __up(struct semaphore *sem);
3972
3973 extern spinlock_t semaphore_wake_lock;
3974
3975
3976
3977
3978
3979
3980 static inline __attribute__((always_inline)) void down(struct semaphore *sem)
3981 {
3982 do { cond_resched(); } while (0);
3983 if (atomic_sub_return(1,(&sem->count)) < 0)
3984 __down(sem);
3985 }
3986
3987 static inline __attribute__((always_inline)) int down_interruptible(struct semaphore *sem)
3988 {
3989 int ret = 0;
3990
3991 do { cond_resched(); } while (0);
3992 if (atomic_sub_return(1,(&sem->count)) < 0)
3993 ret = __down_interruptible(sem);
3994 return (ret);
3995 }
3996
3997 static inline __attribute__((always_inline)) int down_trylock(struct semaphore *sem)
3998 {
3999 int ret = 0;
4000
4001 if (atomic_sub_return(1,(&sem->count)) < 0)
4002 ret = __down_trylock(sem);
4003 return ret;
4004 }
4005
4006
4007
4008
4009
4010
4011
4012 static inline __attribute__((always_inline)) void up(struct semaphore *sem)
4013 {
4014 if (atomic_add_return(1,(&sem->count)) <= 0)
4015 __up(sem);
4016 }
4017 # 60 "include/linux/sched.h" 2
4018
4019
4020 # 1 "include/asm/mmu.h" 1
4021
4022
4023
4024
4025
4026 struct sram_list_struct {
4027 struct sram_list_struct *next;
4028 void *addr;
4029 size_t length;
4030 };
4031
4032 typedef struct {
4033 struct vm_list_struct *vmlist;
4034 unsigned long end_brk;
4035 unsigned long stack_start;
4036
4037
4038
4039 void *l1_stack_save;
4040
4041 struct sram_list_struct *sram_list;
4042
4043
4044 unsigned long exec_fdpic_loadmap;
4045 unsigned long interp_fdpic_loadmap;
4046
4047
4048 } mm_context_t;
4049 # 63 "include/linux/sched.h" 2
4050 # 1 "include/asm/cputime.h" 1
4051
4052
4053
4054 # 1 "include/asm-generic/cputime.h" 1
4055
4056
4057
4058
4059
4060
4061 typedef unsigned long cputime_t;
4062 # 23 "include/asm-generic/cputime.h"
4063 typedef u64 cputime64_t;
4064 # 5 "include/asm/cputime.h" 2
4065 # 64 "include/linux/sched.h" 2
4066
4067 # 1 "include/linux/smp.h" 1
4068 # 10 "include/linux/smp.h"
4069 extern void cpu_idle(void);
4070 # 87 "include/linux/smp.h"
4071 static inline __attribute__((always_inline)) int up_smp_call_function(void)
4072 {
4073 return 0;
4074 }
4075 # 99 "include/linux/smp.h"
4076 static inline __attribute__((always_inline)) void smp_send_reschedule(int cpu) { }
4077
4078
4079 static inline __attribute__((always_inline)) int smp_call_function_single(int cpuid, void (*func) (void *info),
4080 void *info, int retry, int wait)
4081 {
4082
4083 func(info);
4084 return 0;
4085 }
4086 # 138 "include/linux/smp.h"
4087 void smp_setup_processor_id(void);
4088 # 66 "include/linux/sched.h" 2
4089 # 1 "include/linux/sem.h" 1
4090
4091
4092
4093 # 1 "include/linux/ipc.h" 1
4094 # 9 "include/linux/ipc.h"
4095 struct ipc_perm
4096 {
4097 __kernel_key_t key;
4098 __kernel_uid_t uid;
4099 __kernel_gid_t gid;
4100 __kernel_uid_t cuid;
4101 __kernel_gid_t cgid;
4102 __kernel_mode_t mode;
4103 unsigned short seq;
4104 };
4105
4106
4107 # 1 "include/asm/ipcbuf.h" 1
4108 # 16 "include/asm/ipcbuf.h"
4109 struct ipc64_perm {
4110 __kernel_key_t key;
4111 __kernel_uid32_t uid;
4112 __kernel_gid32_t gid;
4113 __kernel_uid32_t cuid;
4114 __kernel_gid32_t cgid;
4115 __kernel_mode_t mode;
4116 unsigned short __pad1;
4117 unsigned short seq;
4118 unsigned short __pad2;
4119 unsigned long __unused1;
4120 unsigned long __unused2;
4121 };
4122 # 22 "include/linux/ipc.h" 2
4123 # 54 "include/linux/ipc.h"
4124 # 1 "include/linux/kref.h" 1
4125 # 23 "include/linux/kref.h"
4126 struct kref {
4127 atomic_t refcount;
4128 };
4129
4130 void kref_init(struct kref *kref);
4131 void kref_get(struct kref *kref);
4132 int kref_put(struct kref *kref, void (*release) (struct kref *kref));
4133 # 55 "include/linux/ipc.h" 2
4134
4135
4136
4137
4138 struct kern_ipc_perm
4139 {
4140 spinlock_t lock;
4141 int deleted;
4142 key_t key;
4143 uid_t uid;
4144 gid_t gid;
4145 uid_t cuid;
4146 gid_t cgid;
4147 mode_t mode;
4148 unsigned long seq;
4149 void *security;
4150 };
4151
4152 struct ipc_ids;
4153 struct ipc_namespace {
4154 struct kref kref;
4155 struct ipc_ids *ids[3];
4156
4157 int sem_ctls[4];
4158 int used_sems;
4159
4160 int msg_ctlmax;
4161 int msg_ctlmnb;
4162 int msg_ctlmni;
4163
4164 size_t shm_ctlmax;
4165 size_t shm_ctlall;
4166 int shm_ctlmni;
4167 int shm_tot;
4168 };
4169
4170 extern struct ipc_namespace init_ipc_ns;
4171
4172
4173
4174 extern int copy_ipcs(unsigned long flags, struct task_struct *tsk);
4175 # 107 "include/linux/ipc.h"
4176 static inline __attribute__((always_inline)) struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
4177 {
4178
4179
4180
4181
4182 return ns;
4183 }
4184
4185 static inline __attribute__((always_inline)) void put_ipc_ns(struct ipc_namespace *ns)
4186 {
4187
4188
4189
4190 }
4191 # 5 "include/linux/sem.h" 2
4192 # 23 "include/linux/sem.h"
4193 struct semid_ds {
4194 struct ipc_perm sem_perm;
4195 __kernel_time_t sem_otime;
4196 __kernel_time_t sem_ctime;
4197 struct sem *sem_base;
4198 struct sem_queue *sem_pending;
4199 struct sem_queue **sem_pending_last;
4200 struct sem_undo *undo;
4201 unsigned short sem_nsems;
4202 };
4203
4204
4205 # 1 "include/asm/sembuf.h" 1
4206 # 14 "include/asm/sembuf.h"
4207 struct semid64_ds {
4208 struct ipc64_perm sem_perm;
4209 __kernel_time_t sem_otime;
4210 unsigned long __unused1;
4211 __kernel_time_t sem_ctime;
4212 unsigned long __unused2;
4213 unsigned long sem_nsems;
4214 unsigned long __unused3;
4215 unsigned long __unused4;
4216 };
4217 # 36 "include/linux/sem.h" 2
4218
4219
4220 struct sembuf {
4221 unsigned short sem_num;
4222 short sem_op;
4223 short sem_flg;
4224 };
4225
4226
4227 union semun {
4228 int val;
4229 struct semid_ds *buf;
4230 unsigned short *array;
4231 struct seminfo *__buf;
4232 void *__pad;
4233 };
4234
4235 struct seminfo {
4236 int semmap;
4237 int semmni;
4238 int semmns;
4239 int semmnu;
4240 int semmsl;
4241 int semopm;
4242 int semume;
4243 int semusz;
4244 int semvmx;
4245 int semaem;
4246 };
4247 # 82 "include/linux/sem.h"
4248 struct task_struct;
4249
4250
4251 struct sem {
4252 int semval;
4253 int sempid;
4254 };
4255
4256
4257 struct sem_array {
4258 struct kern_ipc_perm sem_perm;
4259 int sem_id;
4260 time_t sem_otime;
4261 time_t sem_ctime;
4262 struct sem *sem_base;
4263 struct sem_queue *sem_pending;
4264 struct sem_queue **sem_pending_last;
4265 struct sem_undo *undo;
4266 unsigned long sem_nsems;
4267 };
4268
4269
4270 struct sem_queue {
4271 struct sem_queue * next;
4272 struct sem_queue ** prev;
4273 struct task_struct* sleeper;
4274 struct sem_undo * undo;
4275 int pid;
4276 int status;
4277 struct sem_array * sma;
4278 int id;
4279 struct sembuf * sops;
4280 int nsops;
4281 int alter;
4282 };
4283
4284
4285
4286
4287 struct sem_undo {
4288 struct sem_undo * proc_next;
4289 struct sem_undo * id_next;
4290 int semid;
4291 short * semadj;
4292 };
4293
4294
4295
4296
4297 struct sem_undo_list {
4298 atomic_t refcnt;
4299 spinlock_t lock;
4300 struct sem_undo *proc_list;
4301 };
4302
4303 struct sysv_sem {
4304 struct sem_undo_list *undo_list;
4305 };
4306
4307
4308
4309 extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk);
4310 extern void exit_sem(struct task_struct *tsk);
4311 # 67 "include/linux/sched.h" 2
4312 # 1 "include/linux/signal.h" 1
4313
4314
4315
4316 # 1 "include/asm/signal.h" 1
4317
4318
4319
4320
4321
4322
4323 struct siginfo;
4324 # 17 "include/asm/signal.h"
4325 typedef unsigned long old_sigset_t;
4326
4327 typedef struct {
4328 unsigned long sig[(64 / 32)];
4329 } sigset_t;
4330 # 107 "include/asm/signal.h"
4331 # 1 "include/asm-generic/signal.h" 1
4332 # 17 "include/asm-generic/signal.h"
4333 typedef void __signalfn_t(int);
4334 typedef __signalfn_t *__sighandler_t;
4335
4336 typedef void __restorefn_t(void);
4337 typedef __restorefn_t *__sigrestore_t;
4338 # 108 "include/asm/signal.h" 2
4339
4340
4341 struct old_sigaction {
4342 __sighandler_t sa_handler;
4343 old_sigset_t sa_mask;
4344 unsigned long sa_flags;
4345 void (*sa_restorer) (void);
4346 };
4347
4348 struct sigaction {
4349 __sighandler_t sa_handler;
4350 unsigned long sa_flags;
4351 void (*sa_restorer) (void);
4352 sigset_t sa_mask;
4353 };
4354
4355 struct k_sigaction {
4356 struct sigaction sa;
4357 };
4358 # 145 "include/asm/signal.h"
4359 typedef struct sigaltstack {
4360 void *ss_sp;
4361 int ss_flags;
4362 size_t ss_size;
4363 } stack_t;
4364
4365
4366
4367 # 1 "include/asm/sigcontext.h" 1
4368
4369
4370
4371
4372 struct sigcontext {
4373 unsigned long sc_r0;
4374 unsigned long sc_r1;
4375 unsigned long sc_r2;
4376 unsigned long sc_r3;
4377 unsigned long sc_r4;
4378 unsigned long sc_r5;
4379 unsigned long sc_r6;
4380 unsigned long sc_r7;
4381 unsigned long sc_p0;
4382 unsigned long sc_p1;
4383 unsigned long sc_p2;
4384 unsigned long sc_p3;
4385 unsigned long sc_p4;
4386 unsigned long sc_p5;
4387 unsigned long sc_usp;
4388 unsigned long sc_a0w;
4389 unsigned long sc_a1w;
4390 unsigned long sc_a0x;
4391 unsigned long sc_a1x;
4392 unsigned long sc_astat;
4393 unsigned long sc_rets;
4394 unsigned long sc_pc;
4395 unsigned long sc_retx;
4396 unsigned long sc_fp;
4397 unsigned long sc_i0;
4398 unsigned long sc_i1;
4399 unsigned long sc_i2;
4400 unsigned long sc_i3;
4401 unsigned long sc_m0;
4402 unsigned long sc_m1;
4403 unsigned long sc_m2;
4404 unsigned long sc_m3;
4405 unsigned long sc_l0;
4406 unsigned long sc_l1;
4407 unsigned long sc_l2;
4408 unsigned long sc_l3;
4409 unsigned long sc_b0;
4410 unsigned long sc_b1;
4411 unsigned long sc_b2;
4412 unsigned long sc_b3;
4413 unsigned long sc_lc0;
4414 unsigned long sc_lc1;
4415 unsigned long sc_lt0;
4416 unsigned long sc_lt1;
4417 unsigned long sc_lb0;
4418 unsigned long sc_lb1;
4419 unsigned long sc_seqstat;
4420 };
4421 # 154 "include/asm/signal.h" 2
4422 # 5 "include/linux/signal.h" 2
4423 # 1 "include/asm/siginfo.h" 1
4424
4425
4426
4427
4428 # 1 "include/asm-generic/siginfo.h" 1
4429
4430
4431
4432
4433
4434
4435 typedef union sigval {
4436 int sival_int;
4437 void *sival_ptr;
4438 } sigval_t;
4439 # 40 "include/asm-generic/siginfo.h"
4440 typedef struct siginfo {
4441 int si_signo;
4442 int si_errno;
4443 int si_code;
4444
4445 union {
4446 int _pad[((128 - (3 * sizeof(int))) / sizeof(int))];
4447
4448
4449 struct {
4450 pid_t _pid;
4451 uid_t _uid;
4452 } _kill;
4453
4454
4455 struct {
4456 timer_t _tid;
4457 int _overrun;
4458 char _pad[sizeof( uid_t) - sizeof(int)];
4459 sigval_t _sigval;
4460 int _sys_private;
4461 } _timer;
4462
4463
4464 struct {
4465 pid_t _pid;
4466 uid_t _uid;
4467 sigval_t _sigval;
4468 } _rt;
4469
4470
4471 struct {
4472 pid_t _pid;
4473 uid_t _uid;
4474 int _status;
4475 clock_t _utime;
4476 clock_t _stime;
4477 } _sigchld;
4478
4479
4480 struct {
4481 void *_addr;
4482
4483
4484
4485 } _sigfault;
4486
4487
4488 struct {
4489 long _band;
4490 int _fd;
4491 } _sigpoll;
4492 } _sifields;
4493 } siginfo_t;
4494 # 251 "include/asm-generic/siginfo.h"
4495 typedef struct sigevent {
4496 sigval_t sigev_value;
4497 int sigev_signo;
4498 int sigev_notify;
4499 union {
4500 int _pad[((64 - (sizeof(int) * 2 + sizeof(sigval_t))) / sizeof(int))];
4501 int _tid;
4502
4503 struct {
4504 void (*_function)(sigval_t);
4505 void *_attribute;
4506 } _sigev_thread;
4507 } _sigev_un;
4508 } sigevent_t;
4509
4510
4511
4512
4513
4514
4515
4516 struct siginfo;
4517 void do_schedule_next_timer(struct siginfo *info);
4518
4519
4520
4521
4522
4523 static inline __attribute__((always_inline)) void copy_siginfo(struct siginfo *to, struct siginfo *from)
4524 {
4525 if (from->si_code < 0)
4526 memcpy(to, from, sizeof(*to));
4527 else
4528
4529 memcpy(to, from, (3 * sizeof(int)) + sizeof(from->_sifields._sigchld));
4530 }
4531
4532
4533
4534 extern int copy_siginfo_to_user(struct siginfo *to, struct siginfo *from);
4535 # 6 "include/asm/siginfo.h" 2
4536 # 6 "include/linux/signal.h" 2
4537 # 15 "include/linux/signal.h"
4538 struct sigqueue {
4539 struct list_head list;
4540 int flags;
4541 siginfo_t info;
4542 struct user_struct *user;
4543 };
4544
4545
4546
4547
4548 struct sigpending {
4549 struct list_head list;
4550 sigset_t signal;
4551 };
4552 # 39 "include/linux/signal.h"
4553 static inline __attribute__((always_inline)) void sigaddset(sigset_t *set, int _sig)
4554 {
4555 unsigned long sig = _sig - 1;
4556 if ((64 / 32) == 1)
4557 set->sig[0] |= 1UL << sig;
4558 else
4559 set->sig[sig / 32] |= 1UL << (sig % 32);
4560 }
4561
4562 static inline __attribute__((always_inline)) void sigdelset(sigset_t *set, int _sig)
4563 {
4564 unsigned long sig = _sig - 1;
4565 if ((64 / 32) == 1)
4566 set->sig[0] &= ~(1UL << sig);
4567 else
4568 set->sig[sig / 32] &= ~(1UL << (sig % 32));
4569 }
4570
4571 static inline __attribute__((always_inline)) int sigismember(sigset_t *set, int _sig)
4572 {
4573 unsigned long sig = _sig - 1;
4574 if ((64 / 32) == 1)
4575 return 1 & (set->sig[0] >> sig);
4576 else
4577 return 1 & (set->sig[sig / 32] >> (sig % 32));
4578 }
4579
4580 static inline __attribute__((always_inline)) int sigfindinword(unsigned long word)
4581 {
4582 return __ffs(~(~word));
4583 }
4584
4585
4586
4587 static inline __attribute__((always_inline)) int sigisemptyset(sigset_t *set)
4588 {
4589 extern void _NSIG_WORDS_is_unsupported_size(void);
4590 switch ((64 / 32)) {
4591 case 4:
4592 return (set->sig[3] | set->sig[2] |
4593 set->sig[1] | set->sig[0]) == 0;
4594 case 2:
4595 return (set->sig[1] | set->sig[0]) == 0;
4596 case 1:
4597 return set->sig[0] == 0;
4598 default:
4599 _NSIG_WORDS_is_unsupported_size();
4600 return 0;
4601 }
4602 }
4603 # 120 "include/linux/signal.h"
4604 static inline __attribute__((always_inline)) void sigorsets(sigset_t *r, const sigset_t *a, const sigset_t *b) { extern void _NSIG_WORDS_is_unsupported_size(void); unsigned long a0, a1, a2, a3, b0, b1, b2, b3; switch ((64 / 32)) { case 4: a3 = a->sig[3]; a2 = a->sig[2]; b3 = b->sig[3]; b2 = b->sig[2]; r->sig[3] = ((a3) | (b3)); r->sig[2] = ((a2) | (b2)); case 2: a1 = a->sig[1]; b1 = b->sig[1]; r->sig[1] = ((a1) | (b1)); case 1: a0 = a->sig[0]; b0 = b->sig[0]; r->sig[0] = ((a0) | (b0)); break; default: _NSIG_WORDS_is_unsupported_size(); } }
4605
4606
4607 static inline __attribute__((always_inline)) void sigandsets(sigset_t *r, const sigset_t *a, const sigset_t *b) { extern void _NSIG_WORDS_is_unsupported_size(void); unsigned long a0, a1, a2, a3, b0, b1, b2, b3; switch ((64 / 32)) { case 4: a3 = a->sig[3]; a2 = a->sig[2]; b3 = b->sig[3]; b2 = b->sig[2]; r->sig[3] = ((a3) & (b3)); r->sig[2] = ((a2) & (b2)); case 2: a1 = a->sig[1]; b1 = b->sig[1]; r->sig[1] = ((a1) & (b1)); case 1: a0 = a->sig[0]; b0 = b->sig[0]; r->sig[0] = ((a0) & (b0)); break; default: _NSIG_WORDS_is_unsupported_size(); } }
4608
4609
4610 static inline __attribute__((always_inline)) void signandsets(sigset_t *r, const sigset_t *a, const sigset_t *b) { extern void _NSIG_WORDS_is_unsupported_size(void); unsigned long a0, a1, a2, a3, b0, b1, b2, b3; switch ((64 / 32)) { case 4: a3 = a->sig[3]; a2 = a->sig[2]; b3 = b->sig[3]; b2 = b->sig[2]; r->sig[3] = ((a3) & ~(b3)); r->sig[2] = ((a2) & ~(b2)); case 2: a1 = a->sig[1]; b1 = b->sig[1]; r->sig[1] = ((a1) & ~(b1)); case 1: a0 = a->sig[0]; b0 = b->sig[0]; r->sig[0] = ((a0) & ~(b0)); break; default: _NSIG_WORDS_is_unsupported_size(); } }
4611 # 150 "include/linux/signal.h"
4612 static inline __attribute__((always_inline)) void signotset(sigset_t *set) { extern void _NSIG_WORDS_is_unsupported_size(void); switch ((64 / 32)) { case 4: set->sig[3] = (~(set->sig[3])); set->sig[2] = (~(set->sig[2])); case 2: set->sig[1] = (~(set->sig[1])); case 1: set->sig[0] = (~(set->sig[0])); break; default: _NSIG_WORDS_is_unsupported_size(); } }
4613
4614
4615
4616
4617 static inline __attribute__((always_inline)) void sigemptyset(sigset_t *set)
4618 {
4619 switch ((64 / 32)) {
4620 default:
4621 memset(set, 0, sizeof(sigset_t));
4622 break;
4623 case 2: set->sig[1] = 0;
4624 case 1: set->sig[0] = 0;
4625 break;
4626 }
4627 }
4628
4629 static inline __attribute__((always_inline)) void sigfillset(sigset_t *set)
4630 {
4631 switch ((64 / 32)) {
4632 default:
4633 memset(set, -1, sizeof(sigset_t));
4634 break;
4635 case 2: set->sig[1] = -1;
4636 case 1: set->sig[0] = -1;
4637 break;
4638 }
4639 }
4640
4641
4642
4643 static inline __attribute__((always_inline)) void sigaddsetmask(sigset_t *set, unsigned long mask)
4644 {
4645 set->sig[0] |= mask;
4646 }
4647
4648 static inline __attribute__((always_inline)) void sigdelsetmask(sigset_t *set, unsigned long mask)
4649 {
4650 set->sig[0] &= ~mask;
4651 }
4652
4653 static inline __attribute__((always_inline)) int sigtestsetmask(sigset_t *set, unsigned long mask)
4654 {
4655 return (set->sig[0] & mask) != 0;
4656 }
4657
4658 static inline __attribute__((always_inline)) void siginitset(sigset_t *set, unsigned long mask)
4659 {
4660 set->sig[0] = mask;
4661 switch ((64 / 32)) {
4662 default:
4663 memset(&set->sig[1], 0, sizeof(long)*((64 / 32)-1));
4664 break;
4665 case 2: set->sig[1] = 0;
4666 case 1: ;
4667 }
4668 }
4669
4670 static inline __attribute__((always_inline)) void siginitsetinv(sigset_t *set, unsigned long mask)
4671 {
4672 set->sig[0] = ~mask;
4673 switch ((64 / 32)) {
4674 default:
4675 memset(&set->sig[1], -1, sizeof(long)*((64 / 32)-1));
4676 break;
4677 case 2: set->sig[1] = -1;
4678 case 1: ;
4679 }
4680 }
4681
4682
4683
4684 static inline __attribute__((always_inline)) void init_sigpending(struct sigpending *sig)
4685 {
4686 sigemptyset(&sig->signal);
4687 INIT_LIST_HEAD(&sig->list);
4688 }
4689
4690 extern void flush_sigqueue(struct sigpending *queue);
4691
4692
4693 static inline __attribute__((always_inline)) int valid_signal(unsigned long sig)
4694 {
4695 return sig <= 64 ? 1 : 0;
4696 }
4697
4698 extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p);
4699 extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *);
4700 extern long do_sigpending(void *, unsigned long);
4701 extern int sigprocmask(int, sigset_t *, sigset_t *);
4702
4703 struct pt_regs;
4704 extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie);
4705
4706 extern struct kmem_cache *sighand_cachep;
4707 # 68 "include/linux/sched.h" 2
4708 # 1 "include/linux/securebits.h" 1
4709
4710
4711
4712
4713
4714 extern unsigned securebits;
4715 # 69 "include/linux/sched.h" 2
4716 # 1 "include/linux/fs_struct.h" 1
4717
4718
4719
4720 struct dentry;
4721 struct vfsmount;
4722
4723 struct fs_struct {
4724 atomic_t count;
4725 rwlock_t lock;
4726 int umask;
4727 struct dentry * root, * pwd, * altroot;
4728 struct vfsmount * rootmnt, * pwdmnt, * altrootmnt;
4729 };
4730
4731
4732
4733
4734
4735
4736
4737 extern struct kmem_cache *fs_cachep;
4738
4739 extern void exit_fs(struct task_struct *);
4740 extern void set_fs_altroot(void);
4741 extern void set_fs_root(struct fs_struct *, struct vfsmount *, struct dentry *);
4742 extern void set_fs_pwd(struct fs_struct *, struct vfsmount *, struct dentry *);
4743 extern struct fs_struct *copy_fs_struct(struct fs_struct *);
4744 extern void put_fs_struct(struct fs_struct *);
4745 # 70 "include/linux/sched.h" 2
4746
4747 # 1 "include/linux/completion.h" 1
4748 # 13 "include/linux/completion.h"
4749 struct completion {
4750 unsigned int done;
4751 wait_queue_head_t wait;
4752 };
4753 # 39 "include/linux/completion.h"
4754 static inline __attribute__((always_inline)) void init_completion(struct completion *x)
4755 {
4756 x->done = 0;
4757 init_waitqueue_head(&x->wait);
4758 }
4759
4760 extern void wait_for_completion(struct completion *);
4761 extern int wait_for_completion_interruptible(struct completion *x);
4762 extern unsigned long wait_for_completion_timeout(struct completion *x, unsigned long timeout);
4763
4764 extern unsigned long wait_for_completion_interruptible_timeout( struct completion *x, unsigned long timeout);
4765
4766
4767 extern void complete(struct completion *);
4768 extern void complete_all(struct completion *);
4769 # 72 "include/linux/sched.h" 2
4770 # 1 "include/linux/pid.h" 1
4771
4772
4773
4774 # 1 "include/linux/rcupdate.h" 1
4775 # 38 "include/linux/rcupdate.h"
4776 # 1 "include/linux/cache.h" 1
4777 # 39 "include/linux/rcupdate.h" 2
4778
4779
4780 # 1 "include/linux/percpu.h" 1
4781
4782
4783
4784
4785 # 1 "include/linux/slab.h" 1
4786 # 14 "include/linux/slab.h"
4787 # 1 "include/linux/gfp.h" 1
4788
4789
4790
4791 # 1 "include/linux/mmzone.h" 1
4792 # 13 "include/linux/mmzone.h"
4793 # 1 "include/linux/init.h" 1
4794 # 63 "include/linux/init.h"
4795 typedef int (*initcall_t)(void);
4796 typedef void (*exitcall_t)(void);
4797
4798 extern initcall_t __con_initcall_start[], __con_initcall_end[];
4799 extern initcall_t __security_initcall_start[], __security_initcall_end[];
4800
4801
4802 extern char __attribute__ ((__section__ (".init.data"))) boot_command_line[];
4803 extern char *saved_command_line;
4804 extern unsigned int reset_devices;
4805
4806
4807 extern void setup_arch(char **);
4808 # 134 "include/linux/init.h"
4809 struct obs_kernel_param {
4810 const char *str;
4811 int (*setup_func)(char *);
4812 int early;
4813 };
4814 # 169 "include/linux/init.h"
4815 void __attribute__ ((__section__ (".init.text"))) parse_early_param(void);
4816 # 14 "include/linux/mmzone.h" 2
4817 # 27 "include/linux/mmzone.h"
4818 struct free_area {
4819 struct list_head free_list;
4820 unsigned long nr_free;
4821 };
4822
4823 struct pglist_data;
4824 # 49 "include/linux/mmzone.h"
4825 enum zone_stat_item {
4826
4827 NR_FREE_PAGES,
4828 NR_INACTIVE,
4829 NR_ACTIVE,
4830 NR_ANON_PAGES,
4831 NR_FILE_MAPPED,
4832
4833 NR_FILE_PAGES,
4834 NR_FILE_DIRTY,
4835 NR_WRITEBACK,
4836
4837 NR_SLAB_RECLAIMABLE,
4838 NR_SLAB_UNRECLAIMABLE,
4839 NR_PAGETABLE,
4840 NR_UNSTABLE_NFS,
4841 NR_BOUNCE,
4842 NR_VMSCAN_WRITE,
4843 # 75 "include/linux/mmzone.h"
4844 NR_VM_ZONE_STAT_ITEMS };
4845
4846 struct per_cpu_pages {
4847 int count;
4848 int high;
4849 int batch;
4850 struct list_head list;
4851 };
4852
4853 struct per_cpu_pageset {
4854 struct per_cpu_pages pcp[2];
4855
4856
4857
4858
4859 } ;
4860
4861
4862
4863
4864
4865
4866
4867 enum zone_type {
4868 # 119 "include/linux/mmzone.h"
4869 ZONE_DMA,
4870 # 134 "include/linux/mmzone.h"
4871 ZONE_NORMAL,
4872 # 146 "include/linux/mmzone.h"
4873 MAX_NR_ZONES
4874 };
4875 # 179 "include/linux/mmzone.h"
4876 struct zone {
4877
4878 unsigned long pages_min, pages_low, pages_high;
4879 # 190 "include/linux/mmzone.h"
4880 unsigned long lowmem_reserve[MAX_NR_ZONES];
4881
4882 unsigned long max_pagecache_pages;
4883 # 203 "include/linux/mmzone.h"
4884 struct per_cpu_pageset pageset[1];
4885
4886
4887
4888
4889 spinlock_t lock;
4890
4891
4892
4893
4894 struct free_area free_area[14];
4895
4896
4897
4898
4899
4900
4901
4902 spinlock_t lru_lock;
4903 struct list_head active_list;
4904 struct list_head inactive_list;
4905 unsigned long nr_scan_active;
4906 unsigned long nr_scan_inactive;
4907 unsigned long pages_scanned;
4908 int all_unreclaimable;
4909
4910
4911 atomic_t reclaim_in_progress;
4912
4913
4914 atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
4915 # 248 "include/linux/mmzone.h"
4916 int prev_priority;
4917
4918
4919
4920 # 278 "include/linux/mmzone.h"
4921 wait_queue_head_t * wait_table;
4922 unsigned long wait_table_hash_nr_entries;
4923 unsigned long wait_table_bits;
4924
4925
4926
4927
4928 struct pglist_data *zone_pgdat;
4929
4930 unsigned long zone_start_pfn;
4931 # 299 "include/linux/mmzone.h"
4932 unsigned long spanned_pages;
4933 unsigned long present_pages;
4934
4935
4936
4937
4938 const char *name;
4939 } ;
4940 # 384 "include/linux/mmzone.h"
4941 struct zonelist_cache;
4942 # 397 "include/linux/mmzone.h"
4943 struct zonelist {
4944 struct zonelist_cache *zlcache_ptr;
4945 struct zone *zones[((1 << 0) * MAX_NR_ZONES) + 1];
4946
4947
4948
4949 };
4950 # 415 "include/linux/mmzone.h"
4951 extern struct page *mem_map;
4952 # 429 "include/linux/mmzone.h"
4953 struct bootmem_data;
4954 typedef struct pglist_data {
4955 struct zone node_zones[MAX_NR_ZONES];
4956 struct zonelist node_zonelists[MAX_NR_ZONES];
4957 int nr_zones;
4958
4959 struct page *node_mem_map;
4960
4961 struct bootmem_data *bdata;
4962 # 448 "include/linux/mmzone.h"
4963 unsigned long node_start_pfn;
4964 unsigned long node_present_pages;
4965 unsigned long node_spanned_pages;
4966
4967 int node_id;
4968 wait_queue_head_t kswapd_wait;
4969 struct task_struct *kswapd;
4970 int kswapd_max_order;
4971 } pg_data_t;
4972 # 467 "include/linux/mmzone.h"
4973 # 1 "include/linux/memory_hotplug.h" 1
4974
4975
4976
4977 # 1 "include/linux/mmzone.h" 1
4978 # 5 "include/linux/memory_hotplug.h" 2
4979
4980
4981 # 1 "include/linux/notifier.h" 1
4982 # 13 "include/linux/notifier.h"
4983 # 1 "include/linux/mutex.h" 1
4984 # 47 "include/linux/mutex.h"
4985 struct mutex {
4986
4987 atomic_t count;
4988 spinlock_t wait_lock;
4989 struct list_head wait_list;
4990 # 60 "include/linux/mutex.h"
4991 };
4992
4993
4994
4995
4996
4997 struct mutex_waiter {
4998 struct list_head list;
4999 struct task_struct *task;
5000
5001
5002
5003
5004 };
5005 # 105 "include/linux/mutex.h"
5006 extern void __mutex_init(struct mutex *lock, const char *name,
5007 struct lock_class_key *key);
5008
5009
5010
5011
5012
5013
5014
5015 static inline __attribute__((always_inline)) int mutex_is_locked(struct mutex *lock)
5016 {
5017 return ((&lock->count)->counter) != 1;
5018 }
5019
5020
5021
5022
5023
5024 extern void mutex_lock(struct mutex *lock);
5025 extern int mutex_lock_interruptible(struct mutex *lock);
5026 # 138 "include/linux/mutex.h"
5027 extern int mutex_trylock(struct mutex *lock);
5028 extern void mutex_unlock(struct mutex *lock);
5029 # 14 "include/linux/notifier.h" 2
5030
5031 # 1 "include/linux/srcu.h" 1
5032 # 30 "include/linux/srcu.h"
5033 struct srcu_struct_array {
5034 int c[2];
5035 };
5036
5037 struct srcu_struct {
5038 int completed;
5039 struct srcu_struct_array *per_cpu_ref;
5040 struct mutex mutex;
5041 };
5042
5043
5044
5045
5046
5047
5048
5049 int init_srcu_struct(struct srcu_struct *sp);
5050 void cleanup_srcu_struct(struct srcu_struct *sp);
5051 int srcu_read_lock(struct srcu_struct *sp) ;
5052 void srcu_read_unlock(struct srcu_struct *sp, int idx) ;
5053 void synchronize_srcu(struct srcu_struct *sp);
5054 long srcu_batches_completed(struct srcu_struct *sp);
5055 # 16 "include/linux/notifier.h" 2
5056 # 50 "include/linux/notifier.h"
5057 struct notifier_block {
5058 int (*notifier_call)(struct notifier_block *, unsigned long, void *);
5059 struct notifier_block *next;
5060 int priority;
5061 };
5062
5063 struct atomic_notifier_head {
5064 spinlock_t lock;
5065 struct notifier_block *head;
5066 };
5067
5068 struct blocking_notifier_head {
5069 struct rw_semaphore rwsem;
5070 struct notifier_block *head;
5071 };
5072
5073 struct raw_notifier_head {
5074 struct notifier_block *head;
5075 };
5076
5077 struct srcu_notifier_head {
5078 struct mutex mutex;
5079 struct srcu_struct srcu;
5080 struct notifier_block *head;
5081 };
5082 # 89 "include/linux/notifier.h"
5083 extern void srcu_init_notifier_head(struct srcu_notifier_head *nh);
5084 # 115 "include/linux/notifier.h"
5085 extern int atomic_notifier_chain_register(struct atomic_notifier_head *,
5086 struct notifier_block *);
5087 extern int blocking_notifier_chain_register(struct blocking_notifier_head *,
5088 struct notifier_block *);
5089 extern int raw_notifier_chain_register(struct raw_notifier_head *,
5090 struct notifier_block *);
5091 extern int srcu_notifier_chain_register(struct srcu_notifier_head *,
5092 struct notifier_block *);
5093
5094 extern int atomic_notifier_chain_unregister(struct atomic_notifier_head *,
5095 struct notifier_block *);
5096 extern int blocking_notifier_chain_unregister(struct blocking_notifier_head *,
5097 struct notifier_block *);
5098 extern int raw_notifier_chain_unregister(struct raw_notifier_head *,
5099 struct notifier_block *);
5100 extern int srcu_notifier_chain_unregister(struct srcu_notifier_head *,
5101 struct notifier_block *);
5102
5103 extern int atomic_notifier_call_chain(struct atomic_notifier_head *,
5104 unsigned long val, void *v);
5105 extern int blocking_notifier_call_chain(struct blocking_notifier_head *,
5106 unsigned long val, void *v);
5107 extern int raw_notifier_call_chain(struct raw_notifier_head *,
5108 unsigned long val, void *v);
5109 extern int srcu_notifier_call_chain(struct srcu_notifier_head *,
5110 unsigned long val, void *v);
5111 # 8 "include/linux/memory_hotplug.h" 2
5112
5113 struct page;
5114 struct zone;
5115 struct pglist_data;
5116 # 140 "include/linux/memory_hotplug.h"
5117 static inline __attribute__((always_inline)) void pgdat_resize_lock(struct pglist_data *p, unsigned long *f) {}
5118 static inline __attribute__((always_inline)) void pgdat_resize_unlock(struct pglist_data *p, unsigned long *f) {}
5119 static inline __attribute__((always_inline)) void pgdat_resize_init(struct pglist_data *pgdat) {}
5120
5121 static inline __attribute__((always_inline)) unsigned zone_span_seqbegin(struct zone *zone)
5122 {
5123 return 0;
5124 }
5125 static inline __attribute__((always_inline)) int zone_span_seqretry(struct zone *zone, unsigned iv)
5126 {
5127 return 0;
5128 }
5129 static inline __attribute__((always_inline)) void zone_span_writelock(struct zone *zone) {}
5130 static inline __attribute__((always_inline)) void zone_span_writeunlock(struct zone *zone) {}
5131 static inline __attribute__((always_inline)) void zone_seqlock_init(struct zone *zone) {}
5132
5133 static inline __attribute__((always_inline)) int mhp_notimplemented(const char *func)
5134 {
5135 printk("<4>" "%s() called, with CONFIG_MEMORY_HOTPLUG disabled\n", func);
5136 dump_stack();
5137 return -38;
5138 }
5139
5140
5141 static inline __attribute__((always_inline)) int __remove_pages(struct zone *zone, unsigned long start_pfn,
5142 unsigned long nr_pages)
5143 {
5144 printk("<4>" "%s() called, not yet supported\n", (__func__));
5145 dump_stack();
5146 return -38;
5147 }
5148
5149 extern int add_memory(int nid, u64 start, u64 size);
5150 extern int arch_add_memory(int nid, u64 start, u64 size);
5151 extern int remove_memory(u64 start, u64 size);
5152 extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn,
5153 int nr_pages);
5154 # 468 "include/linux/mmzone.h" 2
5155
5156 void get_zone_counts(unsigned long *active, unsigned long *inactive,
5157 unsigned long *free);
5158 void build_all_zonelists(void);
5159 void wakeup_kswapd(struct zone *zone, int order);
5160 int zone_watermark_ok(struct zone *z, int order, unsigned long mark,
5161 int classzone_idx, int alloc_flags);
5162 enum memmap_context {
5163 MEMMAP_EARLY,
5164 MEMMAP_HOTPLUG,
5165 };
5166 extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn,
5167 unsigned long size,
5168 enum memmap_context context);
5169
5170
5171
5172
5173 static inline __attribute__((always_inline)) void memory_present(int nid, unsigned long start, unsigned long end) {}
5174 # 498 "include/linux/mmzone.h"
5175 static inline __attribute__((always_inline)) int populated_zone(struct zone *zone)
5176 {
5177 return (!!zone->present_pages);
5178 }
5179
5180 static inline __attribute__((always_inline)) int is_highmem_idx(enum zone_type idx)
5181 {
5182
5183
5184
5185 return 0;
5186
5187 }
5188
5189 static inline __attribute__((always_inline)) int is_normal_idx(enum zone_type idx)
5190 {
5191 return (idx == ZONE_NORMAL);
5192 }
5193
5194
5195
5196
5197
5198
5199
5200 static inline __attribute__((always_inline)) int is_highmem(struct zone *zone)
5201 {
5202
5203
5204
5205 return 0;
5206
5207 }
5208
5209 static inline __attribute__((always_inline)) int is_normal(struct zone *zone)
5210 {
5211 return zone == zone->zone_pgdat->node_zones + ZONE_NORMAL;
5212 }
5213
5214 static inline __attribute__((always_inline)) int is_dma32(struct zone *zone)
5215 {
5216
5217
5218
5219 return 0;
5220
5221 }
5222
5223 static inline __attribute__((always_inline)) int is_dma(struct zone *zone)
5224 {
5225
5226 return zone == zone->zone_pgdat->node_zones + ZONE_DMA;
5227
5228
5229
5230 }
5231
5232
5233 struct ctl_table;
5234 struct file;
5235 int min_free_kbytes_sysctl_handler(struct ctl_table *, int, struct file *,
5236 void *, size_t *, loff_t *);
5237 extern int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1];
5238 int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, struct file *,
5239 void *, size_t *, loff_t *);
5240 int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *, int, struct file *,
5241 void *, size_t *, loff_t *);
5242 int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int,
5243 struct file *, void *, size_t *, loff_t *);
5244 int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int,
5245 struct file *, void *, size_t *, loff_t *);
5246 int sysctl_pagecache_ratio_sysctl_handler(struct ctl_table *, int,
5247 struct file *, void *, size_t *, loff_t *);
5248
5249 # 1 "include/linux/topology.h" 1
5250 # 34 "include/linux/topology.h"
5251 # 1 "include/asm/topology.h" 1
5252
5253
5254
5255 # 1 "include/asm-generic/topology.h" 1
5256 # 5 "include/asm/topology.h" 2
5257 # 35 "include/linux/topology.h" 2
5258 # 573 "include/linux/mmzone.h" 2
5259
5260
5261
5262
5263
5264
5265
5266 extern struct pglist_data contig_page_data;
5267 # 591 "include/linux/mmzone.h"
5268 extern struct pglist_data *first_online_pgdat(void);
5269 extern struct pglist_data *next_online_pgdat(struct pglist_data *pgdat);
5270 extern struct zone *next_zone(struct zone *zone);
5271 # 790 "include/linux/mmzone.h"
5272 void memory_present(int nid, unsigned long start, unsigned long end);
5273 unsigned long __attribute__ ((__section__ (".init.text"))) node_memmap_size_bytes(int, unsigned long, unsigned long);
5274 # 5 "include/linux/gfp.h" 2
5275
5276
5277
5278 struct vm_area_struct;
5279 # 87 "include/linux/gfp.h"
5280 static inline __attribute__((always_inline)) enum zone_type gfp_zone(gfp_t flags)
5281 {
5282
5283 if (flags & (( gfp_t)0x01u))
5284 return ZONE_DMA;
5285 # 101 "include/linux/gfp.h"
5286 return ZONE_NORMAL;
5287 }
5288 # 120 "include/linux/gfp.h"
5289 static inline __attribute__((always_inline)) void arch_free_page(struct page *page, int order) { }
5290
5291
5292 static inline __attribute__((always_inline)) void arch_alloc_page(struct page *page, int order) { }
5293
5294
5295 extern struct page *
5296 __alloc_pages(gfp_t, unsigned int, struct zonelist *);
5297
5298 static inline __attribute__((always_inline)) struct page *alloc_pages_node(int nid, gfp_t gfp_mask,
5299 unsigned int order)
5300 {
5301 if (__builtin_expect(!!(order >= 14), 0))
5302 return ((void *)0);
5303
5304
5305 if (nid < 0)
5306 nid = ((0));
5307
5308 return __alloc_pages(gfp_mask, order,
5309 (&contig_page_data)->node_zonelists + gfp_zone(gfp_mask));
5310 }
5311 # 163 "include/linux/gfp.h"
5312 extern unsigned long __get_free_pages(gfp_t gfp_mask, unsigned int order);
5313 extern unsigned long get_zeroed_page(gfp_t gfp_mask);
5314
5315
5316
5317
5318
5319
5320
5321 extern void __free_pages(struct page *page, unsigned int order);
5322 extern void free_pages(unsigned long addr, unsigned int order);
5323 extern void free_hot_page(struct page *page);
5324 extern void free_cold_page(struct page *page);
5325
5326
5327
5328
5329 void page_alloc_init(void);
5330
5331
5332
5333 static inline __attribute__((always_inline)) void drain_node_pages(int node) { };
5334 # 15 "include/linux/slab.h" 2
5335
5336
5337 typedef struct kmem_cache kmem_cache_t __attribute__((deprecated));
5338 # 44 "include/linux/slab.h"
5339 void __attribute__ ((__section__ (".init.text"))) kmem_cache_init(void);
5340 extern int slab_is_available(void);
5341
5342 struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
5343 unsigned long,
5344 void (*)(void *, struct kmem_cache *, unsigned long),
5345 void (*)(void *, struct kmem_cache *, unsigned long));
5346 void kmem_cache_destroy(struct kmem_cache *);
5347 int kmem_cache_shrink(struct kmem_cache *);
5348 void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
5349 void *kmem_cache_zalloc(struct kmem_cache *, gfp_t);
5350 void kmem_cache_free(struct kmem_cache *, void *);
5351 unsigned int kmem_cache_size(struct kmem_cache *);
5352 const char *kmem_cache_name(struct kmem_cache *);
5353 int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr);
5354
5355
5356
5357
5358 static inline __attribute__((always_inline)) void *kmem_cache_alloc_node(struct kmem_cache *cachep,
5359 gfp_t flags, int node)
5360 {
5361 return kmem_cache_alloc(cachep, flags);
5362 }
5363
5364
5365
5366
5367
5368 void *__kmalloc(size_t, gfp_t);
5369 void *__kzalloc(size_t, gfp_t);
5370 void kfree(const void *);
5371 unsigned int ksize(const void *);
5372
5373
5374
5375
5376
5377
5378
5379 static inline __attribute__((always_inline)) void *kcalloc(size_t n, size_t size, gfp_t flags)
5380 {
5381 if (n != 0 && size > (~0UL) / n)
5382 return ((void *)0);
5383 return __kzalloc(n * size, flags);
5384 }
5385 # 98 "include/linux/slab.h"
5386 # 1 "include/linux/slab_def.h" 1
5387 # 19 "include/linux/slab_def.h"
5388 struct cache_sizes {
5389 size_t cs_size;
5390 struct kmem_cache *cs_cachep;
5391
5392 struct kmem_cache *cs_dmacachep;
5393
5394 };
5395 extern struct cache_sizes malloc_sizes[];
5396
5397 static inline __attribute__((always_inline)) void *kmalloc(size_t size, gfp_t flags)
5398 {
5399 if (__builtin_constant_p(size)) {
5400 int i = 0;
5401
5402
5403
5404
5405
5406 # 1 "include/linux/kmalloc_sizes.h" 1
5407
5408 if (size <= 32) goto found; else i++;
5409
5410 if (size <= 64) goto found; else i++;
5411
5412 if (size <= 96) goto found; else i++;
5413
5414 if (size <= 128) goto found; else i++;
5415
5416 if (size <= 192) goto found; else i++;
5417
5418 if (size <= 256) goto found; else i++;
5419 if (size <= 512) goto found; else i++;
5420 if (size <= 1024) goto found; else i++;
5421 if (size <= 2048) goto found; else i++;
5422 if (size <= 4096) goto found; else i++;
5423 if (size <= 8192) goto found; else i++;
5424 if (size <= 16384) goto found; else i++;
5425 if (size <= 32768) goto found; else i++;
5426 if (size <= 65536) goto found; else i++;
5427 if (size <= 131072) goto found; else i++;
5428
5429 if (size <= 262144) goto found; else i++;
5430
5431
5432 if (size <= 524288) goto found; else i++;
5433 if (size <= 1048576) goto found; else i++;
5434
5435 if (size <= 2097152) goto found; else i++;
5436 if (size <= 4194304) goto found; else i++;
5437 if (size <= 8388608) goto found; else i++;
5438 if (size <= 16777216) goto found; else i++;
5439 if (size <= 33554432) goto found; else i++;
5440 # 38 "include/linux/slab_def.h" 2
5441
5442 {
5443 extern void __you_cannot_kmalloc_that_much(void);
5444 __you_cannot_kmalloc_that_much();
5445 }
5446 found:
5447
5448 if (flags & (( gfp_t)0x01u))
5449 return kmem_cache_alloc(malloc_sizes[i].cs_dmacachep,
5450 flags);
5451
5452 return kmem_cache_alloc(malloc_sizes[i].cs_cachep, flags);
5453 }
5454 return __kmalloc(size, flags);
5455 }
5456
5457 static inline __attribute__((always_inline)) void *kzalloc(size_t size, gfp_t flags)
5458 {
5459 if (__builtin_constant_p(size)) {
5460 int i = 0;
5461
5462
5463
5464
5465
5466 # 1 "include/linux/kmalloc_sizes.h" 1
5467
5468 if (size <= 32) goto found; else i++;
5469
5470 if (size <= 64) goto found; else i++;
5471
5472 if (size <= 96) goto found; else i++;
5473
5474 if (size <= 128) goto found; else i++;
5475
5476 if (size <= 192) goto found; else i++;
5477
5478 if (size <= 256) goto found; else i++;
5479 if (size <= 512) goto found; else i++;
5480 if (size <= 1024) goto found; else i++;
5481 if (size <= 2048) goto found; else i++;
5482 if (size <= 4096) goto found; else i++;
5483 if (size <= 8192) goto found; else i++;
5484 if (size <= 16384) goto found; else i++;
5485 if (size <= 32768) goto found; else i++;
5486 if (size <= 65536) goto found; else i++;
5487 if (size <= 131072) goto found; else i++;
5488
5489 if (size <= 262144) goto found; else i++;
5490
5491
5492 if (size <= 524288) goto found; else i++;
5493 if (size <= 1048576) goto found; else i++;
5494
5495 if (size <= 2097152) goto found; else i++;
5496 if (size <= 4194304) goto found; else i++;
5497 if (size <= 8388608) goto found; else i++;
5498 if (size <= 16777216) goto found; else i++;
5499 if (size <= 33554432) goto found; else i++;
5500 # 64 "include/linux/slab_def.h" 2
5501
5502 {
5503 extern void __you_cannot_kzalloc_that_much(void);
5504 __you_cannot_kzalloc_that_much();
5505 }
5506 found:
5507
5508 if (flags & (( gfp_t)0x01u))
5509 return kmem_cache_zalloc(malloc_sizes[i].cs_dmacachep,
5510 flags);
5511
5512 return kmem_cache_zalloc(malloc_sizes[i].cs_cachep, flags);
5513 }
5514 return __kzalloc(size, flags);
5515 }
5516 # 99 "include/linux/slab.h" 2
5517 # 167 "include/linux/slab.h"
5518 static inline __attribute__((always_inline)) void *kmalloc_node(size_t size, gfp_t flags, int node)
5519 {
5520 return kmalloc(size, flags);
5521 }
5522
5523 static inline __attribute__((always_inline)) void *__kmalloc_node(size_t size, gfp_t flags, int node)
5524 {
5525 return __kmalloc(size, flags);
5526 }
5527 # 6 "include/linux/percpu.h" 2
5528
5529
5530
5531
5532 # 1 "include/asm/percpu.h" 1
5533
5534
5535
5536 # 1 "include/asm-generic/percpu.h" 1
5537 # 5 "include/asm/percpu.h" 2
5538 # 11 "include/linux/percpu.h" 2
5539 # 57 "include/linux/percpu.h"
5540 static inline __attribute__((always_inline)) void percpu_depopulate(void *__pdata, int cpu)
5541 {
5542 }
5543
5544 static inline __attribute__((always_inline)) void __percpu_depopulate_mask(void *__pdata, cpumask_t *mask)
5545 {
5546 }
5547
5548 static inline __attribute__((always_inline)) void *percpu_populate(void *__pdata, size_t size, gfp_t gfp,
5549 int cpu)
5550 {
5551 return ({ (void)(cpu); (__pdata); });
5552 }
5553
5554 static inline __attribute__((always_inline)) int __percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp,
5555 cpumask_t *mask)
5556 {
5557 return 0;
5558 }
5559
5560 static inline __attribute__((always_inline)) __attribute__((always_inline)) void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask)
5561 {
5562 return kzalloc(size, gfp);
5563 }
5564
5565 static inline __attribute__((always_inline)) void percpu_free(void *__pdata)
5566 {
5567 kfree(__pdata);
5568 }
5569 # 42 "include/linux/rcupdate.h" 2
5570 # 50 "include/linux/rcupdate.h"
5571 struct rcu_head {
5572 struct rcu_head *next;
5573 void (*func)(struct rcu_head *head);
5574 };
5575 # 64 "include/linux/rcupdate.h"
5576 struct rcu_ctrlblk {
5577 long cur;
5578 long completed;
5579 int next_pending;
5580
5581 int signaled;
5582
5583 spinlock_t lock ;
5584 cpumask_t cpumask;
5585
5586 } ;
5587
5588
5589 static inline __attribute__((always_inline)) int rcu_batch_before(long a, long b)
5590 {
5591 return (a - b) < 0;
5592 }
5593
5594
5595 static inline __attribute__((always_inline)) int rcu_batch_after(long a, long b)
5596 {
5597 return (a - b) > 0;
5598 }
5599
5600
5601
5602
5603
5604
5605 struct rcu_data {
5606
5607 long quiescbatch;
5608 int passed_quiesc;
5609 int qs_pending;
5610
5611
5612 long batch;
5613 struct rcu_head *nxtlist;
5614 struct rcu_head **nxttail;
5615 long qlen;
5616 struct rcu_head *curlist;
5617 struct rcu_head **curtail;
5618 struct rcu_head *donelist;
5619 struct rcu_head **donetail;
5620 long blimit;
5621 int cpu;
5622 struct rcu_head barrier;
5623 };
5624
5625 extern __typeof__(struct rcu_data) per_cpu__rcu_data;
5626 extern __typeof__(struct rcu_data) per_cpu__rcu_bh_data;
5627
5628
5629
5630
5631
5632
5633
5634 static inline __attribute__((always_inline)) void rcu_qsctr_inc(int cpu)
5635 {
5636 struct rcu_data *rdp = &(*((void)(cpu), &per_cpu__rcu_data));
5637 rdp->passed_quiesc = 1;
5638 }
5639 static inline __attribute__((always_inline)) void rcu_bh_qsctr_inc(int cpu)
5640 {
5641 struct rcu_data *rdp = &(*((void)(cpu), &per_cpu__rcu_bh_data));
5642 rdp->passed_quiesc = 1;
5643 }
5644
5645 extern int rcu_pending(int cpu);
5646 extern int rcu_needs_cpu(int cpu);
5647 # 272 "include/linux/rcupdate.h"
5648 extern void rcu_init(void);
5649 extern void rcu_check_callbacks(int cpu, int user);
5650 extern void rcu_restart_cpu(int cpu);
5651 extern long rcu_batches_completed(void);
5652 extern long rcu_batches_completed_bh(void);
5653
5654
5655 extern void call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *head));
5656
5657 extern void call_rcu_bh(struct rcu_head *head, void (*func)(struct rcu_head *head));
5658
5659 extern void synchronize_rcu(void);
5660 void synchronize_idle(void);
5661 extern void rcu_barrier(void);
5662 # 5 "include/linux/pid.h" 2
5663
5664 enum pid_type
5665 {
5666 PIDTYPE_PID,
5667 PIDTYPE_PGID,
5668 PIDTYPE_SID,
5669 PIDTYPE_MAX
5670 };
5671 # 43 "include/linux/pid.h"
5672 struct pid
5673 {
5674 atomic_t count;
5675
5676 int nr;
5677 struct hlist_node pid_chain;
5678
5679 struct hlist_head tasks[PIDTYPE_MAX];
5680 struct rcu_head rcu;
5681 };
5682
5683 struct pid_link
5684 {
5685 struct hlist_node node;
5686 struct pid *pid;
5687 };
5688
5689 static inline __attribute__((always_inline)) struct pid *get_pid(struct pid *pid)
5690 {
5691 if (pid)
5692 atomic_inc(&pid->count);
5693 return pid;
5694 }
5695
5696 extern void put_pid(struct pid *pid);
5697 extern struct task_struct *pid_task(struct pid *pid, enum pid_type);
5698 extern struct task_struct *get_pid_task(struct pid *pid, enum pid_type);
5699
5700
5701 extern struct pid *get_task_pid(struct task_struct *task, enum pid_type type);
5702
5703
5704
5705
5706
5707 extern int attach_pid(struct task_struct *task, enum pid_type type, int nr);
5708
5709
5710 extern void detach_pid(struct task_struct *task, enum pid_type);
5711 extern void transfer_pid(struct task_struct *old, struct task_struct *new, enum pid_type);
5712
5713
5714
5715
5716
5717
5718 extern struct pid *find_pid(int nr);
5719
5720
5721
5722
5723 extern struct pid *find_get_pid(int nr);
5724 extern struct pid *find_ge_pid(int nr);
5725
5726 extern struct pid *alloc_pid(void);
5727 extern void free_pid(struct pid *pid);
5728
5729 static inline __attribute__((always_inline)) pid_t pid_nr(struct pid *pid)
5730 {
5731 pid_t nr = 0;
5732 if (pid)
5733 nr = pid->nr;
5734 return nr;
5735 }
5736 # 73 "include/linux/sched.h" 2
5737
5738
5739 # 1 "include/linux/seccomp.h" 1
5740 # 28 "include/linux/seccomp.h"
5741 typedef struct { } seccomp_t;
5742
5743
5744
5745 static inline __attribute__((always_inline)) int has_secure_computing(struct thread_info *ti)
5746 {
5747 return 0;
5748 }
5749 # 76 "include/linux/sched.h" 2
5750
5751 # 1 "include/linux/futex.h" 1
5752
5753
5754
5755 # 1 "include/linux/sched.h" 1
5756 # 5 "include/linux/futex.h" 2
5757 # 33 "include/linux/futex.h"
5758 struct robust_list {
5759 struct robust_list *next;
5760 };
5761 # 45 "include/linux/futex.h"
5762 struct robust_list_head {
5763
5764
5765
5766 struct robust_list list;
5767
5768
5769
5770
5771
5772
5773
5774 long futex_offset;
5775 # 69 "include/linux/futex.h"
5776 struct robust_list *list_op_pending;
5777 };
5778 # 97 "include/linux/futex.h"
5779 long do_futex(u32 *uaddr, int op, u32 val, unsigned long timeout,
5780 u32 *uaddr2, u32 val2, u32 val3);
5781
5782 extern int
5783 handle_futex_death(u32 *uaddr, struct task_struct *curr, int pi);
5784
5785
5786 extern void exit_robust_list(struct task_struct *curr);
5787 extern void exit_pi_state_list(struct task_struct *curr);
5788 # 78 "include/linux/sched.h" 2
5789 # 1 "include/linux/rtmutex.h" 1
5790 # 16 "include/linux/rtmutex.h"
5791 # 1 "include/linux/plist.h" 1
5792 # 80 "include/linux/plist.h"
5793 struct plist_head {
5794 struct list_head prio_list;
5795 struct list_head node_list;
5796
5797
5798
5799 };
5800
5801 struct plist_node {
5802 int prio;
5803 struct plist_head plist;
5804 };
5805 # 127 "include/linux/plist.h"
5806 static inline __attribute__((always_inline)) void
5807 plist_head_init(struct plist_head *head, spinlock_t *lock)
5808 {
5809 INIT_LIST_HEAD(&head->prio_list);
5810 INIT_LIST_HEAD(&head->node_list);
5811
5812
5813
5814 }
5815
5816
5817
5818
5819
5820
5821 static inline __attribute__((always_inline)) void plist_node_init(struct plist_node *node, int prio)
5822 {
5823 node->prio = prio;
5824 plist_head_init(&node->plist, ((void *)0));
5825 }
5826
5827 extern void plist_add(struct plist_node *node, struct plist_head *head);
5828 extern void plist_del(struct plist_node *node, struct plist_head *head);
5829 # 195 "include/linux/plist.h"
5830 static inline __attribute__((always_inline)) int plist_head_empty(const struct plist_head *head)
5831 {
5832 return list_empty(&head->node_list);
5833 }
5834
5835
5836
5837
5838
5839 static inline __attribute__((always_inline)) int plist_node_empty(const struct plist_node *node)
5840 {
5841 return plist_head_empty(&node->plist);
5842 }
5843 # 234 "include/linux/plist.h"
5844 static inline __attribute__((always_inline)) struct plist_node* plist_first(const struct plist_head *head)
5845 {
5846 return ({ const typeof( ((struct plist_node *)0)->plist.node_list ) *__mptr = (head->node_list.next); (struct plist_node *)( (char *)__mptr - __builtin_offsetof(struct plist_node,plist.node_list) );});
5847
5848 }
5849 # 17 "include/linux/rtmutex.h" 2
5850 # 26 "include/linux/rtmutex.h"
5851 struct rt_mutex {
5852 spinlock_t wait_lock;
5853 struct plist_head wait_list;
5854 struct task_struct *owner;
5855
5856
5857
5858
5859
5860
5861 };
5862
5863 struct rt_mutex_waiter;
5864 struct hrtimer_sleeper;
5865
5866
5867
5868
5869
5870
5871 static inline __attribute__((always_inline)) int rt_mutex_debug_check_no_locks_freed(const void *from,
5872 unsigned long len)
5873 {
5874 return 0;
5875 }
5876 # 80 "include/linux/rtmutex.h"
5877 static inline __attribute__((always_inline)) int rt_mutex_is_locked(struct rt_mutex *lock)
5878 {
5879 return lock->owner != ((void *)0);
5880 }
5881
5882 extern void __rt_mutex_init(struct rt_mutex *lock, const char *name);
5883 extern void rt_mutex_destroy(struct rt_mutex *lock);
5884
5885 extern void rt_mutex_lock(struct rt_mutex *lock);
5886 extern int rt_mutex_lock_interruptible(struct rt_mutex *lock,
5887 int detect_deadlock);
5888 extern int rt_mutex_timed_lock(struct rt_mutex *lock,
5889 struct hrtimer_sleeper *timeout,
5890 int detect_deadlock);
5891
5892 extern int rt_mutex_trylock(struct rt_mutex *lock);
5893
5894 extern void rt_mutex_unlock(struct rt_mutex *lock);
5895 # 79 "include/linux/sched.h" 2
5896
5897
5898 # 1 "include/linux/param.h" 1
5899 # 82 "include/linux/sched.h" 2
5900 # 1 "include/linux/resource.h" 1
5901
5902
5903
5904
5905
5906 struct task_struct;
5907 # 23 "include/linux/resource.h"
5908 struct rusage {
5909 struct timeval ru_utime;
5910 struct timeval ru_stime;
5911 long ru_maxrss;
5912 long ru_ixrss;
5913 long ru_idrss;
5914 long ru_isrss;
5915 long ru_minflt;
5916 long ru_majflt;
5917 long ru_nswap;
5918 long ru_inblock;
5919 long ru_oublock;
5920 long ru_msgsnd;
5921 long ru_msgrcv;
5922 long ru_nsignals;
5923 long ru_nvcsw;
5924 long ru_nivcsw;
5925 };
5926
5927 struct rlimit {
5928 unsigned long rlim_cur;
5929 unsigned long rlim_max;
5930 };
5931 # 70 "include/linux/resource.h"
5932 # 1 "include/asm/resource.h" 1
5933
5934
5935
5936 # 1 "include/asm-generic/resource.h" 1
5937 # 5 "include/asm/resource.h" 2
5938 # 71 "include/linux/resource.h" 2
5939
5940 int getrusage(struct task_struct *p, int who, struct rusage *ru);
5941 # 83 "include/linux/sched.h" 2
5942 # 1 "include/linux/timer.h" 1
5943
5944
5945
5946
5947 # 1 "include/linux/ktime.h" 1
5948 # 46 "include/linux/ktime.h"
5949 typedef union {
5950 s64 tv64;
5951
5952 struct {
5953
5954
5955
5956 s32 nsec, sec;
5957
5958 } tv;
5959
5960 } ktime_t;
5961 # 142 "include/linux/ktime.h"
5962 static inline __attribute__((always_inline)) ktime_t ktime_set(const long secs, const unsigned long nsecs)
5963 {
5964 return (ktime_t) { .tv = { .sec = secs, .nsec = nsecs } };
5965 }
5966 # 154 "include/linux/ktime.h"
5967 static inline __attribute__((always_inline)) ktime_t ktime_sub(const ktime_t lhs, const ktime_t rhs)
5968 {
5969 ktime_t res;
5970
5971 res.tv64 = lhs.tv64 - rhs.tv64;
5972 if (res.tv.nsec < 0)
5973 res.tv.nsec += 1000000000L;
5974
5975 return res;
5976 }
5977 # 172 "include/linux/ktime.h"
5978 static inline __attribute__((always_inline)) ktime_t ktime_add(const ktime_t add1, const ktime_t add2)
5979 {
5980 ktime_t res;
5981
5982 res.tv64 = add1.tv64 + add2.tv64;
5983 # 185 "include/linux/ktime.h"
5984 if (res.tv.nsec >= 1000000000L)
5985 res.tv64 += (u32)-1000000000L;
5986
5987 return res;
5988 }
5989 # 198 "include/linux/ktime.h"
5990 extern ktime_t ktime_add_ns(const ktime_t kt, u64 nsec);
5991
5992
5993
5994
5995
5996
5997
5998 static inline __attribute__((always_inline)) ktime_t timespec_to_ktime(const struct timespec ts)
5999 {
6000 return (ktime_t) { .tv = { .sec = (s32)ts.tv_sec,
6001 .nsec = (s32)ts.tv_nsec } };
6002 }
6003
6004
6005
6006
6007
6008
6009
6010 static inline __attribute__((always_inline)) ktime_t timeval_to_ktime(const struct timeval tv)
6011 {
6012 return (ktime_t) { .tv = { .sec = (s32)tv.tv_sec,
6013 .nsec = (s32)tv.tv_usec * 1000 } };
6014 }
6015
6016
6017
6018
6019
6020
6021
6022 static inline __attribute__((always_inline)) struct timespec ktime_to_timespec(const ktime_t kt)
6023 {
6024 return (struct timespec) { .tv_sec = (time_t) kt.tv.sec,
6025 .tv_nsec = (long) kt.tv.nsec };
6026 }
6027
6028
6029
6030
6031
6032
6033
6034 static inline __attribute__((always_inline)) struct timeval ktime_to_timeval(const ktime_t kt)
6035 {
6036 return (struct timeval) {
6037 .tv_sec = (time_t) kt.tv.sec,
6038 .tv_usec = (suseconds_t) (kt.tv.nsec / 1000L) };
6039 }
6040
6041
6042
6043
6044
6045
6046
6047 static inline __attribute__((always_inline)) s64 ktime_to_ns(const ktime_t kt)
6048 {
6049 return (s64) kt.tv.sec * 1000000000L + kt.tv.nsec;
6050 }
6051 # 271 "include/linux/ktime.h"
6052 extern void ktime_get_ts(struct timespec *ts);
6053 # 6 "include/linux/timer.h" 2
6054
6055
6056
6057 struct tvec_t_base_s;
6058
6059 struct timer_list {
6060 struct list_head entry;
6061 unsigned long expires;
6062
6063 void (*function)(unsigned long);
6064 unsigned long data;
6065
6066 struct tvec_t_base_s *base;
6067
6068
6069
6070
6071
6072 };
6073
6074 extern struct tvec_t_base_s boot_tvec_bases;
6075 # 39 "include/linux/timer.h"
6076 void init_timer(struct timer_list * timer);
6077
6078 static inline __attribute__((always_inline)) void setup_timer(struct timer_list * timer,
6079 void (*function)(unsigned long),
6080 unsigned long data)
6081 {
6082 timer->function = function;
6083 timer->data = data;
6084 init_timer(timer);
6085 }
6086 # 60 "include/linux/timer.h"
6087 static inline __attribute__((always_inline)) int timer_pending(const struct timer_list * timer)
6088 {
6089 return timer->entry.next != ((void *)0);
6090 }
6091
6092 extern void add_timer_on(struct timer_list *timer, int cpu);
6093 extern int del_timer(struct timer_list * timer);
6094 extern int __mod_timer(struct timer_list *timer, unsigned long expires);
6095 extern int mod_timer(struct timer_list *timer, unsigned long expires);
6096
6097
6098
6099
6100
6101 extern unsigned long next_timer_interrupt(void);
6102
6103
6104
6105
6106
6107 extern unsigned long get_next_timer_interrupt(unsigned long now);
6108 # 111 "include/linux/timer.h"
6109 static inline __attribute__((always_inline)) void init_timer_stats(void)
6110 {
6111 }
6112
6113 static inline __attribute__((always_inline)) void timer_stats_account_timer(struct timer_list *timer)
6114 {
6115 }
6116
6117 static inline __attribute__((always_inline)) void timer_stats_timer_set_start_info(struct timer_list *timer)
6118 {
6119 }
6120
6121 static inline __attribute__((always_inline)) void timer_stats_timer_clear_start_info(struct timer_list *timer)
6122 {
6123 }
6124
6125
6126 extern void delayed_work_timer_fn(unsigned long __data);
6127 # 144 "include/linux/timer.h"
6128 static inline __attribute__((always_inline)) void add_timer(struct timer_list *timer)
6129 {
6130 do { if (__builtin_expect(!!((timer_pending(timer))!=0), 0)) do { printk("BUG: failure at %s:%d/%s()!\n", "include/linux/timer.h", 146, (__func__)); panic("BUG!"); } while (0); } while(0);
6131 __mod_timer(timer, timer->expires);
6132 }
6133 # 160 "include/linux/timer.h"
6134 extern void init_timers(void);
6135 extern void run_local_timers(void);
6136 struct hrtimer;
6137 extern enum hrtimer_restart it_real_fn(struct hrtimer *);
6138
6139 unsigned long __round_jiffies(unsigned long j, int cpu);
6140 unsigned long __round_jiffies_relative(unsigned long j, int cpu);
6141 unsigned long round_jiffies(unsigned long j);
6142 unsigned long round_jiffies_relative(unsigned long j);
6143 # 84 "include/linux/sched.h" 2
6144 # 1 "include/linux/hrtimer.h" 1
6145 # 24 "include/linux/hrtimer.h"
6146 struct hrtimer_clock_base;
6147 struct hrtimer_cpu_base;
6148
6149
6150
6151
6152 enum hrtimer_mode {
6153 HRTIMER_MODE_ABS,
6154 HRTIMER_MODE_REL,
6155 };
6156
6157
6158
6159
6160 enum hrtimer_restart {
6161 HRTIMER_NORESTART,
6162 HRTIMER_RESTART,
6163 };
6164 # 53 "include/linux/hrtimer.h"
6165 enum hrtimer_cb_mode {
6166 HRTIMER_CB_SOFTIRQ,
6167 HRTIMER_CB_IRQSAFE,
6168 HRTIMER_CB_IRQSAFE_NO_RESTART,
6169 HRTIMER_CB_IRQSAFE_NO_SOFTIRQ,
6170 };
6171 # 112 "include/linux/hrtimer.h"
6172 struct hrtimer {
6173 struct rb_node node;
6174 ktime_t expires;
6175 enum hrtimer_restart (*function)(struct hrtimer *);
6176 struct hrtimer_clock_base *base;
6177 unsigned long state;
6178 # 127 "include/linux/hrtimer.h"
6179 };
6180 # 136 "include/linux/hrtimer.h"
6181 struct hrtimer_sleeper {
6182 struct hrtimer timer;
6183 struct task_struct *task;
6184 };
6185 # 156 "include/linux/hrtimer.h"
6186 struct hrtimer_clock_base {
6187 struct hrtimer_cpu_base *cpu_base;
6188 clockid_t index;
6189 struct rb_root active;
6190 struct rb_node *first;
6191 ktime_t resolution;
6192 ktime_t (*get_time)(void);
6193 ktime_t (*get_softirq_time)(void);
6194 ktime_t softirq_time;
6195
6196
6197
6198
6199
6200
6201 };
6202 # 193 "include/linux/hrtimer.h"
6203 struct hrtimer_cpu_base {
6204 spinlock_t lock;
6205 struct lock_class_key lock_key;
6206 struct hrtimer_clock_base clock_base[2];
6207
6208
6209
6210
6211
6212
6213 };
6214 # 238 "include/linux/hrtimer.h"
6215 static inline __attribute__((always_inline)) void clock_was_set(void) { }
6216
6217 static inline __attribute__((always_inline)) void hres_timers_resume(void) { }
6218
6219
6220
6221
6222
6223 static inline __attribute__((always_inline)) ktime_t hrtimer_cb_get_time(struct hrtimer *timer)
6224 {
6225 return timer->base->softirq_time;
6226 }
6227
6228
6229
6230 extern ktime_t ktime_get(void);
6231 extern ktime_t ktime_get_real(void);
6232
6233
6234
6235
6236 extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock,
6237 enum hrtimer_mode mode);
6238
6239
6240 extern int hrtimer_start(struct hrtimer *timer, ktime_t tim,
6241 const enum hrtimer_mode mode);
6242 extern int hrtimer_cancel(struct hrtimer *timer);
6243 extern int hrtimer_try_to_cancel(struct hrtimer *timer);
6244
6245 static inline __attribute__((always_inline)) int hrtimer_restart(struct hrtimer *timer)
6246 {
6247 return hrtimer_start(timer, timer->expires, HRTIMER_MODE_ABS);
6248 }
6249
6250
6251 extern ktime_t hrtimer_get_remaining(const struct hrtimer *timer);
6252 extern int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp);
6253
6254 extern ktime_t hrtimer_get_next_event(void);
6255
6256
6257
6258
6259
6260 static inline __attribute__((always_inline)) int hrtimer_active(const struct hrtimer *timer)
6261 {
6262 return timer->state != 0x00;
6263 }
6264
6265
6266
6267
6268 static inline __attribute__((always_inline)) int hrtimer_is_queued(struct hrtimer *timer)
6269 {
6270 return timer->state &
6271 (0x01 | 0x04);
6272 }
6273
6274
6275 extern unsigned long
6276 hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval);
6277
6278
6279 extern long hrtimer_nanosleep(struct timespec *rqtp,
6280 struct timespec *rmtp,
6281 const enum hrtimer_mode mode,
6282 const clockid_t clockid);
6283 extern long hrtimer_nanosleep_restart(struct restart_block *restart_block);
6284
6285 extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl,
6286 struct task_struct *tsk);
6287
6288
6289 extern void hrtimer_run_queues(void);
6290
6291
6292 extern void __attribute__ ((__section__ (".init.text"))) hrtimers_init(void);
6293
6294
6295 extern unsigned long ktime_divns(const ktime_t kt, s64 div);
6296
6297
6298
6299
6300
6301 extern void sysrq_timer_list_show(void);
6302 # 353 "include/linux/hrtimer.h"
6303 static inline __attribute__((always_inline)) void timer_stats_account_hrtimer(struct hrtimer *timer)
6304 {
6305 }
6306
6307 static inline __attribute__((always_inline)) void timer_stats_hrtimer_set_start_info(struct hrtimer *timer)
6308 {
6309 }
6310
6311 static inline __attribute__((always_inline)) void timer_stats_hrtimer_clear_start_info(struct hrtimer *timer)
6312 {
6313 }
6314 # 85 "include/linux/sched.h" 2
6315 # 1 "include/linux/task_io_accounting.h" 1
6316 # 35 "include/linux/task_io_accounting.h"
6317 struct task_io_accounting {
6318 };
6319 # 86 "include/linux/sched.h" 2
6320
6321
6322
6323 struct exec_domain;
6324 struct futex_pi_state;
6325 # 108 "include/linux/sched.h"
6326 extern unsigned long avenrun[];
6327 # 122 "include/linux/sched.h"
6328 extern unsigned long total_forks;
6329 extern int nr_threads;
6330 extern __typeof__(unsigned long) per_cpu__process_counts;
6331 extern int nr_processes(void);
6332 extern unsigned long nr_running(void);
6333 extern unsigned long nr_uninterruptible(void);
6334 extern unsigned long nr_active(void);
6335 extern unsigned long nr_iowait(void);
6336 extern unsigned long weighted_cpuload(const int cpu);
6337 # 187 "include/linux/sched.h"
6338 extern rwlock_t tasklist_lock;
6339 extern spinlock_t mmlist_lock;
6340
6341 struct task_struct;
6342
6343 extern void sched_init(void);
6344 extern void sched_init_smp(void);
6345 extern void init_idle(struct task_struct *idle, int cpu);
6346
6347 extern cpumask_t nohz_cpu_mask;
6348
6349
6350
6351
6352 extern void show_state_filter(unsigned long state_filter);
6353
6354 static inline __attribute__((always_inline)) void show_state(void)
6355 {
6356 show_state_filter(-1);
6357 }
6358
6359 extern void show_regs(struct pt_regs *);
6360
6361
6362
6363
6364
6365
6366 extern void show_stack(struct task_struct *task, unsigned long *sp);
6367
6368 void io_schedule(void);
6369 long io_schedule_timeout(long timeout);
6370
6371 extern void cpu_init (void);
6372 extern void trap_init(void);
6373 extern void update_process_times(int user);
6374 extern void scheduler_tick(void);
6375
6376
6377
6378
6379
6380
6381 static inline __attribute__((always_inline)) void softlockup_tick(void)
6382 {
6383 }
6384 static inline __attribute__((always_inline)) void spawn_softlockup_task(void)
6385 {
6386 }
6387 static inline __attribute__((always_inline)) void touch_softlockup_watchdog(void)
6388 {
6389 }
6390
6391
6392
6393
6394
6395
6396 extern int in_sched_functions(unsigned long addr);
6397
6398
6399 extern signed long schedule_timeout(signed long timeout);
6400 extern signed long schedule_timeout_interruptible(signed long timeout);
6401 extern signed long schedule_timeout_uninterruptible(signed long timeout);
6402 void schedule(void);
6403
6404 struct nsproxy;
6405
6406
6407
6408
6409 extern int sysctl_max_map_count;
6410
6411 # 1 "include/linux/aio.h" 1
6412
6413
6414
6415
6416 # 1 "include/linux/workqueue.h" 1
6417 # 13 "include/linux/workqueue.h"
6418 struct workqueue_struct;
6419
6420 struct work_struct;
6421 typedef void (*work_func_t)(struct work_struct *work);
6422
6423
6424
6425
6426
6427
6428
6429 struct work_struct {
6430 atomic_long_t data;
6431
6432
6433
6434
6435 struct list_head entry;
6436 work_func_t func;
6437 };
6438
6439
6440
6441
6442 struct delayed_work {
6443 struct work_struct work;
6444 struct timer_list timer;
6445 };
6446
6447 struct execute_work {
6448 struct work_struct work;
6449 };
6450 # 161 "include/linux/workqueue.h"
6451 extern struct workqueue_struct *__create_workqueue(const char *name,
6452 int singlethread,
6453 int freezeable);
6454
6455
6456
6457
6458 extern void destroy_workqueue(struct workqueue_struct *wq);
6459
6460 extern int queue_work(struct workqueue_struct *wq, struct work_struct *work);
6461 extern int queue_delayed_work(struct workqueue_struct *wq, struct delayed_work *work, unsigned long delay);
6462 extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq,
6463 struct delayed_work *work, unsigned long delay);
6464 extern void flush_workqueue(struct workqueue_struct *wq);
6465
6466 extern int schedule_work(struct work_struct *work);
6467 extern int run_scheduled_work(struct work_struct *work);
6468 extern int schedule_delayed_work(struct delayed_work *work, unsigned long delay);
6469
6470 extern int schedule_delayed_work_on(int cpu, struct delayed_work *work, unsigned long delay);
6471 extern int schedule_on_each_cpu(work_func_t func);
6472 extern void flush_scheduled_work(void);
6473 extern int current_is_keventd(void);
6474 extern int keventd_up(void);
6475
6476 extern void init_workqueues(void);
6477 void cancel_rearming_delayed_work(struct delayed_work *work);
6478 void cancel_rearming_delayed_workqueue(struct workqueue_struct *,
6479 struct delayed_work *);
6480 int execute_in_process_context(work_func_t fn, struct execute_work *);
6481
6482
6483
6484
6485
6486
6487 static inline __attribute__((always_inline)) int cancel_delayed_work(struct delayed_work *work)
6488 {
6489 int ret;
6490
6491 ret = del_timer(&work->timer);
6492 if (ret)
6493 clear_bit(0, ((unsigned long *)(&(&work->work)->data)));
6494 return ret;
6495 }
6496 # 6 "include/linux/aio.h" 2
6497 # 1 "include/linux/aio_abi.h" 1
6498 # 32 "include/linux/aio_abi.h"
6499 typedef unsigned long aio_context_t;
6500
6501 enum {
6502 IOCB_CMD_PREAD = 0,
6503 IOCB_CMD_PWRITE = 1,
6504 IOCB_CMD_FSYNC = 2,
6505 IOCB_CMD_FDSYNC = 3,
6506
6507
6508
6509
6510 IOCB_CMD_NOOP = 6,
6511 IOCB_CMD_PREADV = 7,
6512 IOCB_CMD_PWRITEV = 8,
6513 };
6514
6515
6516 struct io_event {
6517 __u64 data;
6518 __u64 obj;
6519 __s64 res;
6520 __s64 res2;
6521 };
6522 # 70 "include/linux/aio_abi.h"
6523 struct iocb {
6524
6525 __u64 aio_data;
6526 __u32 aio_key, aio_reserved1;
6527
6528
6529
6530 __u16 aio_lio_opcode;
6531 __s16 aio_reqprio;
6532 __u32 aio_fildes;
6533
6534 __u64 aio_buf;
6535 __u64 aio_nbytes;
6536 __s64 aio_offset;
6537
6538
6539 __u64 aio_reserved2;
6540 __u64 aio_reserved3;
6541 };
6542 # 7 "include/linux/aio.h" 2
6543 # 1 "include/linux/uio.h" 1
6544 # 20 "include/linux/uio.h"
6545 struct iovec
6546 {
6547 void *iov_base;
6548 __kernel_size_t iov_len;
6549 };
6550
6551
6552
6553 struct kvec {
6554 void *iov_base;
6555 size_t iov_len;
6556 };
6557 # 54 "include/linux/uio.h"
6558 static inline __attribute__((always_inline)) size_t iov_length(const struct iovec *iov, unsigned long nr_segs)
6559 {
6560 unsigned long seg;
6561 size_t ret = 0;
6562
6563 for (seg = 0; seg < nr_segs; seg++)
6564 ret += iov[seg].iov_len;
6565 return ret;
6566 }
6567
6568 unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to);
6569 # 8 "include/linux/aio.h" 2
6570
6571
6572
6573
6574
6575
6576
6577 struct kioctx;
6578 # 87 "include/linux/aio.h"
6579 struct kiocb {
6580 struct list_head ki_run_list;
6581 long ki_flags;
6582 int ki_users;
6583 unsigned ki_key;
6584
6585 struct file *ki_filp;
6586 struct kioctx *ki_ctx;
6587 int (*ki_cancel)(struct kiocb *, struct io_event *);
6588 ssize_t (*ki_retry)(struct kiocb *);
6589 void (*ki_dtor)(struct kiocb *);
6590
6591 union {
6592 void *user;
6593 struct task_struct *tsk;
6594 } ki_obj;
6595
6596 __u64 ki_user_data;
6597 wait_queue_t ki_wait;
6598 loff_t ki_pos;
6599
6600 atomic_t ki_bio_count;
6601 void *private;
6602
6603 unsigned short ki_opcode;
6604 size_t ki_nbytes;
6605 char *ki_buf;
6606 size_t ki_left;
6607 struct iovec ki_inline_vec;
6608 struct iovec *ki_iovec;
6609 unsigned long ki_nr_segs;
6610 unsigned long ki_cur_seg;
6611
6612 struct list_head ki_list;
6613
6614 };
6615 # 144 "include/linux/aio.h"
6616 struct aio_ring {
6617 unsigned id;
6618 unsigned nr;
6619 unsigned head;
6620 unsigned tail;
6621
6622 unsigned magic;
6623 unsigned compat_features;
6624 unsigned incompat_features;
6625 unsigned header_length;
6626
6627
6628 struct io_event io_events[0];
6629 };
6630
6631
6632
6633
6634 struct aio_ring_info {
6635 unsigned long mmap_base;
6636 unsigned long mmap_size;
6637
6638 struct page **ring_pages;
6639 spinlock_t ring_lock;
6640 long nr_pages;
6641
6642 unsigned nr, tail;
6643
6644 struct page *internal_pages[8];
6645 };
6646
6647 struct kioctx {
6648 atomic_t users;
6649 int dead;
6650 struct mm_struct *mm;
6651
6652
6653 unsigned long user_id;
6654 struct kioctx *next;
6655
6656 wait_queue_head_t wait;
6657
6658 spinlock_t ctx_lock;
6659
6660 int reqs_active;
6661 struct list_head active_reqs;
6662 struct list_head run_list;
6663
6664
6665 unsigned max_reqs;
6666
6667 struct aio_ring_info ring_info;
6668
6669 struct delayed_work wq;
6670 };
6671
6672
6673 extern unsigned aio_max_size;
6674
6675 extern ssize_t wait_on_sync_kiocb(struct kiocb *iocb);
6676 extern int aio_put_req(struct kiocb *iocb);
6677 extern void kick_iocb(struct kiocb *iocb);
6678 extern int aio_complete(struct kiocb *iocb, long res, long res2);
6679 extern void __put_ioctx(struct kioctx *ctx);
6680 struct mm_struct;
6681 extern void exit_aio(struct mm_struct *mm);
6682 extern struct kioctx *lookup_ioctx(unsigned long ctx_id);
6683 extern int io_submit_one(struct kioctx *ctx, struct iocb *user_iocb, struct iocb *iocb);
6684
6685
6686
6687 struct kioctx *lookup_ioctx(unsigned long ctx_id);
6688 int io_submit_one(struct kioctx *ctx, struct iocb *user_iocb, struct iocb *iocb);
6689 # 244 "include/linux/aio.h"
6690 static inline __attribute__((always_inline)) struct kiocb *list_kiocb(struct list_head *h)
6691 {
6692 return ({ const typeof( ((struct kiocb *)0)->ki_list ) *__mptr = (h); (struct kiocb *)( (char *)__mptr - __builtin_offsetof(struct kiocb,ki_list) );});
6693 }
6694
6695
6696 extern unsigned long aio_nr;
6697 extern unsigned long aio_max_nr;
6698 # 261 "include/linux/sched.h" 2
6699
6700 extern unsigned long
6701 arch_get_unmapped_area(struct file *, unsigned long, unsigned long,
6702 unsigned long, unsigned long);
6703 extern unsigned long
6704 arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
6705 unsigned long len, unsigned long pgoff,
6706 unsigned long flags);
6707 extern void arch_unmap_area(struct mm_struct *, unsigned long);
6708 extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long);
6709 # 294 "include/linux/sched.h"
6710 typedef unsigned long mm_counter_t;
6711 # 310 "include/linux/sched.h"
6712 struct mm_struct {
6713 struct vm_area_struct * mmap;
6714 struct rb_root mm_rb;
6715 struct vm_area_struct * mmap_cache;
6716 unsigned long (*get_unmapped_area) (struct file *filp,
6717 unsigned long addr, unsigned long len,
6718 unsigned long pgoff, unsigned long flags);
6719 void (*unmap_area) (struct mm_struct *mm, unsigned long addr);
6720 unsigned long mmap_base;
6721 unsigned long task_size;
6722 unsigned long cached_hole_size;
6723 unsigned long free_area_cache;
6724 pgd_t * pgd;
6725 atomic_t mm_users;
6726 atomic_t mm_count;
6727 int map_count;
6728 struct rw_semaphore mmap_sem;
6729 spinlock_t page_table_lock;
6730
6731 struct list_head mmlist;
6732
6733
6734
6735
6736
6737
6738
6739 mm_counter_t _file_rss;
6740 mm_counter_t _anon_rss;
6741
6742 unsigned long hiwater_rss;
6743 unsigned long hiwater_vm;
6744
6745 unsigned long total_vm, locked_vm, shared_vm, exec_vm;
6746 unsigned long stack_vm, reserved_vm, def_flags, nr_ptes;
6747 unsigned long start_code, end_code, start_data, end_data;
6748 unsigned long start_brk, brk, start_stack;
6749 unsigned long arg_start, arg_end, env_start, env_end;
6750
6751 unsigned long saved_auxv[44];
6752
6753 cpumask_t cpu_vm_mask;
6754
6755
6756 mm_context_t context;
6757 # 363 "include/linux/sched.h"
6758 unsigned int faultstamp;
6759 unsigned int token_priority;
6760 unsigned int last_interval;
6761
6762 unsigned char dumpable:2;
6763
6764
6765 int core_waiters;
6766 struct completion *core_startup_done, core_done;
6767
6768
6769 rwlock_t ioctx_list_lock;
6770 struct kioctx *ioctx_list;
6771 };
6772
6773 struct sighand_struct {
6774 atomic_t count;
6775 struct k_sigaction action[64];
6776 spinlock_t siglock;
6777 };
6778
6779 struct pacct_struct {
6780 int ac_flag;
6781 long ac_exitcode;
6782 unsigned long ac_mem;
6783 cputime_t ac_utime, ac_stime;
6784 unsigned long ac_minflt, ac_majflt;
6785 };
6786 # 399 "include/linux/sched.h"
6787 struct signal_struct {
6788 atomic_t count;
6789 atomic_t live;
6790
6791 wait_queue_head_t wait_chldexit;
6792
6793
6794 struct task_struct *curr_target;
6795
6796
6797 struct sigpending shared_pending;
6798
6799
6800 int group_exit_code;
6801
6802
6803
6804
6805
6806 struct task_struct *group_exit_task;
6807 int notify_count;
6808
6809
6810 int group_stop_count;
6811 unsigned int flags;
6812
6813
6814 struct list_head posix_timers;
6815
6816
6817 struct hrtimer real_timer;
6818 struct task_struct *tsk;
6819 ktime_t it_real_incr;
6820
6821
6822 cputime_t it_prof_expires, it_virt_expires;
6823 cputime_t it_prof_incr, it_virt_incr;
6824
6825
6826 pid_t pgrp;
6827 struct pid *tty_old_pgrp;
6828
6829 union {
6830 pid_t session __attribute__((deprecated));
6831 pid_t __session;
6832 };
6833
6834
6835 int leader;
6836
6837 struct tty_struct *tty;
6838
6839
6840
6841
6842
6843
6844
6845 cputime_t utime, stime, cutime, cstime;
6846 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw;
6847 unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt;
6848
6849
6850
6851
6852
6853
6854
6855 unsigned long long sched_time;
6856 # 478 "include/linux/sched.h"
6857 struct rlimit rlim[15];
6858
6859 struct list_head cpu_timers[3];
6860 # 494 "include/linux/sched.h"
6861 };
6862 # 537 "include/linux/sched.h"
6863 struct user_struct {
6864 atomic_t __count;
6865 atomic_t processes;
6866 atomic_t files;
6867 atomic_t sigpending;
6868
6869 atomic_t inotify_watches;
6870 atomic_t inotify_devs;
6871
6872
6873 unsigned long mq_bytes;
6874 unsigned long locked_shm;
6875
6876
6877
6878
6879
6880
6881
6882 struct list_head uidhash_list;
6883 uid_t uid;
6884 };
6885
6886 extern struct user_struct *find_user(uid_t);
6887
6888 extern struct user_struct root_user;
6889
6890
6891 struct backing_dev_info;
6892 struct reclaim_state;
6893 # 615 "include/linux/sched.h"
6894 static inline __attribute__((always_inline)) int sched_info_on(void)
6895 {
6896
6897
6898
6899
6900
6901
6902 return 0;
6903
6904 }
6905
6906 enum idle_type
6907 {
6908 SCHED_IDLE,
6909 NOT_IDLE,
6910 NEWLY_IDLE,
6911 MAX_IDLE_TYPES
6912 };
6913 # 744 "include/linux/sched.h"
6914 struct io_context;
6915 struct cpuset;
6916
6917
6918
6919 struct group_info {
6920 int ngroups;
6921 atomic_t usage;
6922 gid_t small_block[32];
6923 int nblocks;
6924 gid_t *blocks[0];
6925 };
6926 # 772 "include/linux/sched.h"
6927 extern struct group_info *groups_alloc(int gidsetsize);
6928 extern void groups_free(struct group_info *group_info);
6929 extern int set_current_groups(struct group_info *group_info);
6930 extern int groups_search(struct group_info *group_info, gid_t grp);
6931
6932
6933
6934
6935
6936
6937
6938 static inline __attribute__((always_inline)) void prefetch_stack(struct task_struct *t) { }
6939
6940
6941 struct audit_context;
6942 struct mempolicy;
6943 struct pipe_inode_info;
6944 struct uts_namespace;
6945
6946 enum sleep_type {
6947 SLEEP_NORMAL,
6948 SLEEP_NONINTERACTIVE,
6949 SLEEP_INTERACTIVE,
6950 SLEEP_INTERRUPTED,
6951 };
6952
6953 struct prio_array;
6954
6955 struct task_struct {
6956 volatile long state;
6957 struct thread_info *thread_info;
6958 atomic_t usage;
6959 unsigned long flags;
6960 unsigned long ptrace;
6961
6962 int lock_depth;
6963
6964
6965
6966
6967
6968
6969 int load_weight;
6970 int prio, static_prio, normal_prio;
6971 struct list_head run_list;
6972 struct prio_array *array;
6973
6974 unsigned short ioprio;
6975
6976
6977
6978 unsigned long sleep_avg;
6979 unsigned long long timestamp, last_ran;
6980 unsigned long long sched_time;
6981 enum sleep_type sleep_type;
6982
6983 unsigned long policy;
6984 cpumask_t cpus_allowed;
6985 unsigned int time_slice, first_time_slice;
6986
6987
6988
6989
6990
6991 struct list_head tasks;
6992
6993
6994
6995
6996 struct list_head ptrace_children;
6997 struct list_head ptrace_list;
6998
6999 struct mm_struct *mm, *active_mm;
7000
7001
7002 struct linux_binfmt *binfmt;
7003 long exit_state;
7004 int exit_code, exit_signal;
7005 int pdeath_signal;
7006
7007 unsigned long personality;
7008 unsigned did_exec:1;
7009 pid_t pid;
7010 pid_t tgid;
7011 # 866 "include/linux/sched.h"
7012 struct task_struct *real_parent;
7013 struct task_struct *parent;
7014
7015
7016
7017
7018 struct list_head children;
7019 struct list_head sibling;
7020 struct task_struct *group_leader;
7021
7022
7023 struct pid_link pids[PIDTYPE_MAX];
7024 struct list_head thread_group;
7025
7026 struct completion *vfork_done;
7027 int *set_child_tid;
7028 int *clear_child_tid;
7029
7030 unsigned long rt_priority;
7031 cputime_t utime, stime;
7032 unsigned long nvcsw, nivcsw;
7033 struct timespec start_time;
7034
7035 unsigned long min_flt, maj_flt;
7036
7037 cputime_t it_prof_expires, it_virt_expires;
7038 unsigned long long it_sched_expires;
7039 struct list_head cpu_timers[3];
7040
7041
7042 uid_t uid,euid,suid,fsuid;
7043 gid_t gid,egid,sgid,fsgid;
7044 struct group_info *group_info;
7045 kernel_cap_t cap_effective, cap_inheritable, cap_permitted;
7046 unsigned keep_capabilities:1;
7047 struct user_struct *user;
7048 # 915 "include/linux/sched.h"
7049 unsigned char fpu_counter;
7050 int oomkilladj;
7051 char comm[16];
7052
7053
7054
7055
7056 int link_count, total_link_count;
7057
7058
7059 struct sysv_sem sysvsem;
7060
7061
7062 struct thread_struct thread;
7063
7064 struct fs_struct *fs;
7065
7066 struct files_struct *files;
7067
7068 struct nsproxy *nsproxy;
7069
7070 struct signal_struct *signal;
7071 struct sighand_struct *sighand;
7072
7073 sigset_t blocked, real_blocked;
7074 sigset_t saved_sigmask;
7075 struct sigpending pending;
7076
7077 unsigned long sas_ss_sp;
7078 size_t sas_ss_size;
7079 int (*notifier)(void *priv);
7080 void *notifier_data;
7081 sigset_t *notifier_mask;
7082
7083 void *security;
7084 struct audit_context *audit_context;
7085 seccomp_t seccomp;
7086
7087
7088 u32 parent_exec_id;
7089 u32 self_exec_id;
7090
7091 spinlock_t alloc_lock;
7092
7093
7094 spinlock_t pi_lock;
7095
7096
7097
7098 struct plist_head pi_waiters;
7099
7100 struct rt_mutex_waiter *pi_blocked_on;
7101 # 997 "include/linux/sched.h"
7102 void *journal_info;
7103
7104
7105 struct reclaim_state *reclaim_state;
7106
7107 struct backing_dev_info *backing_dev_info;
7108
7109 struct io_context *io_context;
7110
7111 unsigned long ptrace_message;
7112 siginfo_t *last_siginfo;
7113
7114
7115
7116
7117
7118
7119 wait_queue_t *io_wait;
7120
7121
7122
7123
7124 struct task_io_accounting ioac;
7125 # 1035 "include/linux/sched.h"
7126 struct robust_list_head *robust_list;
7127
7128
7129
7130 struct list_head pi_state_list;
7131 struct futex_pi_state *pi_state_cache;
7132
7133 atomic_t fs_excl;
7134 struct rcu_head rcu;
7135
7136
7137
7138
7139 struct pipe_inode_info *splice_pipe;
7140
7141
7142
7143
7144
7145
7146 };
7147
7148 static inline __attribute__((always_inline)) pid_t process_group(struct task_struct *tsk)
7149 {
7150 return tsk->signal->pgrp;
7151 }
7152
7153 static inline __attribute__((always_inline)) pid_t signal_session(struct signal_struct *sig)
7154 {
7155 return sig->__session;
7156 }
7157
7158 static inline __attribute__((always_inline)) pid_t process_session(struct task_struct *tsk)
7159 {
7160 return signal_session(tsk->signal);
7161 }
7162
7163 static inline __attribute__((always_inline)) void set_signal_session(struct signal_struct *sig, pid_t session)
7164 {
7165 sig->__session = session;
7166 }
7167
7168 static inline __attribute__((always_inline)) struct pid *task_pid(struct task_struct *task)
7169 {
7170 return task->pids[PIDTYPE_PID].pid;
7171 }
7172
7173 static inline __attribute__((always_inline)) struct pid *task_tgid(struct task_struct *task)
7174 {
7175 return task->group_leader->pids[PIDTYPE_PID].pid;
7176 }
7177
7178 static inline __attribute__((always_inline)) struct pid *task_pgrp(struct task_struct *task)
7179 {
7180 return task->group_leader->pids[PIDTYPE_PGID].pid;
7181 }
7182
7183 static inline __attribute__((always_inline)) struct pid *task_session(struct task_struct *task)
7184 {
7185 return task->group_leader->pids[PIDTYPE_SID].pid;
7186 }
7187 # 1105 "include/linux/sched.h"
7188 static inline __attribute__((always_inline)) int pid_alive(struct task_struct *p)
7189 {
7190 return p->pids[PIDTYPE_PID].pid != ((void *)0);
7191 }
7192
7193
7194
7195
7196
7197
7198
7199 static inline __attribute__((always_inline)) int is_init(struct task_struct *tsk)
7200 {
7201 return tsk->pid == 1;
7202 }
7203
7204 extern struct pid *cad_pid;
7205
7206 extern void free_task(struct task_struct *tsk);
7207
7208
7209 extern void __put_task_struct(struct task_struct *t);
7210
7211 static inline __attribute__((always_inline)) void put_task_struct(struct task_struct *t)
7212 {
7213 if ((atomic_sub_return(1, (&t->usage)) == 0))
7214 __put_task_struct(t);
7215 }
7216 # 1190 "include/linux/sched.h"
7217 static inline __attribute__((always_inline)) int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
7218 {
7219 if (!(__builtin_constant_p((0)) ? __constant_test_bit(((0)),((new_mask).bits)) : __test_bit(((0)),((new_mask).bits))))
7220 return -22;
7221 return 0;
7222 }
7223
7224
7225 extern unsigned long long sched_clock(void);
7226 extern unsigned long long
7227 current_sched_time(const struct task_struct *current_task);
7228 # 1212 "include/linux/sched.h"
7229 static inline __attribute__((always_inline)) void idle_task_exit(void) {}
7230
7231
7232 extern void sched_idle_next(void);
7233
7234
7235 extern int rt_mutex_getprio(struct task_struct *p);
7236 extern void rt_mutex_setprio(struct task_struct *p, int prio);
7237 extern void rt_mutex_adjust_pi(struct task_struct *p);
7238 # 1229 "include/linux/sched.h"
7239 extern void set_user_nice(struct task_struct *p, long nice);
7240 extern int task_prio(const struct task_struct *p);
7241 extern int task_nice(const struct task_struct *p);
7242 extern int can_nice(const struct task_struct *p, const int nice);
7243 extern int task_curr(const struct task_struct *p);
7244 extern int idle_cpu(int cpu);
7245 extern int sched_setscheduler(struct task_struct *, int, struct sched_param *);
7246 extern struct task_struct *idle_task(int cpu);
7247 extern struct task_struct *curr_task(int cpu);
7248 extern void set_curr_task(int cpu, struct task_struct *p);
7249
7250 void yield(void);
7251
7252
7253
7254
7255 extern struct exec_domain default_exec_domain;
7256
7257 union thread_union {
7258 struct thread_info thread_info;
7259 unsigned long stack[8192/sizeof(long)];
7260 };
7261
7262
7263 static inline __attribute__((always_inline)) int kstack_end(void *addr)
7264 {
7265
7266
7267
7268 return !(((unsigned long)addr+sizeof(void*)-1) & (8192 -sizeof(void*)));
7269 }
7270
7271
7272 extern union thread_union init_thread_union;
7273 extern struct task_struct init_task;
7274
7275 extern struct mm_struct init_mm;
7276
7277
7278 extern struct task_struct *find_task_by_pid_type(int type, int pid);
7279 extern void __set_special_pids(pid_t session, pid_t pgrp);
7280
7281
7282 extern struct user_struct * alloc_uid(uid_t);
7283 static inline __attribute__((always_inline)) struct user_struct *get_uid(struct user_struct *u)
7284 {
7285 atomic_inc(&u->__count);
7286 return u;
7287 }
7288 extern void free_uid(struct user_struct *);
7289 extern void switch_uid(struct user_struct *);
7290
7291
7292
7293 extern void do_timer(unsigned long ticks);
7294
7295 extern int wake_up_state(struct task_struct * tsk, unsigned int state);
7296 extern int wake_up_process(struct task_struct * tsk);
7297 extern void wake_up_new_task(struct task_struct * tsk, unsigned long clone_flags);
7298
7299
7300
7301
7302 static inline __attribute__((always_inline)) void kick_process(struct task_struct *tsk) { }
7303
7304 extern void sched_fork(struct task_struct * p, int clone_flags);
7305 extern void sched_exit(struct task_struct * p);
7306
7307 extern int in_group_p(gid_t);
7308 extern int in_egroup_p(gid_t);
7309
7310 extern void proc_caches_init(void);
7311 extern void flush_signals(struct task_struct *);
7312 extern void flush_signal_handlers(struct task_struct *, int force_default);
7313 extern int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info);
7314
7315 static inline __attribute__((always_inline)) int dequeue_signal_lock(struct task_struct *tsk, sigset_t *mask, siginfo_t *info)
7316 {
7317 unsigned long flags;
7318 int ret;
7319
7320 do { do { __asm__ __volatile__ ( "cli %0;" :"=&d"(flags):); } while (0); do { do { } while (0); (void)0; (void)(&tsk->sighand->siglock); } while (0); } while (0);
7321 ret = dequeue_signal(tsk, mask, info);
7322 do { do { if (((flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); do { do { } while (0); (void)0; (void)(&tsk->sighand->siglock); } while (0); } while (0);
7323
7324 return ret;
7325 }
7326
7327 extern void block_all_signals(int (*notifier)(void *priv), void *priv,
7328 sigset_t *mask);
7329 extern void unblock_all_signals(void);
7330 extern void release_task(struct task_struct * p);
7331 extern int send_sig_info(int, struct siginfo *, struct task_struct *);
7332 extern int send_group_sig_info(int, struct siginfo *, struct task_struct *);
7333 extern int force_sigsegv(int, struct task_struct *);
7334 extern int force_sig_info(int, struct siginfo *, struct task_struct *);
7335 extern int __kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp);
7336 extern int kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp);
7337 extern int kill_pid_info(int sig, struct siginfo *info, struct pid *pid);
7338 extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_t, u32);
7339 extern int kill_pgrp(struct pid *pid, int sig, int priv);
7340 extern int kill_pid(struct pid *pid, int sig, int priv);
7341 extern int kill_proc_info(int, struct siginfo *, pid_t);
7342 extern void do_notify_parent(struct task_struct *, int);
7343 extern void force_sig(int, struct task_struct *);
7344 extern void force_sig_specific(int, struct task_struct *);
7345 extern int send_sig(int, struct task_struct *, int);
7346 extern void zap_other_threads(struct task_struct *p);
7347 extern int kill_proc(pid_t, int, int);
7348 extern struct sigqueue *sigqueue_alloc(void);
7349 extern void sigqueue_free(struct sigqueue *);
7350 extern int send_sigqueue(int, struct sigqueue *, struct task_struct *);
7351 extern int send_group_sigqueue(int, struct sigqueue *, struct task_struct *);
7352 extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *);
7353 extern int do_sigaltstack(const stack_t *, stack_t *, unsigned long);
7354
7355 static inline __attribute__((always_inline)) int kill_cad_pid(int sig, int priv)
7356 {
7357 return kill_pid(cad_pid, sig, priv);
7358 }
7359
7360
7361
7362
7363
7364
7365 static inline __attribute__((always_inline)) int is_si_special(const struct siginfo *info)
7366 {
7367 return info <= ((struct siginfo *) 2);
7368 }
7369
7370
7371
7372 static inline __attribute__((always_inline)) int on_sig_stack(unsigned long sp)
7373 {
7374 return (sp - (get_current())->sas_ss_sp < (get_current())->sas_ss_size);
7375 }
7376
7377 static inline __attribute__((always_inline)) int sas_ss_flags(unsigned long sp)
7378 {
7379 return ((get_current())->sas_ss_size == 0 ? 2
7380 : on_sig_stack(sp) ? 1 : 0);
7381 }
7382
7383
7384
7385
7386 extern struct mm_struct * mm_alloc(void);
7387
7388
7389 extern void __mmdrop(struct mm_struct *);
7390 static inline __attribute__((always_inline)) void mmdrop(struct mm_struct * mm)
7391 {
7392 if ((atomic_sub_return(1, (&mm->mm_count)) == 0))
7393 __mmdrop(mm);
7394 }
7395
7396
7397 extern void mmput(struct mm_struct *);
7398
7399 extern struct mm_struct *get_task_mm(struct task_struct *task);
7400
7401 extern void mm_release(struct task_struct *, struct mm_struct *);
7402
7403 extern int copy_thread(int, unsigned long, unsigned long, unsigned long, struct task_struct *, struct pt_regs *);
7404 extern void flush_thread(void);
7405 extern void exit_thread(void);
7406
7407 extern void exit_files(struct task_struct *);
7408 extern void __cleanup_signal(struct signal_struct *);
7409 extern void __cleanup_sighand(struct sighand_struct *);
7410 extern void exit_itimers(struct signal_struct *);
7411
7412 extern void do_group_exit(int);
7413
7414 extern void daemonize(const char *, ...);
7415 extern int allow_signal(int);
7416 extern int disallow_signal(int);
7417
7418 extern int do_execve(char *, char * *, char * *, struct pt_regs *);
7419 extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int *, int *);
7420 struct task_struct *fork_idle(int);
7421
7422 extern void set_task_comm(struct task_struct *tsk, char *from);
7423 extern void get_task_comm(char *to, struct task_struct *tsk);
7424 # 1448 "include/linux/sched.h"
7425 static inline __attribute__((always_inline)) int has_group_leader_pid(struct task_struct *p)
7426 {
7427 return p->pid == p->tgid;
7428 }
7429
7430 static inline __attribute__((always_inline)) struct task_struct *next_thread(const struct task_struct *p)
7431 {
7432 return ({ const typeof( ((struct task_struct *)0)->thread_group ) *__mptr = (({ typeof(p->thread_group.next) _________p1 = p->thread_group.next; do { } while(0); (_________p1); })); (struct task_struct *)( (char *)__mptr - __builtin_offsetof(struct task_struct,thread_group) );});
7433
7434 }
7435
7436 static inline __attribute__((always_inline)) int thread_group_empty(struct task_struct *p)
7437 {
7438 return list_empty(&p->thread_group);
7439 }
7440 # 1476 "include/linux/sched.h"
7441 static inline __attribute__((always_inline)) void task_lock(struct task_struct *p)
7442 {
7443 do { do { } while (0); (void)0; (void)(&p->alloc_lock); } while (0);
7444 }
7445
7446 static inline __attribute__((always_inline)) void task_unlock(struct task_struct *p)
7447 {
7448 do { do { } while (0); (void)0; (void)(&p->alloc_lock); } while (0);
7449 }
7450
7451 extern struct sighand_struct *lock_task_sighand(struct task_struct *tsk,
7452 unsigned long *flags);
7453
7454 static inline __attribute__((always_inline)) void unlock_task_sighand(struct task_struct *tsk,
7455 unsigned long *flags)
7456 {
7457 do { do { if (((*flags) != 0x1f)) do { __asm__ __volatile__ ( "sti %0;" ::"d"(irq_flags)); } while (0); } while (0); do { do { } while (0); (void)0; (void)(&tsk->sighand->siglock); } while (0); } while (0);
7458 }
7459
7460
7461
7462
7463
7464
7465 static inline __attribute__((always_inline)) void setup_thread_stack(struct task_struct *p, struct task_struct *org)
7466 {
7467 *(p)->thread_info = *(org)->thread_info;
7468 (p)->thread_info->task = p;
7469 }
7470
7471 static inline __attribute__((always_inline)) unsigned long *end_of_stack(struct task_struct *p)
7472 {
7473 return (unsigned long *)(p->thread_info + 1);
7474 }
7475
7476
7477
7478
7479
7480
7481 static inline __attribute__((always_inline)) void set_tsk_thread_flag(struct task_struct *tsk, int flag)
7482 {
7483 set_ti_thread_flag((tsk)->thread_info, flag);
7484 }
7485
7486 static inline __attribute__((always_inline)) void clear_tsk_thread_flag(struct task_struct *tsk, int flag)
7487 {
7488 clear_ti_thread_flag((tsk)->thread_info, flag);
7489 }
7490
7491 static inline __attribute__((always_inline)) int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag)
7492 {
7493 return test_and_set_ti_thread_flag((tsk)->thread_info, flag);
7494 }
7495
7496 static inline __attribute__((always_inline)) int test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag)
7497 {
7498 return test_and_clear_ti_thread_flag((tsk)->thread_info, flag);
7499 }
7500
7501 static inline __attribute__((always_inline)) int test_tsk_thread_flag(struct task_struct *tsk, int flag)
7502 {
7503 return test_ti_thread_flag((tsk)->thread_info, flag);
7504 }
7505
7506 static inline __attribute__((always_inline)) void set_tsk_need_resched(struct task_struct *tsk)
7507 {
7508 set_tsk_thread_flag(tsk,3);
7509 }
7510
7511 static inline __attribute__((always_inline)) void clear_tsk_need_resched(struct task_struct *tsk)
7512 {
7513 clear_tsk_thread_flag(tsk,3);
7514 }
7515
7516 static inline __attribute__((always_inline)) int signal_pending(struct task_struct *p)
7517 {
7518 return __builtin_expect(!!(test_tsk_thread_flag(p,2)), 0);
7519 }
7520
7521 static inline __attribute__((always_inline)) int need_resched(void)
7522 {
7523 return __builtin_expect(!!(test_ti_thread_flag(current_thread_info(), 3)), 0);
7524 }
7525 # 1568 "include/linux/sched.h"
7526 extern int cond_resched(void);
7527 extern int cond_resched_lock(spinlock_t * lock);
7528 extern int cond_resched_softirq(void);
7529 # 1586 "include/linux/sched.h"
7530 static inline __attribute__((always_inline)) int lock_need_resched(spinlock_t *lock)
7531 {
7532 if (0 || need_resched())
7533 return 1;
7534 return 0;
7535 }
7536
7537
7538
7539
7540
7541 extern void recalc_sigpending_tsk(struct task_struct *t);
7542 extern void recalc_sigpending(void);
7543
7544 extern void signal_wake_up(struct task_struct *t, int resume_stopped);
7545 # 1619 "include/linux/sched.h"
7546 static inline __attribute__((always_inline)) unsigned int task_cpu(const struct task_struct *p)
7547 {
7548 return 0;
7549 }
7550
7551 static inline __attribute__((always_inline)) void set_task_cpu(struct task_struct *p, unsigned int cpu)
7552 {
7553 }
7554
7555
7556
7557
7558
7559
7560 static inline __attribute__((always_inline)) void arch_pick_mmap_layout(struct mm_struct *mm)
7561 {
7562 mm->mmap_base = 0;
7563 mm->get_unmapped_area = arch_get_unmapped_area;
7564 mm->unmap_area = arch_unmap_area;
7565 }
7566
7567
7568 extern long sched_setaffinity(pid_t pid, cpumask_t new_mask);
7569 extern long sched_getaffinity(pid_t pid, cpumask_t *mask);
7570
7571 # 1 "include/linux/sysdev.h" 1
7572 # 24 "include/linux/sysdev.h"
7573 # 1 "include/linux/kobject.h" 1
7574 # 22 "include/linux/kobject.h"
7575 # 1 "include/linux/sysfs.h" 1
7576 # 18 "include/linux/sysfs.h"
7577 struct kobject;
7578 struct module;
7579 struct nameidata;
7580 struct dentry;
7581
7582 struct attribute {
7583 const char * name;
7584 struct module * owner;
7585 mode_t mode;
7586 };
7587
7588 struct attribute_group {
7589 const char * name;
7590 struct attribute ** attrs;
7591 };
7592 # 56 "include/linux/sysfs.h"
7593 struct vm_area_struct;
7594
7595 struct bin_attribute {
7596 struct attribute attr;
7597 size_t size;
7598 void *private;
7599 ssize_t (*read)(struct kobject *, char *, loff_t, size_t);
7600 ssize_t (*write)(struct kobject *, char *, loff_t, size_t);
7601 int (*mmap)(struct kobject *, struct bin_attribute *attr,
7602 struct vm_area_struct *vma);
7603 };
7604
7605 struct sysfs_ops {
7606 ssize_t (*show)(struct kobject *, struct attribute *,char *);
7607 ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
7608 };
7609 # 82 "include/linux/sysfs.h"
7610 extern int sysfs_schedule_callback(struct kobject *kobj,
7611 void (*func)(void *), void *data);
7612
7613 extern int __attribute__((warn_unused_result))
7614 sysfs_create_dir(struct kobject *, struct dentry *);
7615
7616 extern void
7617 sysfs_remove_dir(struct kobject *);
7618
7619 extern int __attribute__((warn_unused_result))
7620 sysfs_rename_dir(struct kobject *, struct dentry *, const char *new_name);
7621
7622 extern int __attribute__((warn_unused_result))
7623 sysfs_move_dir(struct kobject *, struct kobject *);
7624
7625 extern int __attribute__((warn_unused_result))
7626 sysfs_create_file(struct kobject *, const struct attribute *);
7627
7628 extern int __attribute__((warn_unused_result))
7629 sysfs_update_file(struct kobject *, const struct attribute *);
7630
7631 extern int __attribute__((warn_unused_result))
7632 sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode);
7633
7634 extern void
7635 sysfs_remove_file(struct kobject *, const struct attribute *);
7636
7637 extern int __attribute__((warn_unused_result))
7638 sysfs_create_link(struct kobject * kobj, struct kobject * target, const char * name);
7639
7640 extern void
7641 sysfs_remove_link(struct kobject *, const char * name);
7642
7643 int __attribute__((warn_unused_result)) sysfs_create_bin_file(struct kobject *kobj,
7644 struct bin_attribute *attr);
7645 void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr);
7646
7647 int __attribute__((warn_unused_result)) sysfs_create_group(struct kobject *,
7648 const struct attribute_group *);
7649 void sysfs_remove_group(struct kobject *, const struct attribute_group *);
7650 int sysfs_add_file_to_group(struct kobject *kobj,
7651 const struct attribute *attr, const char *group);
7652 void sysfs_remove_file_from_group(struct kobject *kobj,
7653 const struct attribute *attr, const char *group);
7654
7655 void sysfs_notify(struct kobject * k, char *dir, char *attr);
7656
7657
7658 extern int sysfs_make_shadowed_dir(struct kobject *kobj,
7659 void * (*follow_link)(struct dentry *, struct nameidata *));
7660 extern struct dentry *sysfs_create_shadow_dir(struct kobject *kobj);
7661 extern void sysfs_remove_shadow_dir(struct dentry *dir);
7662
7663 extern int __attribute__((warn_unused_result)) sysfs_init(void);
7664 # 23 "include/linux/kobject.h" 2
7665 # 35 "include/linux/kobject.h"
7666 extern char uevent_helper[];
7667
7668
7669 extern u64 uevent_seqnum;
7670
7671
7672 typedef int kobject_action_t;
7673 enum kobject_action {
7674 KOBJ_ADD = ( kobject_action_t) 0x01,
7675 KOBJ_REMOVE = ( kobject_action_t) 0x02,
7676 KOBJ_CHANGE = ( kobject_action_t) 0x03,
7677 KOBJ_MOUNT = ( kobject_action_t) 0x04,
7678 KOBJ_UMOUNT = ( kobject_action_t) 0x05,
7679 KOBJ_OFFLINE = ( kobject_action_t) 0x06,
7680 KOBJ_ONLINE = ( kobject_action_t) 0x07,
7681 KOBJ_MOVE = ( kobject_action_t) 0x08,
7682 };
7683
7684 struct kobject {
7685 const char * k_name;
7686 char name[20];
7687 struct kref kref;
7688 struct list_head entry;
7689 struct kobject * parent;
7690 struct kset * kset;
7691 struct kobj_type * ktype;
7692 struct dentry * dentry;
7693 wait_queue_head_t poll;
7694 };
7695
7696 extern int kobject_set_name(struct kobject *, const char *, ...)
7697 __attribute__((format(printf,2,3)));
7698
7699 static inline __attribute__((always_inline)) const char * kobject_name(const struct kobject * kobj)
7700 {
7701 return kobj->k_name;
7702 }
7703
7704 extern void kobject_init(struct kobject *);
7705 extern void kobject_cleanup(struct kobject *);
7706
7707 extern int __attribute__((warn_unused_result)) kobject_add(struct kobject *);
7708 extern int __attribute__((warn_unused_result)) kobject_shadow_add(struct kobject *, struct dentry *);
7709 extern void kobject_del(struct kobject *);
7710
7711 extern int __attribute__((warn_unused_result)) kobject_rename(struct kobject *, const char *new_name);
7712 extern int __attribute__((warn_unused_result)) kobject_shadow_rename(struct kobject *kobj,
7713 struct dentry *new_parent,
7714 const char *new_name);
7715 extern int __attribute__((warn_unused_result)) kobject_move(struct kobject *, struct kobject *);
7716
7717 extern int __attribute__((warn_unused_result)) kobject_register(struct kobject *);
7718 extern void kobject_unregister(struct kobject *);
7719
7720 extern struct kobject * kobject_get(struct kobject *);
7721 extern void kobject_put(struct kobject *);
7722
7723 extern struct kobject *kobject_add_dir(struct kobject *, const char *);
7724
7725 extern char * kobject_get_path(struct kobject *, gfp_t);
7726
7727 struct kobj_type {
7728 void (*release)(struct kobject *);
7729 struct sysfs_ops * sysfs_ops;
7730 struct attribute ** default_attrs;
7731 };
7732 # 120 "include/linux/kobject.h"
7733 struct kset_uevent_ops {
7734 int (*filter)(struct kset *kset, struct kobject *kobj);
7735 const char *(*name)(struct kset *kset, struct kobject *kobj);
7736 int (*uevent)(struct kset *kset, struct kobject *kobj, char **envp,
7737 int num_envp, char *buffer, int buffer_size);
7738 };
7739
7740 struct kset {
7741 struct subsystem * subsys;
7742 struct kobj_type * ktype;
7743 struct list_head list;
7744 spinlock_t list_lock;
7745 struct kobject kobj;
7746 struct kset_uevent_ops * uevent_ops;
7747 };
7748
7749
7750 extern void kset_init(struct kset * k);
7751 extern int __attribute__((warn_unused_result)) kset_add(struct kset * k);
7752 extern int __attribute__((warn_unused_result)) kset_register(struct kset * k);
7753 extern void kset_unregister(struct kset * k);
7754
7755 static inline __attribute__((always_inline)) struct kset * to_kset(struct kobject * kobj)
7756 {
7757 return kobj ? ({ const typeof( ((struct kset *)0)->kobj ) *__mptr = (kobj); (struct kset *)( (char *)__mptr - __builtin_offsetof(struct kset,kobj) );}) : ((void *)0);
7758 }
7759
7760 static inline __attribute__((always_inline)) struct kset * kset_get(struct kset * k)
7761 {
7762 return k ? to_kset(kobject_get(&k->kobj)) : ((void *)0);
7763 }
7764
7765 static inline __attribute__((always_inline)) void kset_put(struct kset * k)
7766 {
7767 kobject_put(&k->kobj);
7768 }
7769
7770 static inline __attribute__((always_inline)) struct kobj_type * get_ktype(struct kobject * k)
7771 {
7772 if (k->kset && k->kset->ktype)
7773 return k->kset->ktype;
7774 else
7775 return k->ktype;
7776 }
7777
7778 extern struct kobject * kset_find_obj(struct kset *, const char *);
7779 # 176 "include/linux/kobject.h"
7780 struct subsystem {
7781 struct kset kset;
7782 struct rw_semaphore rwsem;
7783 };
7784 # 199 "include/linux/kobject.h"
7785 extern struct subsystem kernel_subsys;
7786
7787 extern struct subsystem hypervisor_subsys;
7788 # 248 "include/linux/kobject.h"
7789 extern void subsystem_init(struct subsystem *);
7790 extern int __attribute__((warn_unused_result)) subsystem_register(struct subsystem *);
7791 extern void subsystem_unregister(struct subsystem *);
7792
7793 static inline __attribute__((always_inline)) struct subsystem * subsys_get(struct subsystem * s)
7794 {
7795 return s ? ({ const typeof( ((struct subsystem *)0)->kset ) *__mptr = (kset_get(&s->kset)); (struct subsystem *)( (char *)__mptr - __builtin_offsetof(struct subsystem,kset) );}) : ((void *)0);
7796 }
7797
7798 static inline __attribute__((always_inline)) void subsys_put(struct subsystem * s)
7799 {
7800 kset_put(&s->kset);
7801 }
7802
7803 struct subsys_attribute {
7804 struct attribute attr;
7805 ssize_t (*show)(struct subsystem *, char *);
7806 ssize_t (*store)(struct subsystem *, const char *, size_t);
7807 };
7808
7809 extern int __attribute__((warn_unused_result)) subsys_create_file(struct subsystem * ,
7810 struct subsys_attribute *);
7811
7812
7813 int kobject_uevent(struct kobject *kobj, enum kobject_action action);
7814 int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
7815 char *envp[]);
7816
7817 int add_uevent_var(char **envp, int num_envp, int *cur_index,
7818 char *buffer, int buffer_size, int *cur_len,
7819 const char *format, ...)
7820 __attribute__((format (printf, 7, 8)));
7821 # 25 "include/linux/sysdev.h" 2
7822 # 1 "include/linux/pm.h" 1
7823 # 34 "include/linux/pm.h"
7824 typedef int pm_request_t;
7825 # 43 "include/linux/pm.h"
7826 typedef int pm_dev_t;
7827 # 56 "include/linux/pm.h"
7828 enum
7829 {
7830 PM_SYS_UNKNOWN = 0x00000000,
7831 PM_SYS_KBC = 0x41d00303,
7832 PM_SYS_COM = 0x41d00500,
7833 PM_SYS_IRDA = 0x41d00510,
7834 PM_SYS_FDC = 0x41d00700,
7835 PM_SYS_VGA = 0x41d00900,
7836 PM_SYS_PCMCIA = 0x41d00e00,
7837 };
7838 # 75 "include/linux/pm.h"
7839 struct pm_dev;
7840
7841 typedef int (*pm_callback)(struct pm_dev *dev, pm_request_t rqst, void *data);
7842
7843
7844
7845
7846 struct pm_dev
7847 {
7848 pm_dev_t type;
7849 unsigned long id;
7850 pm_callback callback;
7851 void *data;
7852
7853 unsigned long flags;
7854 unsigned long state;
7855 unsigned long prev_state;
7856
7857 struct list_head entry;
7858 };
7859
7860
7861
7862
7863
7864
7865
7866 extern void (*pm_idle)(void);
7867 extern void (*pm_power_off)(void);
7868
7869 typedef int suspend_state_t;
7870
7871
7872
7873
7874
7875
7876
7877 typedef int suspend_disk_method_t;
7878 # 152 "include/linux/pm.h"
7879 struct pm_ops {
7880 int (*valid)(suspend_state_t state);
7881 int (*prepare)(suspend_state_t state);
7882 int (*enter)(suspend_state_t state);
7883 int (*finish)(suspend_state_t state);
7884 suspend_disk_method_t pm_disk_mode;
7885 };
7886
7887
7888
7889
7890
7891 extern void pm_set_ops(struct pm_ops *pm_ops);
7892 extern struct pm_ops *pm_ops;
7893 extern int pm_suspend(suspend_state_t state);
7894
7895
7896
7897
7898
7899
7900 struct device;
7901
7902 typedef struct pm_message {
7903 int event;
7904 } pm_message_t;
7905 # 238 "include/linux/pm.h"
7906 struct dev_pm_info {
7907 pm_message_t power_state;
7908 unsigned can_wakeup:1;
7909
7910 unsigned should_wakeup:1;
7911 pm_message_t prev_state;
7912 void * saved_state;
7913 struct device * pm_parent;
7914 struct list_head entry;
7915
7916 };
7917
7918 extern void device_pm_set_parent(struct device * dev, struct device * parent);
7919
7920 extern int device_power_down(pm_message_t state);
7921 extern void device_power_up(void);
7922 extern void device_resume(void);
7923
7924
7925 extern suspend_disk_method_t pm_disk_mode;
7926
7927 extern int device_suspend(pm_message_t state);
7928 extern int device_prepare_suspend(pm_message_t state);
7929
7930
7931
7932
7933
7934
7935 extern int dpm_runtime_suspend(struct device *, pm_message_t);
7936 extern void dpm_runtime_resume(struct device *);
7937 extern void __suspend_report_result(const char *function, void *fn, int ret);
7938 # 26 "include/linux/sysdev.h" 2
7939
7940
7941 struct sys_device;
7942
7943 struct sysdev_class {
7944 struct list_head drivers;
7945
7946
7947 int (*shutdown)(struct sys_device *);
7948 int (*suspend)(struct sys_device *, pm_message_t state);
7949 int (*resume)(struct sys_device *);
7950 struct kset kset;
7951 };
7952
7953 struct sysdev_class_attribute {
7954 struct attribute attr;
7955 ssize_t (*show)(struct sysdev_class *, char *);
7956 ssize_t (*store)(struct sysdev_class *, const char *, size_t);
7957 };
7958 # 54 "include/linux/sysdev.h"
7959 extern int sysdev_class_register(struct sysdev_class *);
7960 extern void sysdev_class_unregister(struct sysdev_class *);
7961
7962 extern int sysdev_class_create_file(struct sysdev_class *,
7963 struct sysdev_class_attribute *);
7964 extern void sysdev_class_remove_file(struct sysdev_class *,
7965 struct sysdev_class_attribute *);
7966
7967
7968
7969
7970 struct sysdev_driver {
7971 struct list_head entry;
7972 int (*add)(struct sys_device *);
7973 int (*remove)(struct sys_device *);
7974 int (*shutdown)(struct sys_device *);
7975 int (*suspend)(struct sys_device *, pm_message_t state);
7976 int (*resume)(struct sys_device *);
7977 };
7978
7979
7980 extern int sysdev_driver_register(struct sysdev_class *, struct sysdev_driver *);
7981 extern void sysdev_driver_unregister(struct sysdev_class *, struct sysdev_driver *);
7982
7983
7984
7985
7986
7987
7988
7989 struct sys_device {
7990 u32 id;
7991 struct sysdev_class * cls;
7992 struct kobject kobj;
7993 };
7994
7995 extern int sysdev_register(struct sys_device *);
7996 extern void sysdev_unregister(struct sys_device *);
7997
7998
7999 struct sysdev_attribute {
8000 struct attribute attr;
8001 ssize_t (*show)(struct sys_device *, char *);
8002 ssize_t (*store)(struct sys_device *, const char *, size_t);
8003 };
8004 # 112 "include/linux/sysdev.h"
8005 extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *);
8006 extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *);
8007 # 1645 "include/linux/sched.h" 2
8008 extern int sched_mc_power_savings, sched_smt_power_savings;
8009 extern struct sysdev_attribute attr_sched_mc_power_savings, attr_sched_smt_power_savings;
8010 extern int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls);
8011
8012 extern void normalize_rt_tasks(void);
8013 # 1672 "include/linux/sched.h"
8014 static inline __attribute__((always_inline)) void add_rchar(struct task_struct *tsk, ssize_t amt)
8015 {
8016 }
8017
8018 static inline __attribute__((always_inline)) void add_wchar(struct task_struct *tsk, ssize_t amt)
8019 {
8020 }
8021
8022 static inline __attribute__((always_inline)) void inc_syscr(struct task_struct *tsk)
8023 {
8024 }
8025
8026 static inline __attribute__((always_inline)) void inc_syscw(struct task_struct *tsk)
8027 {
8028 }
8029 # 13 "include/asm/uaccess.h" 2
8030 # 1 "include/linux/mm.h" 1
8031 # 14 "include/linux/mm.h"
8032 # 1 "include/linux/prio_tree.h" 1
8033 # 14 "include/linux/prio_tree.h"
8034 struct raw_prio_tree_node {
8035 struct prio_tree_node *left;
8036 struct prio_tree_node *right;
8037 struct prio_tree_node *parent;
8038 };
8039
8040 struct prio_tree_node {
8041 struct prio_tree_node *left;
8042 struct prio_tree_node *right;
8043 struct prio_tree_node *parent;
8044 unsigned long start;
8045 unsigned long last;
8046 };
8047
8048 struct prio_tree_root {
8049 struct prio_tree_node *prio_tree_node;
8050 unsigned short index_bits;
8051 unsigned short raw;
8052
8053
8054
8055
8056 };
8057
8058 struct prio_tree_iter {
8059 struct prio_tree_node *cur;
8060 unsigned long mask;
8061 unsigned long value;
8062 int size_level;
8063
8064 struct prio_tree_root *root;
8065 unsigned long r_index;
8066 unsigned long h_index;
8067 };
8068
8069 static inline __attribute__((always_inline)) void prio_tree_iter_init(struct prio_tree_iter *iter,
8070 struct prio_tree_root *root, unsigned long r_index, unsigned long h_index)
8071 {
8072 iter->root = root;
8073 iter->r_index = r_index;
8074 iter->h_index = h_index;
8075 iter->cur = ((void *)0);
8076 }
8077 # 84 "include/linux/prio_tree.h"
8078 static inline __attribute__((always_inline)) int prio_tree_empty(const struct prio_tree_root *root)
8079 {
8080 return root->prio_tree_node == ((void *)0);
8081 }
8082
8083 static inline __attribute__((always_inline)) int prio_tree_root(const struct prio_tree_node *node)
8084 {
8085 return node->parent == node;
8086 }
8087
8088 static inline __attribute__((always_inline)) int prio_tree_left_empty(const struct prio_tree_node *node)
8089 {
8090 return node->left == node;
8091 }
8092
8093 static inline __attribute__((always_inline)) int prio_tree_right_empty(const struct prio_tree_node *node)
8094 {
8095 return node->right == node;
8096 }
8097
8098
8099 struct prio_tree_node *prio_tree_replace(struct prio_tree_root *root,
8100 struct prio_tree_node *old, struct prio_tree_node *node);
8101 struct prio_tree_node *prio_tree_insert(struct prio_tree_root *root,
8102 struct prio_tree_node *node);
8103 void prio_tree_remove(struct prio_tree_root *root, struct prio_tree_node *node);
8104 struct prio_tree_node *prio_tree_next(struct prio_tree_iter *iter);
8105 # 15 "include/linux/mm.h" 2
8106 # 1 "include/linux/fs.h" 1
8107 # 9 "include/linux/fs.h"
8108 # 1 "include/linux/limits.h" 1
8109 # 10 "include/linux/fs.h" 2
8110 # 1 "include/linux/ioctl.h" 1
8111
8112
8113
8114 # 1 "include/asm/ioctl.h" 1
8115 # 1 "include/asm-generic/ioctl.h" 1
8116 # 51 "include/asm-generic/ioctl.h"
8117 extern unsigned int __invalid_size_argument_for_IOC;
8118 # 1 "include/asm/ioctl.h" 2
8119 # 5 "include/linux/ioctl.h" 2
8120 # 11 "include/linux/fs.h" 2
8121 # 35 "include/linux/fs.h"
8122 struct files_stat_struct {
8123 int nr_files;
8124 int nr_free_files;
8125 int max_files;
8126 };
8127 extern struct files_stat_struct files_stat;
8128 extern int get_max_files(void);
8129
8130 struct inodes_stat_t {
8131 int nr_inodes;
8132 int nr_unused;
8133 int dummy[5];
8134 };
8135 extern struct inodes_stat_t inodes_stat;
8136
8137 extern int leases_enable, lease_break_time;
8138 # 272 "include/linux/fs.h"
8139 # 1 "include/linux/kdev_t.h" 1
8140 # 21 "include/linux/kdev_t.h"
8141 static inline __attribute__((always_inline)) int old_valid_dev(dev_t dev)
8142 {
8143 return ((unsigned int) ((dev) >> 20)) < 256 && ((unsigned int) ((dev) & ((1U << 20) - 1))) < 256;
8144 }
8145
8146 static inline __attribute__((always_inline)) u16 old_encode_dev(dev_t dev)
8147 {
8148 return (((unsigned int) ((dev) >> 20)) << 8) | ((unsigned int) ((dev) & ((1U << 20) - 1)));
8149 }
8150
8151 static inline __attribute__((always_inline)) dev_t old_decode_dev(u16 val)
8152 {
8153 return ((((val >> 8) & 255) << 20) | (val & 255));
8154 }
8155
8156 static inline __attribute__((always_inline)) int new_valid_dev(dev_t dev)
8157 {
8158 return 1;
8159 }
8160
8161 static inline __attribute__((always_inline)) u32 new_encode_dev(dev_t dev)
8162 {
8163 unsigned major = ((unsigned int) ((dev) >> 20));
8164 unsigned minor = ((unsigned int) ((dev) & ((1U << 20) - 1)));
8165 return (minor & 0xff) | (major << 8) | ((minor & ~0xff) << 12);
8166 }
8167
8168 static inline __attribute__((always_inline)) dev_t new_decode_dev(u32 dev)
8169 {
8170 unsigned major = (dev & 0xfff00) >> 8;
8171 unsigned minor = (dev & 0xff) | ((dev >> 12) & 0xfff00);
8172 return (((major) << 20) | (minor));
8173 }
8174
8175 static inline __attribute__((always_inline)) int huge_valid_dev(dev_t dev)
8176 {
8177 return 1;
8178 }
8179
8180 static inline __attribute__((always_inline)) u64 huge_encode_dev(dev_t dev)
8181 {
8182 return new_encode_dev(dev);
8183 }
8184
8185 static inline __attribute__((always_inline)) dev_t huge_decode_dev(u64 dev)
8186 {
8187 return new_decode_dev(dev);
8188 }
8189
8190 static inline __attribute__((always_inline)) int sysv_valid_dev(dev_t dev)
8191 {
8192 return ((unsigned int) ((dev) >> 20)) < (1<<14) && ((unsigned int) ((dev) & ((1U << 20) - 1))) < (1<<18);
8193 }
8194
8195 static inline __attribute__((always_inline)) u32 sysv_encode_dev(dev_t dev)
8196 {
8197 return ((unsigned int) ((dev) & ((1U << 20) - 1))) | (((unsigned int) ((dev) >> 20)) << 18);
8198 }
8199
8200 static inline __attribute__((always_inline)) unsigned sysv_major(u32 dev)
8201 {
8202 return (dev >> 18) & 0x3fff;
8203 }
8204
8205 static inline __attribute__((always_inline)) unsigned sysv_minor(u32 dev)
8206 {
8207 return dev & 0x3ffff;
8208 }
8209 # 273 "include/linux/fs.h" 2
8210 # 1 "include/linux/dcache.h" 1
8211 # 12 "include/linux/dcache.h"
8212 struct nameidata;
8213 struct vfsmount;
8214 # 33 "include/linux/dcache.h"
8215 struct qstr {
8216 unsigned int hash;
8217 unsigned int len;
8218 const unsigned char *name;
8219 };
8220
8221 struct dentry_stat_t {
8222 int nr_dentry;
8223 int nr_unused;
8224 int age_limit;
8225 int want_pages;
8226 int dummy[2];
8227 };
8228 extern struct dentry_stat_t dentry_stat;
8229
8230
8231
8232
8233
8234
8235 static inline __attribute__((always_inline)) unsigned long
8236 partial_name_hash(unsigned long c, unsigned long prevhash)
8237 {
8238 return (prevhash + (c << 4) + (c >> 4)) * 11;
8239 }
8240
8241
8242
8243
8244
8245 static inline __attribute__((always_inline)) unsigned long end_name_hash(unsigned long hash)
8246 {
8247 return (unsigned int) hash;
8248 }
8249
8250
8251 static inline __attribute__((always_inline)) unsigned int
8252 full_name_hash(const unsigned char *name, unsigned int len)
8253 {
8254 unsigned long hash = 0;
8255 while (len--)
8256 hash = partial_name_hash(*name++, hash);
8257 return end_name_hash(hash);
8258 }
8259
8260 struct dcookie_struct;
8261
8262
8263
8264 struct dentry {
8265 atomic_t d_count;
8266 unsigned int d_flags;
8267 spinlock_t d_lock;
8268 struct inode *d_inode;
8269
8270
8271
8272
8273
8274 struct hlist_node d_hash;
8275 struct dentry *d_parent;
8276 struct qstr d_name;
8277
8278 struct list_head d_lru;
8279
8280
8281
8282 union {
8283 struct list_head d_child;
8284 struct rcu_head d_rcu;
8285 } d_u;
8286 struct list_head d_subdirs;
8287 struct list_head d_alias;
8288 unsigned long d_time;
8289 struct dentry_operations *d_op;
8290 struct super_block *d_sb;
8291 void *d_fsdata;
8292
8293
8294
8295 int d_mounted;
8296 unsigned char d_iname[36];
8297 };
8298
8299
8300
8301
8302
8303
8304
8305 enum dentry_d_lock_class
8306 {
8307 DENTRY_D_LOCK_NORMAL,
8308 DENTRY_D_LOCK_NESTED
8309 };
8310
8311 struct dentry_operations {
8312 int (*d_revalidate)(struct dentry *, struct nameidata *);
8313 int (*d_hash) (struct dentry *, struct qstr *);
8314 int (*d_compare) (struct dentry *, struct qstr *, struct qstr *);
8315 int (*d_delete)(struct dentry *);
8316 void (*d_release)(struct dentry *);
8317 void (*d_iput)(struct dentry *, struct inode *);
8318 };
8319 # 179 "include/linux/dcache.h"
8320 extern spinlock_t dcache_lock;
8321 # 197 "include/linux/dcache.h"
8322 static inline __attribute__((always_inline)) void __d_drop(struct dentry *dentry)
8323 {
8324 if (!(dentry->d_flags & 0x0010)) {
8325 dentry->d_flags |= 0x0010;
8326 hlist_del_rcu(&dentry->d_hash);
8327 }
8328 }
8329
8330 static inline __attribute__((always_inline)) void d_drop(struct dentry *dentry)
8331 {
8332 do { do { } while (0); (void)0; (void)(&dcache_lock); } while (0);
8333 do { do { } while (0); (void)0; (void)(&dentry->d_lock); } while (0);
8334 __d_drop(dentry);
8335 do { do { } while (0); (void)0; (void)(&dentry->d_lock); } while (0);
8336 do { do { } while (0); (void)0; (void)(&dcache_lock); } while (0);
8337 }
8338
8339 static inline __attribute__((always_inline)) int dname_external(struct dentry *dentry)
8340 {
8341 return dentry->d_name.name != dentry->d_iname;
8342 }
8343
8344
8345
8346
8347 extern void d_instantiate(struct dentry *, struct inode *);
8348 extern struct dentry * d_instantiate_unique(struct dentry *, struct inode *);
8349 extern struct dentry * d_materialise_unique(struct dentry *, struct inode *);
8350 extern void d_delete(struct dentry *);
8351
8352
8353 extern struct dentry * d_alloc(struct dentry *, const struct qstr *);
8354 extern struct dentry * d_alloc_anon(struct inode *);
8355 extern struct dentry * d_splice_alias(struct inode *, struct dentry *);
8356 extern void shrink_dcache_sb(struct super_block *);
8357 extern void shrink_dcache_parent(struct dentry *);
8358 extern void shrink_dcache_for_umount(struct super_block *);
8359 extern int d_invalidate(struct dentry *);
8360
8361
8362 extern struct dentry * d_alloc_root(struct inode *);
8363
8364
8365 extern void d_genocide(struct dentry *);
8366
8367 extern struct dentry *d_find_alias(struct inode *);
8368 extern void d_prune_aliases(struct inode *);
8369
8370
8371 extern int have_submounts(struct dentry *);
8372
8373
8374
8375
8376 extern void d_rehash(struct dentry *);
8377 # 262 "include/linux/dcache.h"
8378 static inline __attribute__((always_inline)) void d_add(struct dentry *entry, struct inode *inode)
8379 {
8380 d_instantiate(entry, inode);
8381 d_rehash(entry);
8382 }
8383 # 276 "include/linux/dcache.h"
8384 static inline __attribute__((always_inline)) struct dentry *d_add_unique(struct dentry *entry, struct inode *inode)
8385 {
8386 struct dentry *res;
8387
8388 res = d_instantiate_unique(entry, inode);
8389 d_rehash(res != ((void *)0) ? res : entry);
8390 return res;
8391 }
8392
8393
8394 extern void d_move(struct dentry *, struct dentry *);
8395
8396
8397 extern struct dentry * d_lookup(struct dentry *, struct qstr *);
8398 extern struct dentry * __d_lookup(struct dentry *, struct qstr *);
8399 extern struct dentry * d_hash_and_lookup(struct dentry *, struct qstr *);
8400
8401
8402 extern int d_validate(struct dentry *, struct dentry *);
8403
8404 extern char * d_path(struct dentry *, struct vfsmount *, char *, int);
8405 # 313 "include/linux/dcache.h"
8406 static inline __attribute__((always_inline)) struct dentry *dget(struct dentry *dentry)
8407 {
8408 if (dentry) {
8409 do { if (__builtin_expect(!!((!((&dentry->d_count)->counter))!=0), 0)) do { printk("BUG: failure at %s:%d/%s()!\n", "include/linux/dcache.h", 316, (__func__)); panic("BUG!"); } while (0); } while(0);
8410 atomic_inc(&dentry->d_count);
8411 }
8412 return dentry;
8413 }
8414
8415 extern struct dentry * dget_locked(struct dentry *);
8416 # 331 "include/linux/dcache.h"
8417 static inline __attribute__((always_inline)) int d_unhashed(struct dentry *dentry)
8418 {
8419 return (dentry->d_flags & 0x0010);
8420 }
8421
8422 static inline __attribute__((always_inline)) struct dentry *dget_parent(struct dentry *dentry)
8423 {
8424 struct dentry *ret;
8425
8426 do { do { } while (0); (void)0; (void)(&dentry->d_lock); } while (0);
8427 ret = dget(dentry->d_parent);
8428 do { do { } while (0); (void)0; (void)(&dentry->d_lock); } while (0);
8429 return ret;
8430 }
8431
8432 extern void dput(struct dentry *);
8433
8434 static inline __attribute__((always_inline)) int d_mountpoint(struct dentry *dentry)
8435 {
8436 return dentry->d_mounted;
8437 }
8438
8439 extern struct vfsmount *lookup_mnt(struct vfsmount *, struct dentry *);
8440 extern struct vfsmount *__lookup_mnt(struct vfsmount *, struct dentry *, int);
8441 extern struct dentry *lookup_create(struct nameidata *nd, int is_dir);
8442
8443 extern int sysctl_vfs_cache_pressure;
8444 # 274 "include/linux/fs.h" 2
8445 # 1 "include/linux/namei.h" 1
8446
8447
8448
8449
8450
8451
8452 struct vfsmount;
8453
8454 struct open_intent {
8455 int flags;
8456 int create_mode;
8457 struct file *file;
8458 };
8459
8460 enum { MAX_NESTED_LINKS = 8 };
8461
8462 struct nameidata {
8463 struct dentry *dentry;
8464 struct vfsmount *mnt;
8465 struct qstr last;
8466 unsigned int flags;
8467 int last_type;
8468 unsigned depth;
8469 char *saved_names[MAX_NESTED_LINKS + 1];
8470
8471
8472 union {
8473 struct open_intent open;
8474 } intent;
8475 };
8476
8477 struct path {
8478 struct vfsmount *mnt;
8479 struct dentry *dentry;
8480 };
8481
8482
8483
8484
8485 enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
8486 # 65 "include/linux/namei.h"
8487 extern int __user_walk(const char *, unsigned, struct nameidata *);
8488 extern int __user_walk_fd(int dfd, const char *, unsigned, struct nameidata *);
8489
8490
8491
8492
8493 extern int path_lookup(const char *, unsigned, struct nameidata *);
8494 extern int path_walk(const char *, struct nameidata *);
8495 extern int link_path_walk(const char *, struct nameidata *);
8496 extern void path_release(struct nameidata *);
8497 extern void path_release_on_umount(struct nameidata *);
8498
8499 extern int __user_path_lookup_open(const char *, unsigned lookup_flags, struct nameidata *nd, int open_flags);
8500 extern int path_lookup_open(int dfd, const char *name, unsigned lookup_flags, struct nameidata *, int open_flags);
8501 extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry,
8502 int (*open)(struct inode *, struct file *));
8503 extern struct file *nameidata_to_filp(struct nameidata *nd, int flags);
8504 extern void release_open_intent(struct nameidata *);
8505
8506 extern struct dentry * lookup_one_len(const char *, struct dentry *, int);
8507
8508 extern int follow_down(struct vfsmount **, struct dentry **);
8509 extern int follow_up(struct vfsmount **, struct dentry **);
8510
8511 extern struct dentry *lock_rename(struct dentry *, struct dentry *);
8512 extern void unlock_rename(struct dentry *, struct dentry *);
8513
8514 static inline __attribute__((always_inline)) void nd_set_link(struct nameidata *nd, char *path)
8515 {
8516 nd->saved_names[nd->depth] = path;
8517 }
8518
8519 static inline __attribute__((always_inline)) char *nd_get_link(struct nameidata *nd)
8520 {
8521 return nd->saved_names[nd->depth];
8522 }
8523 # 275 "include/linux/fs.h" 2
8524 # 1 "include/linux/stat.h" 1
8525
8526
8527
8528
8529
8530 # 1 "include/asm/stat.h" 1
8531
8532
8533
8534 struct stat {
8535 unsigned short st_dev;
8536 unsigned short __pad1;
8537 unsigned long st_ino;
8538 unsigned short st_mode;
8539 unsigned short st_nlink;
8540 unsigned short st_uid;
8541 unsigned short st_gid;
8542 unsigned short st_rdev;
8543 unsigned short __pad2;
8544 unsigned long st_size;
8545 unsigned long st_blksize;
8546 unsigned long st_blocks;
8547 unsigned long st_atime;
8548 unsigned long __unused1;
8549 unsigned long st_mtime;
8550 unsigned long __unused2;
8551 unsigned long st_ctime;
8552 unsigned long __unused3;
8553 unsigned long __unused4;
8554 unsigned long __unused5;
8555 };
8556
8557
8558
8559
8560 struct stat64 {
8561 unsigned long long st_dev;
8562 unsigned char __pad1[4];
8563
8564
8565 unsigned long __st_ino;
8566
8567 unsigned int st_mode;
8568 unsigned int st_nlink;
8569
8570 unsigned long st_uid;
8571 unsigned long st_gid;
8572
8573 unsigned long long st_rdev;
8574 unsigned char __pad2[4];
8575
8576 long long st_size;
8577 unsigned long st_blksize;
8578
8579 long long st_blocks;
8580
8581 unsigned long st_atime;
8582 unsigned long st_atime_nsec;
8583
8584 unsigned long st_mtime;
8585 unsigned long st_mtime_nsec;
8586
8587 unsigned long st_ctime;
8588 unsigned long st_ctime_nsec;
8589
8590 unsigned long long st_ino;
8591 };
8592 # 7 "include/linux/stat.h" 2
8593 # 59 "include/linux/stat.h"
8594 struct kstat {
8595 u64 ino;
8596 dev_t dev;
8597 umode_t mode;
8598 unsigned int nlink;
8599 uid_t uid;
8600 gid_t gid;
8601 dev_t rdev;
8602 loff_t size;
8603 struct timespec atime;
8604 struct timespec mtime;
8605 struct timespec ctime;
8606 unsigned long blksize;
8607 unsigned long long blocks;
8608 };
8609 # 276 "include/linux/fs.h" 2
8610
8611
8612
8613 # 1 "include/linux/radix-tree.h" 1
8614 # 38 "include/linux/radix-tree.h"
8615 static inline __attribute__((always_inline)) void *radix_tree_ptr_to_direct(void *ptr)
8616 {
8617 return (void *)((unsigned long)ptr | 1);
8618 }
8619
8620 static inline __attribute__((always_inline)) void *radix_tree_direct_to_ptr(void *ptr)
8621 {
8622 return (void *)((unsigned long)ptr & ~1);
8623 }
8624
8625 static inline __attribute__((always_inline)) int radix_tree_is_direct_ptr(void *ptr)
8626 {
8627 return (int)((unsigned long)ptr & 1);
8628 }
8629
8630
8631
8632
8633
8634
8635 struct radix_tree_root {
8636 unsigned int height;
8637 gfp_t gfp_mask;
8638 struct radix_tree_node *rnode;
8639 };
8640 # 131 "include/linux/radix-tree.h"
8641 static inline __attribute__((always_inline)) void *radix_tree_deref_slot(void **pslot)
8642 {
8643 return radix_tree_direct_to_ptr(*pslot);
8644 }
8645 # 143 "include/linux/radix-tree.h"
8646 static inline __attribute__((always_inline)) void radix_tree_replace_slot(void **pslot, void *item)
8647 {
8648 do { if (__builtin_expect(!!((radix_tree_is_direct_ptr(item))!=0), 0)) do { printk("BUG: failure at %s:%d/%s()!\n", "include/linux/radix-tree.h", 145, (__func__)); panic("BUG!"); } while (0); } while(0);
8649 ({ __asm__ __volatile__("": : :"memory"); (*pslot) = ((void *)((unsigned long)item | ((unsigned long)*pslot & 1))); });
8650
8651
8652 }
8653
8654 int radix_tree_insert(struct radix_tree_root *, unsigned long, void *);
8655 void *radix_tree_lookup(struct radix_tree_root *, unsigned long);
8656 void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long);
8657 void *radix_tree_delete(struct radix_tree_root *, unsigned long);
8658 unsigned int
8659 radix_tree_gang_lookup(struct radix_tree_root *root, void **results,
8660 unsigned long first_index, unsigned int max_items);
8661 int radix_tree_preload(gfp_t gfp_mask);
8662 void radix_tree_init(void);
8663 void *radix_tree_tag_set(struct radix_tree_root *root,
8664 unsigned long index, unsigned int tag);
8665 void *radix_tree_tag_clear(struct radix_tree_root *root,
8666 unsigned long index, unsigned int tag);
8667 int radix_tree_tag_get(struct radix_tree_root *root,
8668 unsigned long index, unsigned int tag);
8669 unsigned int
8670 radix_tree_gang_lookup_tag(struct radix_tree_root *root, void **results,
8671 unsigned long first_index, unsigned int max_items,
8672 unsigned int tag);
8673 int radix_tree_tagged(struct radix_tree_root *root, unsigned int tag);
8674
8675 static inline __attribute__((always_inline)) void radix_tree_preload_end(void)
8676 {
8677 do { } while (0);
8678 }
8679 # 280 "include/linux/fs.h" 2
8680 # 289 "include/linux/fs.h"
8681 struct hd_geometry;
8682 struct iovec;
8683 struct nameidata;
8684 struct kiocb;
8685 struct pipe_inode_info;
8686 struct poll_table_struct;
8687 struct kstatfs;
8688 struct vm_area_struct;
8689 struct vfsmount;
8690
8691 extern void __attribute__ ((__section__ (".init.text"))) inode_init(unsigned long);
8692 extern void __attribute__ ((__section__ (".init.text"))) inode_init_early(void);
8693 extern void __attribute__ ((__section__ (".init.text"))) mnt_init(unsigned long);
8694 extern void __attribute__ ((__section__ (".init.text"))) files_init(unsigned long);
8695
8696 struct buffer_head;
8697 typedef int (get_block_t)(struct inode *inode, sector_t iblock,
8698 struct buffer_head *bh_result, int create);
8699 typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
8700 ssize_t bytes, void *private);
8701 # 338 "include/linux/fs.h"
8702 struct iattr {
8703 unsigned int ia_valid;
8704 umode_t ia_mode;
8705 uid_t ia_uid;
8706 gid_t ia_gid;
8707 loff_t ia_size;
8708 struct timespec ia_atime;
8709 struct timespec ia_mtime;
8710 struct timespec ia_ctime;
8711
8712
8713
8714
8715
8716
8717 struct file *ia_file;
8718 };
8719
8720
8721
8722
8723 # 1 "include/linux/quota.h" 1
8724 # 44 "include/linux/quota.h"
8725 typedef __kernel_uid32_t qid_t;
8726 typedef __u64 qsize_t;
8727
8728 extern spinlock_t dq_data_lock;
8729 # 105 "include/linux/quota.h"
8730 struct if_dqblk {
8731 __u64 dqb_bhardlimit;
8732 __u64 dqb_bsoftlimit;
8733 __u64 dqb_curspace;
8734 __u64 dqb_ihardlimit;
8735 __u64 dqb_isoftlimit;
8736 __u64 dqb_curinodes;
8737 __u64 dqb_btime;
8738 __u64 dqb_itime;
8739 __u32 dqb_valid;
8740 };
8741 # 126 "include/linux/quota.h"
8742 struct if_dqinfo {
8743 __u64 dqi_bgrace;
8744 __u64 dqi_igrace;
8745 __u32 dqi_flags;
8746 __u32 dqi_valid;
8747 };
8748
8749
8750
8751
8752
8753
8754 # 1 "include/linux/dqblk_xfs.h" 1
8755 # 50 "include/linux/dqblk_xfs.h"
8756 typedef struct fs_disk_quota {
8757 __s8 d_version;
8758 __s8 d_flags;
8759 __u16 d_fieldmask;
8760 __u32 d_id;
8761 __u64 d_blk_hardlimit;
8762 __u64 d_blk_softlimit;
8763 __u64 d_ino_hardlimit;
8764 __u64 d_ino_softlimit;
8765 __u64 d_bcount;
8766 __u64 d_icount;
8767 __s32 d_itimer;
8768
8769 __s32 d_btimer;
8770 __u16 d_iwarns;
8771 __u16 d_bwarns;
8772 __s32 d_padding2;
8773 __u64 d_rtb_hardlimit;
8774 __u64 d_rtb_softlimit;
8775 __u64 d_rtbcount;
8776 __s32 d_rtbtimer;
8777 __u16 d_rtbwarns;
8778 __s16 d_padding3;
8779 char d_padding4[8];
8780 } fs_disk_quota_t;
8781 # 137 "include/linux/dqblk_xfs.h"
8782 typedef struct fs_qfilestat {
8783 __u64 qfs_ino;
8784 __u64 qfs_nblks;
8785 __u32 qfs_nextents;
8786 } fs_qfilestat_t;
8787
8788 typedef struct fs_quota_stat {
8789 __s8 qs_version;
8790 __u16 qs_flags;
8791 __s8 qs_pad;
8792 fs_qfilestat_t qs_uquota;
8793 fs_qfilestat_t qs_gquota;
8794 __u32 qs_incoredqs;
8795 __s32 qs_btimelimit;
8796 __s32 qs_itimelimit;
8797 __s32 qs_rtbtimelimit;
8798 __u16 qs_bwarnlimit;
8799 __u16 qs_iwarnlimit;
8800 } fs_quota_stat_t;
8801 # 139 "include/linux/quota.h" 2
8802 # 1 "include/linux/dqblk_v1.h" 1
8803 # 21 "include/linux/dqblk_v1.h"
8804 struct v1_mem_dqinfo {
8805 };
8806 # 140 "include/linux/quota.h" 2
8807 # 1 "include/linux/dqblk_v2.h" 1
8808 # 20 "include/linux/dqblk_v2.h"
8809 struct v2_mem_dqinfo {
8810 unsigned int dqi_blocks;
8811 unsigned int dqi_free_blk;
8812 unsigned int dqi_free_entry;
8813 };
8814 # 141 "include/linux/quota.h" 2
8815 # 152 "include/linux/quota.h"
8816 struct mem_dqblk {
8817 __u32 dqb_bhardlimit;
8818 __u32 dqb_bsoftlimit;
8819 qsize_t dqb_curspace;
8820 __u32 dqb_ihardlimit;
8821 __u32 dqb_isoftlimit;
8822 __u32 dqb_curinodes;
8823 time_t dqb_btime;
8824 time_t dqb_itime;
8825 };
8826
8827
8828
8829
8830 struct quota_format_type;
8831
8832 struct mem_dqinfo {
8833 struct quota_format_type *dqi_format;
8834 struct list_head dqi_dirty_list;
8835 unsigned long dqi_flags;
8836 unsigned int dqi_bgrace;
8837 unsigned int dqi_igrace;
8838 union {
8839 struct v1_mem_dqinfo v1_i;
8840 struct v2_mem_dqinfo v2_i;
8841 } u;
8842 };
8843
8844 struct super_block;
8845
8846
8847
8848
8849
8850 extern void mark_info_dirty(struct super_block *sb, int type);
8851
8852
8853
8854
8855
8856
8857
8858 struct dqstats {
8859 int lookups;
8860 int drops;
8861 int reads;
8862 int writes;
8863 int cache_hits;
8864 int allocated_dquots;
8865 int free_dquots;
8866 int syncs;
8867 };
8868
8869 extern struct dqstats dqstats;
8870 # 214 "include/linux/quota.h"
8871 struct dquot {
8872 struct hlist_node dq_hash;
8873 struct list_head dq_inuse;
8874 struct list_head dq_free;
8875 struct list_head dq_dirty;
8876 struct mutex dq_lock;
8877 atomic_t dq_count;
8878 wait_queue_head_t dq_wait_unused;
8879 struct super_block *dq_sb;
8880 unsigned int dq_id;
8881 loff_t dq_off;
8882 unsigned long dq_flags;
8883 short dq_type;
8884 struct mem_dqblk dq_dqb;
8885 };
8886
8887
8888
8889
8890
8891
8892
8893 struct quota_format_ops {
8894 int (*check_quota_file)(struct super_block *sb, int type);
8895 int (*read_file_info)(struct super_block *sb, int type);
8896 int (*write_file_info)(struct super_block *sb, int type);
8897 int (*free_file_info)(struct super_block *sb, int type);
8898 int (*read_dqblk)(struct dquot *dquot);
8899 int (*commit_dqblk)(struct dquot *dquot);
8900 int (*release_dqblk)(struct dquot *dquot);
8901 };
8902
8903
8904 struct dquot_operations {
8905 int (*initialize) (struct inode *, int);
8906 int (*drop) (struct inode *);
8907 int (*alloc_space) (struct inode *, qsize_t, int);
8908 int (*alloc_inode) (const struct inode *, unsigned long);
8909 int (*free_space) (struct inode *, qsize_t);
8910 int (*free_inode) (const struct inode *, unsigned long);
8911 int (*transfer) (struct inode *, struct iattr *);
8912 int (*write_dquot) (struct dquot *);
8913 int (*acquire_dquot) (struct dquot *);
8914 int (*release_dquot) (struct dquot *);
8915 int (*mark_dirty) (struct dquot *);
8916 int (*write_info) (struct super_block *, int);
8917 };
8918
8919
8920 struct quotactl_ops {
8921 int (*quota_on)(struct super_block *, int, int, char *);
8922 int (*quota_off)(struct super_block *, int);
8923 int (*quota_sync)(struct super_block *, int);
8924 int (*get_info)(struct super_block *, int, struct if_dqinfo *);
8925 int (*set_info)(struct super_block *, int, struct if_dqinfo *);
8926 int (*get_dqblk)(struct super_block *, int, qid_t, struct if_dqblk *);
8927 int (*set_dqblk)(struct super_block *, int, qid_t, struct if_dqblk *);
8928 int (*get_xstate)(struct super_block *, struct fs_quota_stat *);
8929 int (*set_xstate)(struct super_block *, unsigned int, int);
8930 int (*get_xquota)(struct super_block *, int, qid_t, struct fs_disk_quota *);
8931 int (*set_xquota)(struct super_block *, int, qid_t, struct fs_disk_quota *);
8932 };
8933
8934 struct quota_format_type {
8935 int qf_fmt_id;
8936 struct quota_format_ops *qf_ops;
8937 struct module *qf_owner;
8938 struct quota_format_type *qf_next;
8939 };
8940
8941
8942
8943
8944 struct quota_info {
8945 unsigned int flags;
8946 struct mutex dqio_mutex;
8947 struct mutex dqonoff_mutex;
8948 struct rw_semaphore dqptr_sem;
8949 struct inode *files[2];
8950 struct mem_dqinfo info[2];
8951 struct quota_format_ops *ops[2];
8952 };
8953
8954
8955 int mark_dquot_dirty(struct dquot *dquot);
8956 # 308 "include/linux/quota.h"
8957 int register_quota_format(struct quota_format_type *fmt);
8958 void unregister_quota_format(struct quota_format_type *fmt);
8959
8960 struct quota_module_name {
8961 int qm_fmt_id;
8962 char *qm_mod_name;
8963 };
8964 # 360 "include/linux/fs.h" 2
8965 # 387 "include/linux/fs.h"
8966 enum positive_aop_returns {
8967 AOP_WRITEPAGE_ACTIVATE = 0x80000,
8968 AOP_TRUNCATED_PAGE = 0x80001,
8969 };
8970
8971
8972
8973
8974 struct page;
8975 struct address_space;
8976 struct writeback_control;
8977
8978 struct address_space_operations {
8979 int (*writepage)(struct page *page, struct writeback_control *wbc);
8980 int (*readpage)(struct file *, struct page *);
8981 void (*sync_page)(struct page *);
8982
8983
8984 int (*writepages)(struct address_space *, struct writeback_control *);
8985
8986
8987 int (*set_page_dirty)(struct page *page);
8988
8989 int (*readpages)(struct file *filp, struct address_space *mapping,
8990 struct list_head *pages, unsigned nr_pages);
8991
8992
8993
8994
8995
8996 int (*prepare_write)(struct file *, struct page *, unsigned, unsigned);
8997 int (*commit_write)(struct file *, struct page *, unsigned, unsigned);
8998
8999 sector_t (*bmap)(struct address_space *, sector_t);
9000 void (*invalidatepage) (struct page *, unsigned long);
9001 int (*releasepage) (struct page *, gfp_t);
9002 ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
9003 loff_t offset, unsigned long nr_segs);
9004 struct page* (*get_xip_page)(struct address_space *, sector_t,
9005 int);
9006
9007 int (*migratepage) (struct address_space *,
9008 struct page *, struct page *);
9009 int (*launder_page) (struct page *);
9010 };
9011
9012 struct backing_dev_info;
9013 struct address_space {
9014 struct inode *host;
9015 struct radix_tree_root page_tree;
9016 rwlock_t tree_lock;
9017 unsigned int i_mmap_writable;
9018 struct prio_tree_root i_mmap;
9019 struct list_head i_mmap_nonlinear;
9020 spinlock_t i_mmap_lock;
9021 unsigned int truncate_count;
9022 unsigned long nrpages;
9023 unsigned long writeback_index;
9024 const struct address_space_operations *a_ops;
9025 unsigned long flags;
9026 struct backing_dev_info *backing_dev_info;
9027 spinlock_t private_lock;
9028 struct list_head private_list;
9029 struct address_space *assoc_mapping;
9030 } __attribute__((aligned(sizeof(long))));
9031
9032
9033
9034
9035
9036
9037 struct block_device {
9038 dev_t bd_dev;
9039 struct inode * bd_inode;
9040 int bd_openers;
9041 struct mutex bd_mutex;
9042 struct semaphore bd_mount_sem;
9043 struct list_head bd_inodes;
9044 void * bd_holder;
9045 int bd_holders;
9046
9047 struct list_head bd_holder_list;
9048
9049 struct block_device * bd_contains;
9050 unsigned bd_block_size;
9051 struct hd_struct * bd_part;
9052
9053 unsigned bd_part_count;
9054 int bd_invalidated;
9055 struct gendisk * bd_disk;
9056 struct list_head bd_list;
9057 struct backing_dev_info *bd_inode_backing_dev_info;
9058
9059
9060
9061
9062
9063
9064 unsigned long bd_private;
9065 };
9066 # 495 "include/linux/fs.h"
9067 int mapping_tagged(struct address_space *mapping, int tag);
9068
9069
9070
9071
9072 static inline __attribute__((always_inline)) int mapping_mapped(struct address_space *mapping)
9073 {
9074 return !prio_tree_empty(&mapping->i_mmap) ||
9075 !list_empty(&mapping->i_mmap_nonlinear);
9076 }
9077
9078
9079
9080
9081
9082
9083
9084 static inline __attribute__((always_inline)) int mapping_writably_mapped(struct address_space *mapping)
9085 {
9086 return mapping->i_mmap_writable != 0;
9087 }
9088 # 528 "include/linux/fs.h"
9089 struct inode {
9090 struct hlist_node i_hash;
9091 struct list_head i_list;
9092 struct list_head i_sb_list;
9093 struct list_head i_dentry;
9094 unsigned long i_ino;
9095 atomic_t i_count;
9096 unsigned int i_nlink;
9097 uid_t i_uid;
9098 gid_t i_gid;
9099 dev_t i_rdev;
9100 unsigned long i_version;
9101 loff_t i_size;
9102
9103
9104
9105 struct timespec i_atime;
9106 struct timespec i_mtime;
9107 struct timespec i_ctime;
9108 unsigned int i_blkbits;
9109 blkcnt_t i_blocks;
9110 unsigned short i_bytes;
9111 umode_t i_mode;
9112 spinlock_t i_lock;
9113 struct mutex i_mutex;
9114 struct rw_semaphore i_alloc_sem;
9115 const struct inode_operations *i_op;
9116 const struct file_operations *i_fop;
9117 struct super_block *i_sb;
9118 struct file_lock *i_flock;
9119 struct address_space *i_mapping;
9120 struct address_space i_data;
9121
9122
9123
9124 struct list_head i_devices;
9125 union {
9126 struct pipe_inode_info *i_pipe;
9127 struct block_device *i_bdev;
9128 struct cdev *i_cdev;
9129 };
9130 int i_cindex;
9131
9132 __u32 i_generation;
9133
9134
9135
9136
9137
9138
9139
9140 struct list_head inotify_watches;
9141 struct mutex inotify_mutex;
9142
9143
9144 unsigned long i_state;
9145 unsigned long dirtied_when;
9146
9147 unsigned int i_flags;
9148
9149 atomic_t i_writecount;
9150
9151 void *i_security;
9152
9153 void *i_private;
9154 };
9155 # 606 "include/linux/fs.h"
9156 enum inode_i_mutex_lock_class
9157 {
9158 I_MUTEX_NORMAL,
9159 I_MUTEX_PARENT,
9160 I_MUTEX_CHILD,
9161 I_MUTEX_XATTR,
9162 I_MUTEX_QUOTA
9163 };
9164
9165 extern void inode_double_lock(struct inode *inode1, struct inode *inode2);
9166 extern void inode_double_unlock(struct inode *inode1, struct inode *inode2);
9167 # 628 "include/linux/fs.h"
9168 static inline __attribute__((always_inline)) loff_t i_size_read(const struct inode *inode)
9169 {
9170 # 647 "include/linux/fs.h"
9171 return inode->i_size;
9172
9173 }
9174
9175
9176
9177
9178
9179
9180 static inline __attribute__((always_inline)) void i_size_write(struct inode *inode, loff_t i_size)
9181 {
9182 # 667 "include/linux/fs.h"
9183 inode->i_size = i_size;
9184
9185 }
9186
9187 static inline __attribute__((always_inline)) unsigned iminor(const struct inode *inode)
9188 {
9189 return ((unsigned int) ((inode->i_rdev) & ((1U << 20) - 1)));
9190 }
9191
9192 static inline __attribute__((always_inline)) unsigned imajor(const struct inode *inode)
9193 {
9194 return ((unsigned int) ((inode->i_rdev) >> 20));
9195 }
9196
9197 extern struct block_device *I_BDEV(struct inode *inode);
9198
9199 struct fown_struct {
9200 rwlock_t lock;
9201 struct pid *pid;
9202 enum pid_type pid_type;
9203 uid_t uid, euid;
9204 int signum;
9205 };
9206
9207
9208
9209
9210 struct file_ra_state {
9211 unsigned long start;
9212 unsigned long size;
9213 unsigned long flags;
9214 unsigned long cache_hit;
9215 unsigned long prev_page;
9216 unsigned long ahead_start;
9217 unsigned long ahead_size;
9218 unsigned long ra_pages;
9219 unsigned long mmap_hit;
9220 unsigned long mmap_miss;
9221 };
9222
9223
9224
9225 struct file {
9226
9227
9228
9229
9230 union {
9231 struct list_head fu_list;
9232 struct rcu_head fu_rcuhead;
9233 } f_u;
9234 struct path f_path;
9235
9236
9237 const struct file_operations *f_op;
9238 atomic_t f_count;
9239 unsigned int f_flags;
9240 mode_t f_mode;
9241 loff_t f_pos;
9242 struct fown_struct f_owner;
9243 unsigned int f_uid, f_gid;
9244 struct file_ra_state f_ra;
9245
9246 unsigned long f_version;
9247
9248 void *f_security;
9249
9250
9251 void *private_data;
9252
9253
9254
9255
9256
9257
9258 struct address_space *f_mapping;
9259 };
9260 extern spinlock_t files_lock;
9261 # 776 "include/linux/fs.h"
9262 typedef struct files_struct *fl_owner_t;
9263
9264 struct file_lock_operations {
9265 void (*fl_insert)(struct file_lock *);
9266 void (*fl_remove)(struct file_lock *);
9267 void (*fl_copy_lock)(struct file_lock *, struct file_lock *);
9268 void (*fl_release_private)(struct file_lock *);
9269 };
9270
9271 struct lock_manager_operations {
9272 int (*fl_compare_owner)(struct file_lock *, struct file_lock *);
9273 void (*fl_notify)(struct file_lock *);
9274 void (*fl_copy_lock)(struct file_lock *, struct file_lock *);
9275 void (*fl_release_private)(struct file_lock *);
9276 void (*fl_break)(struct file_lock *);
9277 int (*fl_mylease)(struct file_lock *, struct file_lock *);
9278 int (*fl_change)(struct file_lock **, int);
9279 };
9280
9281
9282 # 1 "include/linux/nfs_fs_i.h" 1
9283
9284
9285
9286
9287
9288 # 1 "include/linux/nfs.h" 1
9289 # 39 "include/linux/nfs.h"
9290 enum nfs_stat {
9291 NFS_OK = 0,
9292 NFSERR_PERM = 1,
9293 NFSERR_NOENT = 2,
9294 NFSERR_IO = 5,
9295 NFSERR_NXIO = 6,
9296 NFSERR_EAGAIN = 11,
9297 NFSERR_ACCES = 13,
9298 NFSERR_EXIST = 17,
9299 NFSERR_XDEV = 18,
9300 NFSERR_NODEV = 19,
9301 NFSERR_NOTDIR = 20,
9302 NFSERR_ISDIR = 21,
9303 NFSERR_INVAL = 22,
9304 NFSERR_FBIG = 27,
9305 NFSERR_NOSPC = 28,
9306 NFSERR_ROFS = 30,
9307 NFSERR_MLINK = 31,
9308 NFSERR_OPNOTSUPP = 45,
9309 NFSERR_NAMETOOLONG = 63,
9310 NFSERR_NOTEMPTY = 66,
9311 NFSERR_DQUOT = 69,
9312 NFSERR_STALE = 70,
9313 NFSERR_REMOTE = 71,
9314 NFSERR_WFLUSH = 99,
9315 NFSERR_BADHANDLE = 10001,
9316 NFSERR_NOT_SYNC = 10002,
9317 NFSERR_BAD_COOKIE = 10003,
9318 NFSERR_NOTSUPP = 10004,
9319 NFSERR_TOOSMALL = 10005,
9320 NFSERR_SERVERFAULT = 10006,
9321 NFSERR_BADTYPE = 10007,
9322 NFSERR_JUKEBOX = 10008,
9323 NFSERR_SAME = 10009,
9324 NFSERR_DENIED = 10010,
9325 NFSERR_EXPIRED = 10011,
9326 NFSERR_LOCKED = 10012,
9327 NFSERR_GRACE = 10013,
9328 NFSERR_FHEXPIRED = 10014,
9329 NFSERR_SHARE_DENIED = 10015,
9330 NFSERR_WRONGSEC = 10016,
9331 NFSERR_CLID_INUSE = 10017,
9332 NFSERR_RESOURCE = 10018,
9333 NFSERR_MOVED = 10019,
9334 NFSERR_NOFILEHANDLE = 10020,
9335 NFSERR_MINOR_VERS_MISMATCH = 10021,
9336 NFSERR_STALE_CLIENTID = 10022,
9337 NFSERR_STALE_STATEID = 10023,
9338 NFSERR_OLD_STATEID = 10024,
9339 NFSERR_BAD_STATEID = 10025,
9340 NFSERR_BAD_SEQID = 10026,
9341 NFSERR_NOT_SAME = 10027,
9342 NFSERR_LOCK_RANGE = 10028,
9343 NFSERR_SYMLINK = 10029,
9344 NFSERR_RESTOREFH = 10030,
9345 NFSERR_LEASE_MOVED = 10031,
9346 NFSERR_ATTRNOTSUPP = 10032,
9347 NFSERR_NO_GRACE = 10033,
9348 NFSERR_RECLAIM_BAD = 10034,
9349 NFSERR_RECLAIM_CONFLICT = 10035,
9350 NFSERR_BAD_XDR = 10036,
9351 NFSERR_LOCKS_HELD = 10037,
9352 NFSERR_OPENMODE = 10038,
9353 NFSERR_BADOWNER = 10039,
9354 NFSERR_BADCHAR = 10040,
9355 NFSERR_BADNAME = 10041,
9356 NFSERR_BAD_RANGE = 10042,
9357 NFSERR_LOCK_NOTSUPP = 10043,
9358 NFSERR_OP_ILLEGAL = 10044,
9359 NFSERR_DEADLOCK = 10045,
9360 NFSERR_FILE_OPEN = 10046,
9361 NFSERR_ADMIN_REVOKED = 10047,
9362 NFSERR_CB_PATH_DOWN = 10048,
9363 NFSERR_REPLAY_ME = 10049
9364 };
9365
9366
9367
9368 enum nfs_ftype {
9369 NFNON = 0,
9370 NFREG = 1,
9371 NFDIR = 2,
9372 NFBLK = 3,
9373 NFCHR = 4,
9374 NFLNK = 5,
9375 NFSOCK = 6,
9376 NFBAD = 7,
9377 NFFIFO = 8
9378 };
9379
9380
9381 # 1 "include/linux/sunrpc/msg_prot.h" 1
9382 # 18 "include/linux/sunrpc/msg_prot.h"
9383 typedef u32 rpc_authflavor_t;
9384
9385 enum rpc_auth_flavors {
9386 RPC_AUTH_NULL = 0,
9387 RPC_AUTH_UNIX = 1,
9388 RPC_AUTH_SHORT = 2,
9389 RPC_AUTH_DES = 3,
9390 RPC_AUTH_KRB = 4,
9391 RPC_AUTH_GSS = 6,
9392 RPC_AUTH_MAXFLAVOR = 8,
9393
9394 RPC_AUTH_GSS_KRB5 = 390003,
9395 RPC_AUTH_GSS_KRB5I = 390004,
9396 RPC_AUTH_GSS_KRB5P = 390005,
9397 RPC_AUTH_GSS_LKEY = 390006,
9398 RPC_AUTH_GSS_LKEYI = 390007,
9399 RPC_AUTH_GSS_LKEYP = 390008,
9400 RPC_AUTH_GSS_SPKM = 390009,
9401 RPC_AUTH_GSS_SPKMI = 390010,
9402 RPC_AUTH_GSS_SPKMP = 390011,
9403 };
9404
9405
9406
9407
9408 enum rpc_msg_type {
9409 RPC_CALL = 0,
9410 RPC_REPLY = 1
9411 };
9412
9413 enum rpc_reply_stat {
9414 RPC_MSG_ACCEPTED = 0,
9415 RPC_MSG_DENIED = 1
9416 };
9417
9418 enum rpc_accept_stat {
9419 RPC_SUCCESS = 0,
9420 RPC_PROG_UNAVAIL = 1,
9421 RPC_PROG_MISMATCH = 2,
9422 RPC_PROC_UNAVAIL = 3,
9423 RPC_GARBAGE_ARGS = 4,
9424 RPC_SYSTEM_ERR = 5,
9425
9426 RPC_DROP_REPLY = 60000,
9427 };
9428
9429 enum rpc_reject_stat {
9430 RPC_MISMATCH = 0,
9431 RPC_AUTH_ERROR = 1
9432 };
9433
9434 enum rpc_auth_stat {
9435 RPC_AUTH_OK = 0,
9436 RPC_AUTH_BADCRED = 1,
9437 RPC_AUTH_REJECTEDCRED = 2,
9438 RPC_AUTH_BADVERF = 3,
9439 RPC_AUTH_REJECTEDVERF = 4,
9440 RPC_AUTH_TOOWEAK = 5,
9441
9442 RPCSEC_GSS_CREDPROBLEM = 13,
9443 RPCSEC_GSS_CTXPROBLEM = 14
9444 };
9445 # 106 "include/linux/sunrpc/msg_prot.h"
9446 typedef __be32 rpc_fraghdr;
9447 # 131 "include/linux/nfs.h" 2
9448
9449
9450
9451
9452
9453
9454 struct nfs_fh {
9455 unsigned short size;
9456 unsigned char data[128];
9457 };
9458
9459
9460
9461
9462
9463 static inline __attribute__((always_inline)) int nfs_compare_fh(const struct nfs_fh *a, const struct nfs_fh *b)
9464 {
9465 return a->size != b->size || memcmp(a->data, b->data, a->size) != 0;
9466 }
9467
9468 static inline __attribute__((always_inline)) void nfs_copy_fh(struct nfs_fh *target, const struct nfs_fh *source)
9469 {
9470 target->size = source->size;
9471 memcpy(target->data, source->data, source->size);
9472 }
9473 # 165 "include/linux/nfs.h"
9474 enum nfs3_stable_how {
9475 NFS_UNSTABLE = 0,
9476 NFS_DATA_SYNC = 1,
9477 NFS_FILE_SYNC = 2
9478 };
9479 # 7 "include/linux/nfs_fs_i.h" 2
9480
9481 struct nlm_lockowner;
9482
9483
9484
9485
9486 struct nfs_lock_info {
9487 u32 state;
9488 struct nlm_lockowner *owner;
9489 struct list_head list;
9490 };
9491
9492 struct nfs4_lock_state;
9493 struct nfs4_lock_info {
9494 struct nfs4_lock_state *owner;
9495 };
9496 # 797 "include/linux/fs.h" 2
9497
9498 struct file_lock {
9499 struct file_lock *fl_next;
9500 struct list_head fl_link;
9501 struct list_head fl_block;
9502 fl_owner_t fl_owner;
9503 unsigned int fl_pid;
9504 wait_queue_head_t fl_wait;
9505 struct file *fl_file;
9506 unsigned char fl_flags;
9507 unsigned char fl_type;
9508 loff_t fl_start;
9509 loff_t fl_end;
9510
9511 struct fasync_struct * fl_fasync;
9512 unsigned long fl_break_time;
9513
9514 struct file_lock_operations *fl_ops;
9515 struct lock_manager_operations *fl_lmops;
9516 union {
9517 struct nfs_lock_info nfs_fl;
9518 struct nfs4_lock_info nfs4_fl;
9519 } fl_u;
9520 };
9521 # 829 "include/linux/fs.h"
9522 # 1 "include/linux/fcntl.h" 1
9523
9524
9525
9526 # 1 "include/asm/fcntl.h" 1
9527 # 11 "include/asm/fcntl.h"
9528 # 1 "include/asm-generic/fcntl.h" 1
9529 # 114 "include/asm-generic/fcntl.h"
9530 struct flock {
9531 short l_type;
9532 short l_whence;
9533 off_t l_start;
9534 off_t l_len;
9535 pid_t l_pid;
9536
9537 };
9538 # 137 "include/asm-generic/fcntl.h"
9539 struct flock64 {
9540 short l_type;
9541 short l_whence;
9542 loff_t l_start;
9543 loff_t l_len;
9544 pid_t l_pid;
9545
9546 };
9547 # 12 "include/asm/fcntl.h" 2
9548 # 5 "include/linux/fcntl.h" 2
9549 # 830 "include/linux/fs.h" 2
9550
9551 extern int fcntl_getlk(struct file *, struct flock *);
9552 extern int fcntl_setlk(unsigned int, struct file *, unsigned int,
9553 struct flock *);
9554
9555
9556 extern int fcntl_getlk64(struct file *, struct flock64 *);
9557 extern int fcntl_setlk64(unsigned int, struct file *, unsigned int,
9558 struct flock64 *);
9559
9560
9561 extern void send_sigio(struct fown_struct *fown, int fd, int band);
9562 extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg);
9563 extern int fcntl_getlease(struct file *filp);
9564
9565
9566 extern int do_sync_file_range(struct file *file, loff_t offset, loff_t endbyte,
9567 unsigned int flags);
9568
9569
9570 extern void locks_init_lock(struct file_lock *);
9571 extern void locks_copy_lock(struct file_lock *, struct file_lock *);
9572 extern void locks_remove_posix(struct file *, fl_owner_t);
9573 extern void locks_remove_flock(struct file *);
9574 extern int posix_test_lock(struct file *, struct file_lock *, struct file_lock *);
9575 extern int posix_lock_file_conf(struct file *, struct file_lock *, struct file_lock *);
9576 extern int posix_lock_file(struct file *, struct file_lock *);
9577 extern int posix_lock_file_wait(struct file *, struct file_lock *);
9578 extern int posix_unblock_lock(struct file *, struct file_lock *);
9579 extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl);
9580 extern int __break_lease(struct inode *inode, unsigned int flags);
9581 extern void lease_get_mtime(struct inode *, struct timespec *time);
9582 extern int setlease(struct file *, long, struct file_lock **);
9583 extern int lease_modify(struct file_lock **, int);
9584 extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
9585 extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
9586
9587 struct fasync_struct {
9588 int magic;
9589 int fa_fd;
9590 struct fasync_struct *fa_next;
9591 struct file *fa_file;
9592 };
9593
9594
9595
9596
9597 extern int fasync_helper(int, struct file *, int, struct fasync_struct **);
9598
9599 extern void kill_fasync(struct fasync_struct **, int, int);
9600
9601 extern void __kill_fasync(struct fasync_struct *, int, int);
9602
9603 extern int __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
9604 extern int f_setown(struct file *filp, unsigned long arg, int force);
9605 extern void f_delown(struct file *filp);
9606 extern pid_t f_getown(struct file *filp);
9607 extern int send_sigurg(struct fown_struct *fown);
9608 # 897 "include/linux/fs.h"
9609 extern struct list_head super_blocks;
9610 extern spinlock_t sb_lock;
9611
9612
9613
9614 struct super_block {
9615 struct list_head s_list;
9616 dev_t s_dev;
9617 unsigned long s_blocksize;
9618 unsigned char s_blocksize_bits;
9619 unsigned char s_dirt;
9620 unsigned long long s_maxbytes;
9621 struct file_system_type *s_type;
9622 const struct super_operations *s_op;
9623 struct dquot_operations *dq_op;
9624 struct quotactl_ops *s_qcop;
9625 struct export_operations *s_export_op;
9626 unsigned long s_flags;
9627 unsigned long s_magic;
9628 struct dentry *s_root;
9629 struct rw_semaphore s_umount;
9630 struct mutex s_lock;
9631 int s_count;
9632 int s_syncing;
9633 int s_need_sync_fs;
9634 atomic_t s_active;
9635
9636 void *s_security;
9637
9638 struct xattr_handler **s_xattr;
9639
9640 struct list_head s_inodes;
9641 struct list_head s_dirty;
9642 struct list_head s_io;
9643 struct hlist_head s_anon;
9644 struct list_head s_files;
9645
9646 struct block_device *s_bdev;
9647 struct list_head s_instances;
9648 struct quota_info s_dquot;
9649
9650 int s_frozen;
9651 wait_queue_head_t s_wait_unfrozen;
9652
9653 char s_id[32];
9654
9655 void *s_fs_info;
9656
9657
9658
9659
9660
9661 struct mutex s_vfs_rename_mutex;
9662
9663
9664
9665 u32 s_time_gran;
9666 };
9667
9668 extern struct timespec current_fs_time(struct super_block *sb);
9669
9670
9671
9672
9673 enum {
9674 SB_UNFROZEN = 0,
9675 SB_FREEZE_WRITE = 1,
9676 SB_FREEZE_TRANS = 2,
9677 };
9678 # 975 "include/linux/fs.h"
9679 extern void lock_super(struct super_block *);
9680 extern void unlock_super(struct super_block *);
9681
9682
9683
9684
9685 extern int vfs_permission(struct nameidata *, int);
9686 extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *);
9687 extern int vfs_mkdir(struct inode *, struct dentry *, int);
9688 extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t);
9689 extern int vfs_symlink(struct inode *, struct dentry *, const char *, int);
9690 extern int vfs_link(struct dentry *, struct inode *, struct dentry *);
9691 extern int vfs_rmdir(struct inode *, struct dentry *);
9692 extern int vfs_unlink(struct inode *, struct dentry *);
9693 extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
9694
9695
9696
9697
9698 extern void dentry_unhash(struct dentry *dentry);
9699
9700
9701
9702
9703 extern int file_permission(struct file *, int);
9704 # 1020 "include/linux/fs.h"
9705 int generic_osync_inode(struct inode *, struct address_space *, int);
9706
9707
9708
9709
9710
9711
9712
9713 typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned);
9714
9715 struct block_device_operations {
9716 int (*open) (struct inode *, struct file *);
9717 int (*release) (struct inode *, struct file *);
9718 int (*ioctl) (struct inode *, struct file *, unsigned, unsigned long);
9719 long (*unlocked_ioctl) (struct file *, unsigned, unsigned long);
9720 long (*compat_ioctl) (struct file *, unsigned, unsigned long);
9721 int (*direct_access) (struct block_device *, sector_t, unsigned long *);
9722 int (*media_changed) (struct gendisk *);
9723 int (*revalidate_disk) (struct gendisk *);
9724 int (*getgeo)(struct block_device *, struct hd_geometry *);
9725 struct module *owner;
9726 };
9727 # 1052 "include/linux/fs.h"
9728 typedef struct {
9729 size_t written;
9730 size_t count;
9731 union {
9732 char * buf;
9733 void *data;
9734 } arg;
9735 int error;
9736 } read_descriptor_t;
9737
9738 typedef int (*read_actor_t)(read_descriptor_t *, struct page *, unsigned long, unsigned long);
9739 # 1075 "include/linux/fs.h"
9740 struct file_operations {
9741 struct module *owner;
9742 loff_t (*llseek) (struct file *, loff_t, int);
9743 ssize_t (*read) (struct file *, char *, size_t, loff_t *);
9744 ssize_t (*write) (struct file *, const char *, size_t, loff_t *);
9745 ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
9746 ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
9747 int (*readdir) (struct file *, void *, filldir_t);
9748 unsigned int (*poll) (struct file *, struct poll_table_struct *);
9749 int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long);
9750 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
9751 long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
9752 int (*mmap) (struct file *, struct vm_area_struct *);
9753 int (*open) (struct inode *, struct file *);
9754 int (*flush) (struct file *, fl_owner_t id);
9755 int (*release) (struct inode *, struct file *);
9756 int (*fsync) (struct file *, struct dentry *, int datasync);
9757 int (*aio_fsync) (struct kiocb *, int datasync);
9758 int (*fasync) (int, struct file *, int);
9759 int (*lock) (struct file *, int, struct file_lock *);
9760 ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *);
9761 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
9762 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
9763 int (*check_flags)(int);
9764 int (*dir_notify)(struct file *filp, unsigned long arg);
9765 int (*flock) (struct file *, int, struct file_lock *);
9766 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
9767 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
9768 };
9769
9770 struct inode_operations {
9771 int (*create) (struct inode *,struct dentry *,int, struct nameidata *);
9772 struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
9773 int (*link) (struct dentry *,struct inode *,struct dentry *);
9774 int (*unlink) (struct inode *,struct dentry *);
9775 int (*symlink) (struct inode *,struct dentry *,const char *);
9776 int (*mkdir) (struct inode *,struct dentry *,int);
9777 int (*rmdir) (struct inode *,struct dentry *);
9778 int (*mknod) (struct inode *,struct dentry *,int,dev_t);
9779 int (*rename) (struct inode *, struct dentry *,
9780 struct inode *, struct dentry *);
9781 int (*readlink) (struct dentry *, char *,int);
9782 void * (*follow_link) (struct dentry *, struct nameidata *);
9783 void (*put_link) (struct dentry *, struct nameidata *, void *);
9784 void (*truncate) (struct inode *);
9785 int (*permission) (struct inode *, int, struct nameidata *);
9786 int (*setattr) (struct dentry *, struct iattr *);
9787 int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *);
9788 int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
9789 ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
9790 ssize_t (*listxattr) (struct dentry *, char *, size_t);
9791 int (*removexattr) (struct dentry *, const char *);
9792 void (*truncate_range)(struct inode *, loff_t, loff_t);
9793 };
9794
9795 struct seq_file;
9796
9797 ssize_t rw_copy_check_uvector(int type, const struct iovec * uvector,
9798 unsigned long nr_segs, unsigned long fast_segs,
9799 struct iovec *fast_pointer,
9800 struct iovec **ret_pointer);
9801
9802 extern ssize_t vfs_read(struct file *, char *, size_t, loff_t *);
9803 extern ssize_t vfs_write(struct file *, const char *, size_t, loff_t *);
9804 extern ssize_t vfs_readv(struct file *, const struct iovec *,
9805 unsigned long, loff_t *);
9806 extern ssize_t vfs_writev(struct file *, const struct iovec *,
9807 unsigned long, loff_t *);
9808
9809
9810
9811
9812
9813 struct super_operations {
9814 struct inode *(*alloc_inode)(struct super_block *sb);
9815 void (*destroy_inode)(struct inode *);
9816
9817 void (*read_inode) (struct inode *);
9818
9819 void (*dirty_inode) (struct inode *);
9820 int (*write_inode) (struct inode *, int);
9821 void (*put_inode) (struct inode *);
9822 void (*drop_inode) (struct inode *);
9823 void (*delete_inode) (struct inode *);
9824 void (*put_super) (struct super_block *);
9825 void (*write_super) (struct super_block *);
9826 int (*sync_fs)(struct super_block *sb, int wait);
9827 void (*write_super_lockfs) (struct super_block *);
9828 void (*unlockfs) (struct super_block *);
9829 int (*statfs) (struct dentry *, struct kstatfs *);
9830 int (*remount_fs) (struct super_block *, int *, char *);
9831 void (*clear_inode) (struct inode *);
9832 void (*umount_begin) (struct vfsmount *, int);
9833
9834 int (*show_options)(struct seq_file *, struct vfsmount *);
9835 int (*show_stats)(struct seq_file *, struct vfsmount *);
9836
9837
9838
9839
9840 };
9841 # 1190 "include/linux/fs.h"
9842 extern void __mark_inode_dirty(struct inode *, int);
9843 static inline __attribute__((always_inline)) void mark_inode_dirty(struct inode *inode)
9844 {
9845 __mark_inode_dirty(inode, (1 | 2 | 4));
9846 }
9847
9848 static inline __attribute__((always_inline)) void mark_inode_dirty_sync(struct inode *inode)
9849 {
9850 __mark_inode_dirty(inode, 1);
9851 }
9852
9853 static inline __attribute__((always_inline)) void inc_nlink(struct inode *inode)
9854 {
9855 inode->i_nlink++;
9856 }
9857
9858 static inline __attribute__((always_inline)) void inode_inc_link_count(struct inode *inode)
9859 {
9860 inc_nlink(inode);
9861 mark_inode_dirty(inode);
9862 }
9863
9864 static inline __attribute__((always_inline)) void drop_nlink(struct inode *inode)
9865 {
9866 inode->i_nlink--;
9867 }
9868
9869 static inline __attribute__((always_inline)) void clear_nlink(struct inode *inode)
9870 {
9871 inode->i_nlink = 0;
9872 }
9873
9874 static inline __attribute__((always_inline)) void inode_dec_link_count(struct inode *inode)
9875 {
9876 drop_nlink(inode);
9877 mark_inode_dirty(inode);
9878 }
9879
9880 extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry);
9881 static inline __attribute__((always_inline)) void file_accessed(struct file *file)
9882 {
9883 if (!(file->f_flags & 01000000))
9884 touch_atime(file->f_path.mnt, file->f_path.dentry);
9885 }
9886
9887 int sync_inode(struct inode *inode, struct writeback_control *wbc);
9888 # 1323 "include/linux/fs.h"
9889 struct export_operations {
9890 struct dentry *(*decode_fh)(struct super_block *sb, __u32 *fh, int fh_len, int fh_type,
9891 int (*acceptable)(void *context, struct dentry *de),
9892 void *context);
9893 int (*encode_fh)(struct dentry *de, __u32 *fh, int *max_len,
9894 int connectable);
9895
9896
9897 int (*get_name)(struct dentry *parent, char *name,
9898 struct dentry *child);
9899 struct dentry * (*get_parent)(struct dentry *child);
9900 struct dentry * (*get_dentry)(struct super_block *sb, void *inump);
9901
9902
9903 struct dentry * (*find_exported_dentry)(
9904 struct super_block *sb, void *obj, void *parent,
9905 int (*acceptable)(void *context, struct dentry *de),
9906 void *context);
9907
9908
9909 };
9910
9911 extern struct dentry *
9912 find_exported_dentry(struct super_block *sb, void *obj, void *parent,
9913 int (*acceptable)(void *context, struct dentry *de),
9914 void *context);
9915
9916 struct file_system_type {
9917 const char *name;
9918 int fs_flags;
9919 int (*get_sb) (struct file_system_type *, int,
9920 const char *, void *, struct vfsmount *);
9921 void (*kill_sb) (struct super_block *);
9922 struct module *owner;
9923 struct file_system_type * next;
9924 struct list_head fs_supers;
9925 struct lock_class_key s_lock_key;
9926 struct lock_class_key s_umount_key;
9927 };
9928
9929 extern int get_sb_bdev(struct file_system_type *fs_type,
9930 int flags, const char *dev_name, void *data,
9931 int (*fill_super)(struct super_block *, void *, int),
9932 struct vfsmount *mnt);
9933 extern int get_sb_single(struct file_system_type *fs_type,
9934 int flags, void *data,
9935 int (*fill_super)(struct super_block *, void *, int),
9936 struct vfsmount *mnt);
9937 extern int get_sb_nodev(struct file_system_type *fs_type,
9938 int flags, void *data,
9939 int (*fill_super)(struct super_block *, void *, int),
9940 struct vfsmount *mnt);
9941 void generic_shutdown_super(struct super_block *sb);
9942 void kill_block_super(struct super_block *sb);
9943 void kill_anon_super(struct super_block *sb);
9944 void kill_litter_super(struct super_block *sb);
9945 void deactivate_super(struct super_block *sb);
9946 int set_anon_super(struct super_block *s, void *data);
9947 struct super_block *sget(struct file_system_type *type,
9948 int (*test)(struct super_block *,void *),
9949 int (*set)(struct super_block *,void *),
9950 void *data);
9951 extern int get_sb_pseudo(struct file_system_type *, char *,
9952 const struct super_operations *ops, unsigned long,
9953 struct vfsmount *mnt);
9954 extern int simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
9955 int __put_super(struct super_block *sb);
9956 int __put_super_and_need_restart(struct super_block *sb);
9957 void unnamed_dev_init(void);
9958
9959
9960
9961
9962
9963
9964
9965 extern int register_filesystem(struct file_system_type *);
9966 extern int unregister_filesystem(struct file_system_type *);
9967 extern struct vfsmount *kern_mount(struct file_system_type *);
9968 extern int may_umount_tree(struct vfsmount *);
9969 extern int may_umount(struct vfsmount *);
9970 extern void umount_tree(struct vfsmount *, int, struct list_head *);
9971 extern void release_mounts(struct list_head *);
9972 extern long do_mount(char *, char *, char *, unsigned long, void *);
9973 extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int);
9974 extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *,
9975 struct vfsmount *);
9976
9977 extern int vfs_statfs(struct dentry *, struct kstatfs *);
9978
9979
9980 extern struct subsystem fs_subsys;
9981
9982
9983
9984
9985 extern int locks_mandatory_locked(struct inode *);
9986 extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size_t);
9987 # 1429 "include/linux/fs.h"
9988 static inline __attribute__((always_inline)) int locks_verify_locked(struct inode *inode)
9989 {
9990 if ((((inode)->i_sb->s_flags & (64)) && ((inode)->i_mode & (0002000 | 00010)) == 0002000))
9991 return locks_mandatory_locked(inode);
9992 return 0;
9993 }
9994
9995 extern int rw_verify_area(int, struct file *, loff_t *, size_t);
9996
9997 static inline __attribute__((always_inline)) int locks_verify_truncate(struct inode *inode,
9998 struct file *filp,
9999 loff_t size)
10000 {
10001 if (inode->i_flock && (((inode)->i_sb->s_flags & (64)) && ((inode)->i_mode & (0002000 | 00010)) == 0002000))
10002 return locks_mandatory_area(
10003 2, inode, filp,
10004 size < inode->i_size ? size : inode->i_size,
10005 (size < inode->i_size ? inode->i_size - size
10006 : size - inode->i_size)
10007 );
10008 return 0;
10009 }
10010
10011 static inline __attribute__((always_inline)) int break_lease(struct inode *inode, unsigned int mode)
10012 {
10013 if (inode->i_flock)
10014 return __break_lease(inode, mode);
10015 return 0;
10016 }
10017
10018
10019
10020 extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs,
10021 struct file *filp);
10022 extern long do_sys_open(int fdf, const char *filename, int flags,
10023 int mode);
10024 extern struct file *filp_open(const char *, int, int);
10025 extern struct file * dentry_open(struct dentry *, struct vfsmount *, int);
10026 extern int filp_close(struct file *, fl_owner_t id);
10027 extern char * getname(const char *);
10028
10029
10030 extern void __attribute__ ((__section__ (".init.text"))) vfs_caches_init_early(void);
10031 extern void __attribute__ ((__section__ (".init.text"))) vfs_caches_init(unsigned long);
10032
10033 extern struct kmem_cache *names_cachep;
10034 # 1485 "include/linux/fs.h"
10035 extern int register_blkdev(unsigned int, const char *);
10036 extern int unregister_blkdev(unsigned int, const char *);
10037 extern struct block_device *bdget(dev_t);
10038 extern void bd_set_size(struct block_device *, loff_t size);
10039 extern void bd_forget(struct inode *inode);
10040 extern void bdput(struct block_device *);
10041 extern struct block_device *open_by_devnum(dev_t, unsigned);
10042 extern const struct address_space_operations def_blk_aops;
10043
10044
10045
10046 extern const struct file_operations def_blk_fops;
10047 extern const struct file_operations def_chr_fops;
10048 extern const struct file_operations bad_sock_fops;
10049 extern const struct file_operations def_fifo_fops;
10050
10051 extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long);
10052 extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long);
10053 extern int blkdev_driver_ioctl(struct inode *inode, struct file *file,
10054 struct gendisk *disk, unsigned cmd,
10055 unsigned long arg);
10056 extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
10057 extern int blkdev_get(struct block_device *, mode_t, unsigned);
10058 extern int blkdev_put(struct block_device *);
10059 extern int bd_claim(struct block_device *, void *);
10060 extern void bd_release(struct block_device *);
10061
10062 extern int bd_claim_by_disk(struct block_device *, void *, struct gendisk *);
10063 extern void bd_release_from_disk(struct block_device *, struct gendisk *);
10064 # 1522 "include/linux/fs.h"
10065 extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *);
10066 extern int register_chrdev_region(dev_t, unsigned, const char *);
10067 extern int register_chrdev(unsigned int, const char *,
10068 const struct file_operations *);
10069 extern int unregister_chrdev(unsigned int, const char *);
10070 extern void unregister_chrdev_region(dev_t, unsigned);
10071 extern int chrdev_open(struct inode *, struct file *);
10072 extern void chrdev_show(struct seq_file *,off_t);
10073
10074
10075
10076
10077
10078
10079 extern const char *__bdevname(dev_t, char *buffer);
10080 extern const char *bdevname(struct block_device *bdev, char *buffer);
10081 extern struct block_device *lookup_bdev(const char *);
10082 extern struct block_device *open_bdev_excl(const char *, int, void *);
10083 extern void close_bdev_excl(struct block_device *);
10084 extern void blkdev_show(struct seq_file *,off_t);
10085
10086
10087
10088
10089 extern void init_special_inode(struct inode *, umode_t, dev_t);
10090
10091
10092 extern void make_bad_inode(struct inode *);
10093 extern int is_bad_inode(struct inode *);
10094
10095 extern const struct file_operations read_fifo_fops;
10096 extern const struct file_operations write_fifo_fops;
10097 extern const struct file_operations rdwr_fifo_fops;
10098
10099 extern int fs_may_remount_ro(struct super_block *);
10100 # 1569 "include/linux/fs.h"
10101 extern int check_disk_change(struct block_device *);
10102 extern int __invalidate_device(struct block_device *);
10103 extern int invalidate_partition(struct gendisk *, int);
10104
10105 extern int invalidate_inodes(struct super_block *);
10106 unsigned long invalidate_mapping_pages(struct address_space *mapping,
10107 unsigned long start, unsigned long end);
10108
10109 static inline __attribute__((always_inline)) unsigned long __attribute__((deprecated))
10110 invalidate_inode_pages(struct address_space *mapping)
10111 {
10112 return invalidate_mapping_pages(mapping, 0, ~0UL);
10113 }
10114
10115 static inline __attribute__((always_inline)) void invalidate_remote_inode(struct inode *inode)
10116 {
10117 if ((((inode->i_mode) & 00170000) == 0100000) || (((inode->i_mode) & 00170000) == 0040000) ||
10118 (((inode->i_mode) & 00170000) == 0120000))
10119 invalidate_mapping_pages(inode->i_mapping, 0, -1);
10120 }
10121 extern int invalidate_inode_pages2(struct address_space *mapping);
10122 extern int invalidate_inode_pages2_range(struct address_space *mapping,
10123 unsigned long start, unsigned long end);
10124 extern int write_inode_now(struct inode *, int);
10125 extern int filemap_fdatawrite(struct address_space *);
10126 extern int filemap_flush(struct address_space *);
10127 extern int filemap_fdatawait(struct address_space *);
10128 extern int filemap_write_and_wait(struct address_space *mapping);
10129 extern int filemap_write_and_wait_range(struct address_space *mapping,
10130 loff_t lstart, loff_t lend);
10131 extern int wait_on_page_writeback_range(struct address_space *mapping,
10132 unsigned long start, unsigned long end);
10133 extern int __filemap_fdatawrite_range(struct address_space *mapping,
10134 loff_t start, loff_t end, int sync_mode);
10135
10136 extern long do_fsync(struct file *file, int datasync);
10137 extern void sync_supers(void);
10138 extern void sync_filesystems(int wait);
10139 extern void __fsync_super(struct super_block *sb);
10140 extern void emergency_sync(void);
10141 extern void emergency_remount(void);
10142 extern int do_remount_sb(struct super_block *sb, int flags,
10143 void *data, int force);
10144
10145 extern sector_t bmap(struct inode *, sector_t);
10146
10147 extern int notify_change(struct dentry *, struct iattr *);
10148 extern int permission(struct inode *, int, struct nameidata *);
10149 extern int generic_permission(struct inode *, int,
10150 int (*check_acl)(struct inode *, int));
10151
10152 extern int get_write_access(struct inode *);
10153 extern int deny_write_access(struct file *);
10154 static inline __attribute__((always_inline)) void put_write_access(struct inode * inode)
10155 {
10156 atomic_dec(&inode->i_writecount);
10157 }
10158 static inline __attribute__((always_inline)) void allow_write_access(struct file *file)
10159 {
10160 if (file)
10161 atomic_inc(&file->f_path.dentry->d_inode->i_writecount);
10162 }
10163 extern int do_pipe(int *);
10164 extern struct file *create_read_pipe(struct file *f);
10165 extern struct file *create_write_pipe(void);
10166 extern void free_write_pipe(struct file *);
10167
10168 extern int open_namei(int dfd, const char *, int, int, struct nameidata *);
10169 extern int may_open(struct nameidata *, int, int);
10170
10171 extern int kernel_read(struct file *, unsigned long, char *, unsigned long);
10172 extern struct file * open_exec(const char *);
10173
10174
10175 extern int is_subdir(struct dentry *, struct dentry *);
10176 extern ino_t find_inode_number(struct dentry *, struct qstr *);
10177
10178 # 1 "include/linux/err.h" 1
10179 # 22 "include/linux/err.h"
10180 static inline __attribute__((always_inline)) void *ERR_PTR(long error)
10181 {
10182 return (void *) error;
10183 }
10184
10185 static inline __attribute__((always_inline)) long PTR_ERR(const void *ptr)
10186 {
10187 return (long) ptr;
10188 }
10189
10190 static inline __attribute__((always_inline)) long IS_ERR(const void *ptr)
10191 {
10192 return __builtin_expect(!!(((unsigned long)ptr) >= (unsigned long)-4095), 0);
10193 }
10194 # 1647 "include/linux/fs.h" 2
10195
10196
10197 extern loff_t default_llseek(struct file *file, loff_t offset, int origin);
10198
10199 extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin);
10200
10201 extern void inode_init_once(struct inode *);
10202 extern void iput(struct inode *);
10203 extern struct inode * igrab(struct inode *);
10204 extern ino_t iunique(struct super_block *, ino_t);
10205 extern int inode_needs_sync(struct inode *inode);
10206 extern void generic_delete_inode(struct inode *inode);
10207 extern void generic_drop_inode(struct inode *inode);
10208
10209 extern struct inode *ilookup5_nowait(struct super_block *sb,
10210 unsigned long hashval, int (*test)(struct inode *, void *),
10211 void *data);
10212 extern struct inode *ilookup5(struct super_block *sb, unsigned long hashval,
10213 int (*test)(struct inode *, void *), void *data);
10214 extern struct inode *ilookup(struct super_block *sb, unsigned long ino);
10215
10216 extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*test)(struct inode *, void *), int (*set)(struct inode *, void *), void *);
10217 extern struct inode * iget_locked(struct super_block *, unsigned long);
10218 extern void unlock_new_inode(struct inode *);
10219
10220 static inline __attribute__((always_inline)) struct inode *iget(struct super_block *sb, unsigned long ino)
10221 {
10222 struct inode *inode = iget_locked(sb, ino);
10223
10224 if (inode && (inode->i_state & 64)) {
10225 sb->s_op->read_inode(inode);
10226 unlock_new_inode(inode);
10227 }
10228
10229 return inode;
10230 }
10231
10232 extern void __iget(struct inode * inode);
10233 extern void clear_inode(struct inode *);
10234 extern void destroy_inode(struct inode *);
10235 extern struct inode *new_inode(struct super_block *);
10236 extern int __remove_suid(struct dentry *, int);
10237 extern int should_remove_suid(struct dentry *);
10238 extern int remove_suid(struct dentry *);
10239
10240 extern void __insert_inode_hash(struct inode *, unsigned long hashval);
10241 extern void remove_inode_hash(struct inode *);
10242 static inline __attribute__((always_inline)) void insert_inode_hash(struct inode *inode) {
10243 __insert_inode_hash(inode, inode->i_ino);
10244 }
10245
10246 extern struct file * get_empty_filp(void);
10247 extern void file_move(struct file *f, struct list_head *list);
10248 extern void file_kill(struct file *f);
10249
10250 struct bio;
10251 extern void submit_bio(int, struct bio *);
10252 extern int bdev_read_only(struct block_device *);
10253
10254 extern int set_blocksize(struct block_device *, int);
10255 extern int sb_set_blocksize(struct super_block *, int);
10256 extern int sb_min_blocksize(struct super_block *, int);
10257
10258 extern int generic_file_mmap(struct file *, struct vm_area_struct *);
10259 extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
10260 extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
10261 extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
10262 int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk);
10263 extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t);
10264 extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t);
10265 extern ssize_t generic_file_aio_write_nolock(struct kiocb *, const struct iovec *,
10266 unsigned long, loff_t);
10267 extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *,
10268 unsigned long *, loff_t, loff_t *, size_t, size_t);
10269 extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *,
10270 unsigned long, loff_t, loff_t *, size_t, ssize_t);
10271 extern ssize_t do_sync_read(struct file *filp, char *buf, size_t len, loff_t *ppos);
10272 extern ssize_t do_sync_write(struct file *filp, const char *buf, size_t len, loff_t *ppos);
10273 extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *);
10274 extern void do_generic_mapping_read(struct address_space *mapping,
10275 struct file_ra_state *, struct file *,
10276 loff_t *, read_descriptor_t *, read_actor_t);
10277
10278
10279 extern ssize_t generic_file_splice_read(struct file *, loff_t *,
10280 struct pipe_inode_info *, size_t, unsigned int);
10281 extern ssize_t generic_file_splice_write(struct pipe_inode_info *,
10282 struct file *, loff_t *, size_t, unsigned int);
10283 extern ssize_t generic_file_splice_write_nolock(struct pipe_inode_info *,
10284 struct file *, loff_t *, size_t, unsigned int);
10285 extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe,
10286 struct file *out, loff_t *, size_t len, unsigned int flags);
10287 extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
10288 size_t len, unsigned int flags);
10289
10290 extern void
10291 file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping);
10292 extern loff_t no_llseek(struct file *file, loff_t offset, int origin);
10293 extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin);
10294 extern loff_t remote_llseek(struct file *file, loff_t offset, int origin);
10295 extern int generic_file_open(struct inode * inode, struct file * filp);
10296 extern int nonseekable_open(struct inode * inode, struct file * filp);
10297 # 1761 "include/linux/fs.h"
10298 static inline __attribute__((always_inline)) int xip_truncate_page(struct address_space *mapping, loff_t from)
10299 {
10300 return 0;
10301 }
10302
10303
10304 static inline __attribute__((always_inline)) void do_generic_file_read(struct file * filp, loff_t *ppos,
10305 read_descriptor_t * desc,
10306 read_actor_t actor)
10307 {
10308 do_generic_mapping_read(filp->f_mapping,
10309 &filp->f_ra,
10310 filp,
10311 ppos,
10312 desc,
10313 actor);
10314 }
10315
10316
10317 ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
10318 struct block_device *bdev, const struct iovec *iov, loff_t offset,
10319 unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io,
10320 int lock_type);
10321
10322 enum {
10323 DIO_LOCKING = 1,
10324 DIO_NO_LOCKING,
10325 DIO_OWN_LOCKING,
10326 };
10327
10328 static inline __attribute__((always_inline)) ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb,
10329 struct inode *inode, struct block_device *bdev, const struct iovec *iov,
10330 loff_t offset, unsigned long nr_segs, get_block_t get_block,
10331 dio_iodone_t end_io)
10332 {
10333 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset,
10334 nr_segs, get_block, end_io, DIO_LOCKING);
10335 }
10336
10337 static inline __attribute__((always_inline)) ssize_t blockdev_direct_IO_no_locking(int rw, struct kiocb *iocb,
10338 struct inode *inode, struct block_device *bdev, const struct iovec *iov,
10339 loff_t offset, unsigned long nr_segs, get_block_t get_block,
10340 dio_iodone_t end_io)
10341 {
10342 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset,
10343 nr_segs, get_block, end_io, DIO_NO_LOCKING);
10344 }
10345
10346 static inline __attribute__((always_inline)) ssize_t blockdev_direct_IO_own_locking(int rw, struct kiocb *iocb,
10347 struct inode *inode, struct block_device *bdev, const struct iovec *iov,
10348 loff_t offset, unsigned long nr_segs, get_block_t get_block,
10349 dio_iodone_t end_io)
10350 {
10351 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset,
10352 nr_segs, get_block, end_io, DIO_OWN_LOCKING);
10353 }
10354
10355
10356 extern const struct file_operations generic_ro_fops;
10357
10358
10359
10360 extern int vfs_readlink(struct dentry *, char *, int, const char *);
10361 extern int vfs_follow_link(struct nameidata *, const char *);
10362 extern int page_readlink(struct dentry *, char *, int);
10363 extern void *page_follow_link_light(struct dentry *, struct nameidata *);
10364 extern void page_put_link(struct dentry *, struct nameidata *, void *);
10365 extern int __page_symlink(struct inode *inode, const char *symname, int len,
10366 gfp_t gfp_mask);
10367 extern int page_symlink(struct inode *inode, const char *symname, int len);
10368 extern const struct inode_operations page_symlink_inode_operations;
10369 extern int generic_readlink(struct dentry *, char *, int);
10370 extern void generic_fillattr(struct inode *, struct kstat *);
10371 extern int vfs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
10372 void inode_add_bytes(struct inode *inode, loff_t bytes);
10373 void inode_sub_bytes(struct inode *inode, loff_t bytes);
10374 loff_t inode_get_bytes(struct inode *inode);
10375 void inode_set_bytes(struct inode *inode, loff_t bytes);
10376
10377 extern int vfs_readdir(struct file *, filldir_t, void *);
10378
10379 extern int vfs_stat(char *, struct kstat *);
10380 extern int vfs_lstat(char *, struct kstat *);
10381 extern int vfs_stat_fd(int dfd, char *, struct kstat *);
10382 extern int vfs_lstat_fd(int dfd, char *, struct kstat *);
10383 extern int vfs_fstat(unsigned int, struct kstat *);
10384
10385 extern int vfs_ioctl(struct file *, unsigned int, unsigned int, unsigned long);
10386
10387 extern struct file_system_type *get_fs_type(const char *name);
10388 extern struct super_block *get_super(struct block_device *);
10389 extern struct super_block *user_get_super(dev_t);
10390 extern void drop_super(struct super_block *sb);
10391
10392 extern int dcache_dir_open(struct inode *, struct file *);
10393 extern int dcache_dir_close(struct inode *, struct file *);
10394 extern loff_t dcache_dir_lseek(struct file *, loff_t, int);
10395 extern int dcache_readdir(struct file *, void *, filldir_t);
10396 extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *);
10397 extern int simple_statfs(struct dentry *, struct kstatfs *);
10398 extern int simple_link(struct dentry *, struct inode *, struct dentry *);
10399 extern int simple_unlink(struct inode *, struct dentry *);
10400 extern int simple_rmdir(struct inode *, struct dentry *);
10401 extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
10402 extern int simple_sync_file(struct file *, struct dentry *, int);
10403 extern int simple_empty(struct dentry *);
10404 extern int simple_readpage(struct file *file, struct page *page);
10405 extern int simple_prepare_write(struct file *file, struct page *page,
10406 unsigned offset, unsigned to);
10407 extern int simple_commit_write(struct file *file, struct page *page,
10408 unsigned offset, unsigned to);
10409
10410 extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *);
10411 extern ssize_t generic_read_dir(struct file *, char *, size_t, loff_t *);
10412 extern const struct file_operations simple_dir_operations;
10413 extern const struct inode_operations simple_dir_inode_operations;
10414 struct tree_descr { char *name; const struct file_operations *ops; int mode; };
10415 struct dentry *d_alloc_name(struct dentry *, const char *);
10416 extern int simple_fill_super(struct super_block *, int, struct tree_descr *);
10417 extern int simple_pin_fs(struct file_system_type *, struct vfsmount **mount, int *count);
10418 extern void simple_release_fs(struct vfsmount **mount, int *count);
10419
10420 extern ssize_t simple_read_from_buffer(void *, size_t, loff_t *, const void *, size_t);
10421 # 1892 "include/linux/fs.h"
10422 extern int inode_change_ok(struct inode *, struct iattr *);
10423 extern int __attribute__((warn_unused_result)) inode_setattr(struct inode *, struct iattr *);
10424
10425 extern void file_update_time(struct file *file);
10426
10427 static inline __attribute__((always_inline)) ino_t parent_ino(struct dentry *dentry)
10428 {
10429 ino_t res;
10430
10431 do { do { } while (0); (void)0; (void)(&dentry->d_lock); } while (0);
10432 res = dentry->d_parent->d_inode->i_ino;
10433 do { do { } while (0); (void)0; (void)(&dentry->d_lock); } while (0);
10434 return res;
10435 }
10436
10437
10438 extern int unshare_files(void);
10439
10440
10441
10442
10443
10444
10445
10446 struct simple_transaction_argresp {
10447 ssize_t size;
10448 char data[0];
10449 };
10450
10451
10452
10453 char *simple_transaction_get(struct file *file, const char *buf,
10454 size_t size);
10455 ssize_t simple_transaction_read(struct file *file, char *buf,
10456 size_t size, loff_t *pos);
10457 int simple_transaction_release(struct inode *inode, struct file *file);
10458
10459 static inline __attribute__((always_inline)) void simple_transaction_set(struct file *file, size_t n)
10460 {
10461 struct simple_transaction_argresp *ar = file->private_data;
10462
10463 do { if (__builtin_expect(!!((n > ((1UL << 12) - sizeof(struct simple_transaction_argresp)))!=0), 0)) do { printk("BUG: failure at %s:%d/%s()!\n", "include/linux/fs.h", 1933, (__func__)); panic("BUG!"); } while (0); } while(0);
10464
10465
10466
10467
10468
10469 __asm__ __volatile__("": : :"memory");
10470 ar->size = n;
10471 }
10472 # 1973 "include/linux/fs.h"
10473 static inline __attribute__((always_inline)) void __attribute__((format(printf, 1, 2)))
10474 __simple_attr_check_format(const char *fmt, ...)
10475 {
10476
10477 }
10478
10479 int simple_attr_open(struct inode *inode, struct file *file,
10480 u64 (*get)(void *), void (*set)(void *, u64),
10481 const char *fmt);
10482 int simple_attr_close(struct inode *inode, struct file *file);
10483 ssize_t simple_attr_read(struct file *file, char *buf,
10484 size_t len, loff_t *ppos);
10485 ssize_t simple_attr_write(struct file *file, const char *buf,
10486 size_t len, loff_t *ppos);
10487
10488
10489
10490 static inline __attribute__((always_inline)) char *alloc_secdata(void)
10491 {
10492 return (char *)get_zeroed_page(((( gfp_t)0x10u) | (( gfp_t)0x40u) | (( gfp_t)0x80u)));
10493 }
10494
10495 static inline __attribute__((always_inline)) void free_secdata(void *secdata)
10496 {
10497 free_pages(((unsigned long)secdata),0);
10498 }
10499 # 16 "include/linux/mm.h" 2
10500
10501 # 1 "include/linux/debug_locks.h" 1
10502
10503
10504
10505 struct task_struct;
10506
10507 extern int debug_locks;
10508 extern int debug_locks_silent;
10509
10510
10511
10512
10513 extern int debug_locks_off(void);
10514 # 46 "include/linux/debug_locks.h"
10515 struct task_struct;
10516
10517
10518
10519
10520
10521
10522
10523 static inline __attribute__((always_inline)) void debug_show_all_locks(void)
10524 {
10525 }
10526
10527 static inline __attribute__((always_inline)) void debug_show_held_locks(struct task_struct *task)
10528 {
10529 }
10530
10531 static inline __attribute__((always_inline)) void
10532 debug_check_no_locks_freed(const void *from, unsigned long len)
10533 {
10534 }
10535
10536 static inline __attribute__((always_inline)) void
10537 debug_check_no_locks_held(struct task_struct *task)
10538 {
10539 }
10540 # 18 "include/linux/mm.h" 2
10541 # 1 "include/linux/backing-dev.h" 1
10542 # 13 "include/linux/backing-dev.h"
10543 struct page;
10544
10545
10546
10547
10548 enum bdi_state {
10549 BDI_pdflush,
10550 BDI_write_congested,
10551 BDI_read_congested,
10552 BDI_unused,
10553 };
10554
10555 typedef int (congested_fn)(void *, int);
10556
10557 struct backing_dev_info {
10558 unsigned long ra_pages;
10559 unsigned long state;
10560 unsigned int capabilities;
10561 congested_fn *congested_fn;
10562 void *congested_data;
10563 void (*unplug_io_fn)(struct backing_dev_info *, struct page *);
10564 void *unplug_io_data;
10565 };
10566 # 63 "include/linux/backing-dev.h"
10567 extern struct backing_dev_info default_backing_dev_info;
10568 void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page);
10569
10570 int writeback_acquire(struct backing_dev_info *bdi);
10571 int writeback_in_progress(struct backing_dev_info *bdi);
10572 void writeback_release(struct backing_dev_info *bdi);
10573
10574 static inline __attribute__((always_inline)) int bdi_congested(struct backing_dev_info *bdi, int bdi_bits)
10575 {
10576 if (bdi->congested_fn)
10577 return bdi->congested_fn(bdi->congested_data, bdi_bits);
10578 return (bdi->state & bdi_bits);
10579 }
10580
10581 static inline __attribute__((always_inline)) int bdi_read_congested(struct backing_dev_info *bdi)
10582 {
10583 return bdi_congested(bdi, 1 << BDI_read_congested);
10584 }
10585
10586 static inline __attribute__((always_inline)) int bdi_write_congested(struct backing_dev_info *bdi)
10587 {
10588 return bdi_congested(bdi, 1 << BDI_write_congested);
10589 }
10590
10591 static inline __attribute__((always_inline)) int bdi_rw_congested(struct backing_dev_info *bdi)
10592 {
10593 return bdi_congested(bdi, (1 << BDI_read_congested)|
10594 (1 << BDI_write_congested));
10595 }
10596
10597 void clear_bdi_congested(struct backing_dev_info *bdi, int rw);
10598 void set_bdi_congested(struct backing_dev_info *bdi, int rw);
10599 long congestion_wait(int rw, long timeout);
10600 long congestion_wait_interruptible(int rw, long timeout);
10601 void congestion_end(int rw);
10602 # 19 "include/linux/mm.h" 2
10603 # 1 "include/linux/mm_types.h" 1
10604 # 9 "include/linux/mm_types.h"
10605 struct address_space;
10606 # 18 "include/linux/mm_types.h"
10607 struct page {
10608 unsigned long flags;
10609
10610 atomic_t _count;
10611 atomic_t _mapcount;
10612
10613
10614
10615 union {
10616 struct {
10617 unsigned long private;
10618
10619
10620
10621
10622
10623
10624 struct address_space *mapping;
10625
10626
10627
10628
10629
10630
10631 };
10632
10633
10634
10635 };
10636 unsigned long index;
10637 struct list_head lru;
10638 # 69 "include/linux/mm_types.h"
10639 };
10640 # 20 "include/linux/mm.h" 2
10641
10642 struct mempolicy;
10643 struct anon_vma;
10644
10645
10646 extern unsigned long max_mapnr;
10647
10648
10649 extern unsigned long num_physpages;
10650 extern void * high_memory;
10651 extern unsigned long vmalloc_earlyreserve;
10652 extern int page_cluster;
10653
10654
10655 extern int sysctl_legacy_va_layout;
10656
10657
10658
10659
10660
10661 # 1 "include/asm/pgtable.h" 1
10662
10663
10664
10665 # 1 "include/asm-generic/4level-fixup.h" 1
10666 # 5 "include/asm/pgtable.h" 2
10667
10668
10669 # 1 "include/asm/cplb.h" 1
10670 # 8 "include/asm/pgtable.h" 2
10671
10672 typedef pte_t *pte_addr_t;
10673 # 33 "include/asm/pgtable.h"
10674 extern void paging_init(void);
10675
10676
10677
10678
10679
10680
10681
10682 static inline __attribute__((always_inline)) int pte_file(pte_t pte)
10683 {
10684 return 0;
10685 }
10686 # 61 "include/asm/pgtable.h"
10687 static inline __attribute__((always_inline)) pte_t pte_rdprotect(pte_t _pte) { _pte.pte &= ~(0x00000004); return _pte; };
10688 static inline __attribute__((always_inline)) pte_t pte_mkread(pte_t _pte) { _pte.pte |= (0x00000004); return _pte; };
10689 static inline __attribute__((always_inline)) pte_t pte_wrprotect(pte_t _pte) { _pte.pte &= ~(0x00000008); return _pte; };
10690 static inline __attribute__((always_inline)) pte_t pte_mkwrite(pte_t _pte) { _pte.pte |= (0x00000008); return _pte; };
10691 static inline __attribute__((always_inline)) pte_t pte_exprotect(pte_t _pte) { _pte.pte &= ~(0x00000004 | 0x00000008); return _pte; };
10692 static inline __attribute__((always_inline)) pte_t pte_mkexec(pte_t _pte) { _pte.pte |= (0x00000004 | 0x00000008); return _pte; };
10693 static inline __attribute__((always_inline)) pte_t pte_mkclean(pte_t _pte) { _pte.pte &= ~(0x00000080); return _pte; };
10694 static inline __attribute__((always_inline)) pte_t pte_mkdirty(pte_t _pte) { _pte.pte |= (0x00000080); return _pte; };
10695 static inline __attribute__((always_inline)) pte_t pte_mkold(pte_t _pte) { _pte.pte &= ~0x00000010 | 0x00000004 | 0x00000008; return _pte; };
10696 static inline __attribute__((always_inline)) pte_t pte_mkyoung(pte_t _pte) { _pte.pte |= 0x00000010 | 0x00000004 | 0x00000008; return _pte; };
10697
10698
10699
10700
10701
10702
10703
10704 extern unsigned int kobjsize(const void *objp);
10705 # 94 "include/asm/pgtable.h"
10706 # 1 "include/asm-generic/pgtable.h" 1
10707 # 130 "include/asm-generic/pgtable.h"
10708 struct mm_struct;
10709 static inline __attribute__((always_inline)) void ptep_set_wrprotect(struct mm_struct *mm, unsigned long address, pte_t *ptep)
10710 {
10711 pte_t old_pte = *ptep;
10712 (*(ptep) = pte_wrprotect(old_pte));
10713 }
10714 # 230 "include/asm-generic/pgtable.h"
10715 void pgd_clear_bad(pgd_t *);
10716 void pud_clear_bad(pgd_t *);
10717 void pmd_clear_bad(pmd_t *);
10718
10719 static inline __attribute__((always_inline)) int pgd_none_or_clear_bad(pgd_t *pgd)
10720 {
10721 if ((0))
10722 return 1;
10723 if (__builtin_expect(!!((0)), 0)) {
10724 pgd_clear_bad(pgd);
10725 return 1;
10726 }
10727 return 0;
10728 }
10729
10730 static inline __attribute__((always_inline)) int pud_none_or_clear_bad(pgd_t *pud)
10731 {
10732 if (0)
10733 return 1;
10734 if (__builtin_expect(!!(0), 0)) {
10735 pud_clear_bad(pud);
10736 return 1;
10737 }
10738 return 0;
10739 }
10740
10741 static inline __attribute__((always_inline)) int pmd_none_or_clear_bad(pmd_t *pmd)
10742 {
10743 if ((!((&*pmd)->pmd[0])))
10744 return 1;
10745 if (__builtin_expect(!!((((&*pmd)->pmd[0]) & ~(~((1UL << 12)-1)))), 0)) {
10746 pmd_clear_bad(pmd);
10747 return 1;
10748 }
10749 return 0;
10750 }
10751 # 95 "include/asm/pgtable.h" 2
10752 # 41 "include/linux/mm.h" 2
10753 # 60 "include/linux/mm.h"
10754 struct vm_area_struct {
10755 struct mm_struct * vm_mm;
10756 unsigned long vm_start;
10757 unsigned long vm_end;
10758
10759
10760
10761 struct vm_area_struct *vm_next;
10762
10763 pgprot_t vm_page_prot;
10764 unsigned long vm_flags;
10765
10766 struct rb_node vm_rb;
10767
10768
10769
10770
10771
10772
10773
10774 union {
10775 struct {
10776 struct list_head list;
10777 void *parent;
10778 struct vm_area_struct *head;
10779 } vm_set;
10780
10781 struct raw_prio_tree_node prio_tree_node;
10782 } shared;
10783
10784
10785
10786
10787
10788
10789
10790 struct list_head anon_vma_node;
10791 struct anon_vma *anon_vma;
10792
10793
10794 struct vm_operations_struct * vm_ops;
10795
10796
10797 unsigned long vm_pgoff;
10798
10799 struct file * vm_file;
10800 void * vm_private_data;
10801 unsigned long vm_truncate_count;
10802
10803
10804 atomic_t vm_usage;
10805
10806
10807
10808
10809 };
10810
10811 extern struct kmem_cache *vm_area_cachep;
10812
10813
10814
10815
10816
10817
10818 struct vm_list_struct {
10819 struct vm_list_struct *next;
10820 struct vm_area_struct *vma;
10821 };
10822
10823
10824 extern struct rb_root nommu_vma_tree;
10825 extern struct rw_semaphore nommu_vma_sem;
10826
10827 extern unsigned int kobjsize(const void *objp);
10828 # 194 "include/linux/mm.h"
10829 extern pgprot_t protection_map[16];
10830
10831
10832
10833
10834
10835
10836
10837 struct vm_operations_struct {
10838 void (*open)(struct vm_area_struct * area);
10839 void (*close)(struct vm_area_struct * area);
10840 struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int *type);
10841 unsigned long (*nopfn)(struct vm_area_struct * area, unsigned long address);
10842 int (*populate)(struct vm_area_struct * area, unsigned long address, unsigned long len, pgprot_t prot, unsigned long pgoff, int nonblock);
10843
10844
10845
10846 int (*page_mkwrite)(struct vm_area_struct *vma, struct page *page);
10847
10848
10849
10850
10851
10852
10853
10854 };
10855
10856 struct mmu_gather;
10857 struct inode;
10858 # 231 "include/linux/mm.h"
10859 # 1 "include/linux/page-flags.h" 1
10860 # 256 "include/linux/page-flags.h"
10861 struct page;
10862
10863 extern void cancel_dirty_page(struct page *page, unsigned int account_size);
10864
10865 int test_clear_page_writeback(struct page *page);
10866 int test_set_page_writeback(struct page *page);
10867
10868 static inline __attribute__((always_inline)) void set_page_writeback(struct page *page)
10869 {
10870 test_set_page_writeback(page);
10871 }
10872 # 232 "include/linux/mm.h" 2
10873 # 255 "include/linux/mm.h"
10874 static inline __attribute__((always_inline)) int put_page_testzero(struct page *page)
10875 {
10876 do { } while(0);
10877 return (atomic_sub_return(1, (&page->_count)) == 0);
10878 }
10879
10880
10881
10882
10883
10884 static inline __attribute__((always_inline)) int get_page_unless_zero(struct page *page)
10885 {
10886 do { } while(0);
10887 return ({ int c, old; c = (((&page->_count))->counter); while (c != (0) && (old = ((int)((__typeof__(*(&((((&page->_count)))->counter))))__cmpxchg((&((((&page->_count)))->counter)),(unsigned long)((c)), (unsigned long)((c + (1))),sizeof(*(&((((&page->_count)))->counter))))))) != c) c = old; c != (0); });
10888 }
10889
10890 static inline __attribute__((always_inline)) int page_count(struct page *page)
10891 {
10892 if (__builtin_expect(!!((__builtin_constant_p(14) ? __constant_test_bit((14),(&(page)->flags)) : __test_bit((14),(&(page)->flags)))), 0))
10893 page = (struct page *)((page)->private);
10894 return ((&page->_count)->counter);
10895 }
10896
10897 static inline __attribute__((always_inline)) void get_page(struct page *page)
10898 {
10899 if (__builtin_expect(!!((__builtin_constant_p(14) ? __constant_test_bit((14),(&(page)->flags)) : __test_bit((14),(&(page)->flags)))), 0))
10900 page = (struct page *)((page)->private);
10901 do { } while(0);
10902 atomic_inc(&page->_count);
10903 }
10904
10905
10906
10907
10908
10909 static inline __attribute__((always_inline)) void init_page_count(struct page *page)
10910 {
10911 (((&page->_count)->counter) = 1);
10912 }
10913
10914 void put_page(struct page *page);
10915 void put_pages_list(struct list_head *pages);
10916
10917 void split_page(struct page *page, unsigned int order);
10918 void split_compound_page(struct page *page, unsigned int order);
10919
10920
10921
10922
10923
10924
10925 typedef void compound_page_dtor(struct page *);
10926
10927 static inline __attribute__((always_inline)) void set_compound_page_dtor(struct page *page,
10928 compound_page_dtor *dtor)
10929 {
10930 page[1].lru.next = (void *)dtor;
10931 }
10932
10933 static inline __attribute__((always_inline)) compound_page_dtor *get_compound_page_dtor(struct page *page)
10934 {
10935 return (compound_page_dtor *)page[1].lru.next;
10936 }
10937 # 461 "include/linux/mm.h"
10938 static inline __attribute__((always_inline)) enum zone_type page_zonenum(struct page *page)
10939 {
10940 return (page->flags >> (((((sizeof(unsigned long)*8) - 0) - 0) - 1) * (1 != 0))) & ((1UL << 1) - 1);
10941 }
10942 # 474 "include/linux/mm.h"
10943 static inline __attribute__((always_inline)) int page_zone_id(struct page *page)
10944 {
10945 return (page->flags >> ((((((sizeof(unsigned long)*8) - 0) - 0) < ((((sizeof(unsigned long)*8) - 0) - 0) - 1))? (((sizeof(unsigned long)*8) - 0) - 0) : ((((sizeof(unsigned long)*8) - 0) - 0) - 1)) * ((0 + 1) != 0))) & ((1UL << (0 + 1)) - 1);
10946 }
10947
10948 static inline __attribute__((always_inline)) int zone_to_nid(struct zone *zone)
10949 {
10950
10951
10952
10953 return 0;
10954
10955 }
10956
10957
10958
10959
10960 static inline __attribute__((always_inline)) int page_to_nid(struct page *page)
10961 {
10962 return (page->flags >> ((((sizeof(unsigned long)*8) - 0) - 0) * (0 != 0))) & ((1UL << 0) - 1);
10963 }
10964
10965
10966 static inline __attribute__((always_inline)) struct zone *page_zone(struct page *page)
10967 {
10968 return &(&contig_page_data)->node_zones[page_zonenum(page)];
10969 }
10970
10971 static inline __attribute__((always_inline)) unsigned long page_to_section(struct page *page)
10972 {
10973 return (page->flags >> (((sizeof(unsigned long)*8) - 0) * (0 != 0))) & ((1UL << 0) - 1);
10974 }
10975
10976 static inline __attribute__((always_inline)) void set_page_zone(struct page *page, enum zone_type zone)
10977 {
10978 page->flags &= ~(((1UL << 1) - 1) << (((((sizeof(unsigned long)*8) - 0) - 0) - 1) * (1 != 0)));
10979 page->flags |= (zone & ((1UL << 1) - 1)) << (((((sizeof(unsigned long)*8) - 0) - 0) - 1) * (1 != 0));
10980 }
10981
10982 static inline __attribute__((always_inline)) void set_page_node(struct page *page, unsigned long node)
10983 {
10984 page->flags &= ~(((1UL << 0) - 1) << ((((sizeof(unsigned long)*8) - 0) - 0) * (0 != 0)));
10985 page->flags |= (node & ((1UL << 0) - 1)) << ((((sizeof(unsigned long)*8) - 0) - 0) * (0 != 0));
10986 }
10987
10988 static inline __attribute__((always_inline)) void set_page_section(struct page *page, unsigned long section)
10989 {
10990 page->flags &= ~(((1UL << 0) - 1) << (((sizeof(unsigned long)*8) - 0) * (0 != 0)));
10991 page->flags |= (section & ((1UL << 0) - 1)) << (((sizeof(unsigned long)*8) - 0) * (0 != 0));
10992 }
10993
10994 static inline __attribute__((always_inline)) void set_page_links(struct page *page, enum zone_type zone,
10995 unsigned long node, unsigned long pfn)
10996 {
10997 set_page_zone(page, zone);
10998 set_page_node(page, node);
10999 set_page_section(page, ((pfn) >> 0));
11000 }
11001
11002
11003
11004
11005 # 1 "include/linux/vmstat.h" 1
11006
11007
11008
11009
11010
11011 # 1 "include/linux/mm.h" 1
11012 # 7 "include/linux/vmstat.h" 2
11013 # 30 "include/linux/vmstat.h"
11014 enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
11015 PGALLOC_DMA, PGALLOC_NORMAL ,
11016 PGFREE, PGACTIVATE, PGDEACTIVATE,
11017 PGFAULT, PGMAJFAULT,
11018 PGREFILL_DMA, PGREFILL_NORMAL ,
11019 PGSTEAL_DMA, PGSTEAL_NORMAL ,
11020 PGSCAN_KSWAPD_DMA, PGSCAN_KSWAPD_NORMAL ,
11021 PGSCAN_DIRECT_DMA, PGSCAN_DIRECT_NORMAL ,
11022 PGINODESTEAL, SLABS_SCANNED, KSWAPD_STEAL, KSWAPD_INODESTEAL,
11023 PAGEOUTRUN, ALLOCSTALL, PGROTATED,
11024 NR_VM_EVENT_ITEMS
11025 };
11026 # 54 "include/linux/vmstat.h"
11027 struct vm_event_state {
11028 unsigned long event[NR_VM_EVENT_ITEMS];
11029 };
11030
11031 extern __typeof__(struct vm_event_state) per_cpu__vm_event_states;
11032
11033 static inline __attribute__((always_inline)) void __count_vm_event(enum vm_event_item item)
11034 {
11035 per_cpu__vm_event_states.event[item]++;
11036 }
11037
11038 static inline __attribute__((always_inline)) void count_vm_event(enum vm_event_item item)
11039 {
11040 (*({ extern int simple_identifier_vm_event_states(void); do { } while (0); &per_cpu__vm_event_states; })).event[item]++;
11041 do { } while (0);
11042 }
11043
11044 static inline __attribute__((always_inline)) void __count_vm_events(enum vm_event_item item, long delta)
11045 {
11046 per_cpu__vm_event_states.event[item] += delta;
11047 }
11048
11049 static inline __attribute__((always_inline)) void count_vm_events(enum vm_event_item item, long delta)
11050 {
11051 (*({ extern int simple_identifier_vm_event_states(void); do { } while (0); &per_cpu__vm_event_states; })).event[item] += delta;
11052 do { } while (0);
11053 }
11054
11055 extern void all_vm_events(unsigned long *);
11056
11057 extern void vm_events_fold_cpu(int cpu);
11058 # 122 "include/linux/vmstat.h"
11059 extern atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
11060
11061 static inline __attribute__((always_inline)) void zone_page_state_add(long x, struct zone *zone,
11062 enum zone_stat_item item)
11063 {
11064 atomic_long_add(x, &zone->vm_stat[item]);
11065 atomic_long_add(x, &vm_stat[item]);
11066 }
11067
11068 static inline __attribute__((always_inline)) unsigned long global_page_state(enum zone_stat_item item)
11069 {
11070 long x = atomic_long_read(&vm_stat[item]);
11071
11072
11073
11074
11075 return x;
11076 }
11077
11078 static inline __attribute__((always_inline)) unsigned long zone_page_state(struct zone *zone,
11079 enum zone_stat_item item)
11080 {
11081 long x = atomic_long_read(&zone->vm_stat[item]);
11082
11083
11084
11085
11086 return x;
11087 }
11088 # 193 "include/linux/vmstat.h"
11089 static inline __attribute__((always_inline)) void zap_zone_vm_stats(struct zone *zone)
11090 {
11091 memset(zone->vm_stat, 0, sizeof(zone->vm_stat));
11092 }
11093
11094 extern void inc_zone_state(struct zone *, enum zone_stat_item);
11095 # 223 "include/linux/vmstat.h"
11096 static inline __attribute__((always_inline)) void __mod_zone_page_state(struct zone *zone,
11097 enum zone_stat_item item, int delta)
11098 {
11099 zone_page_state_add(delta, zone, item);
11100 }
11101
11102 static inline __attribute__((always_inline)) void __inc_zone_state(struct zone *zone, enum zone_stat_item item)
11103 {
11104 atomic_long_inc(&zone->vm_stat[item]);
11105 atomic_long_inc(&vm_stat[item]);
11106 }
11107
11108 static inline __attribute__((always_inline)) void __inc_zone_page_state(struct page *page,
11109 enum zone_stat_item item)
11110 {
11111 __inc_zone_state(page_zone(page), item);
11112 }
11113
11114 static inline __attribute__((always_inline)) void __dec_zone_state(struct zone *zone, enum zone_stat_item item)
11115 {
11116 atomic_long_dec(&zone->vm_stat[item]);
11117 atomic_long_dec(&vm_stat[item]);
11118 }
11119
11120 static inline __attribute__((always_inline)) void __dec_zone_page_state(struct page *page,
11121 enum zone_stat_item item)
11122 {
11123 atomic_long_dec(&page_zone(page)->vm_stat[item]);
11124 atomic_long_dec(&vm_stat[item]);
11125 }
11126 # 262 "include/linux/vmstat.h"
11127 static inline __attribute__((always_inline)) void refresh_cpu_vm_stats(int cpu) { }
11128 static inline __attribute__((always_inline)) void refresh_vm_stats(void) { }
11129 # 537 "include/linux/mm.h" 2
11130
11131 static inline __attribute__((always_inline)) __attribute__((always_inline)) void *lowmem_page_address(struct page *page)
11132 {
11133 return ((void *) ((unsigned long)((((unsigned long) ((void *)(((((page) - mem_map) << 12) + (0x00000000))))) >> 12) << 12)));
11134 }
11135 # 579 "include/linux/mm.h"
11136 extern struct address_space swapper_space;
11137 static inline __attribute__((always_inline)) struct address_space *page_mapping(struct page *page)
11138 {
11139 struct address_space *mapping = page->mapping;
11140
11141 if (__builtin_expect(!!(0), 0))
11142 mapping = &swapper_space;
11143 else if (__builtin_expect(!!((unsigned long)mapping & 1), 0))
11144 mapping = ((void *)0);
11145 return mapping;
11146 }
11147
11148 static inline __attribute__((always_inline)) int PageAnon(struct page *page)
11149 {
11150 return ((unsigned long)page->mapping & 1) != 0;
11151 }
11152
11153
11154
11155
11156
11157 static inline __attribute__((always_inline)) unsigned long page_index(struct page *page)
11158 {
11159 if (__builtin_expect(!!(0), 0))
11160 return ((page)->private);
11161 return page->index;
11162 }
11163
11164
11165
11166
11167
11168
11169 static inline __attribute__((always_inline)) void reset_page_mapcount(struct page *page)
11170 {
11171 (((&(page)->_mapcount)->counter) = -1);
11172 }
11173
11174 static inline __attribute__((always_inline)) int page_mapcount(struct page *page)
11175 {
11176 return ((&(page)->_mapcount)->counter) + 1;
11177 }
11178
11179
11180
11181
11182 static inline __attribute__((always_inline)) int page_mapped(struct page *page)
11183 {
11184 return ((&(page)->_mapcount)->counter) >= 0;
11185 }
11186 # 662 "include/linux/mm.h"
11187 extern void show_free_areas(void);
11188
11189
11190
11191
11192
11193
11194
11195 static inline __attribute__((always_inline)) int shmem_lock(struct file *file, int lock,
11196 struct user_struct *user)
11197 {
11198 return 0;
11199 }
11200
11201 static inline __attribute__((always_inline)) int shmem_set_policy(struct vm_area_struct *vma,
11202 struct mempolicy *new)
11203 {
11204 return 0;
11205 }
11206
11207 static inline __attribute__((always_inline)) struct mempolicy *shmem_get_policy(struct vm_area_struct *vma,
11208 unsigned long addr)
11209 {
11210 return ((void *)0);
11211 }
11212
11213 struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags);
11214
11215 int shmem_zero_setup(struct vm_area_struct *);
11216
11217
11218 extern unsigned long shmem_get_unmapped_area(struct file *file,
11219 unsigned long addr,
11220 unsigned long len,
11221 unsigned long pgoff,
11222 unsigned long flags);
11223
11224
11225 static inline __attribute__((always_inline)) int can_do_mlock(void)
11226 {
11227 if (capable(14))
11228 return 1;
11229 if ((get_current())->signal->rlim[8].rlim_cur != 0)
11230 return 1;
11231 return 0;
11232 }
11233 extern int user_shm_lock(size_t, struct user_struct *);
11234 extern void user_shm_unlock(size_t, struct user_struct *);
11235
11236
11237
11238
11239 struct zap_details {
11240 struct vm_area_struct *nonlinear_vma;
11241 struct address_space *check_mapping;
11242 unsigned long first_index;
11243 unsigned long last_index;
11244 spinlock_t *i_mmap_lock;
11245 unsigned long truncate_count;
11246 };
11247
11248 struct page *vm_normal_page(struct vm_area_struct *, unsigned long, pte_t);
11249 unsigned long zap_page_range(struct vm_area_struct *vma, unsigned long address,
11250 unsigned long size, struct zap_details *);
11251 unsigned long unmap_vmas(struct mmu_gather **tlb,
11252 struct vm_area_struct *start_vma, unsigned long start_addr,
11253 unsigned long end_addr, unsigned long *nr_accounted,
11254 struct zap_details *);
11255 void free_pgd_range(struct mmu_gather **tlb, unsigned long addr,
11256 unsigned long end, unsigned long floor, unsigned long ceiling);
11257 void free_pgtables(struct mmu_gather **tlb, struct vm_area_struct *start_vma,
11258 unsigned long floor, unsigned long ceiling);
11259 int copy_page_range(struct mm_struct *dst, struct mm_struct *src,
11260 struct vm_area_struct *vma);
11261 int zeromap_page_range(struct vm_area_struct *vma, unsigned long from,
11262 unsigned long size, pgprot_t prot);
11263 void unmap_mapping_range(struct address_space *mapping,
11264 loff_t const holebegin, loff_t const holelen, int even_cows);
11265
11266 static inline __attribute__((always_inline)) void unmap_shared_mapping_range(struct address_space *mapping,
11267 loff_t const holebegin, loff_t const holelen)
11268 {
11269 unmap_mapping_range(mapping, holebegin, holelen, 0);
11270 }
11271
11272 extern int vmtruncate(struct inode * inode, loff_t offset);
11273 extern int vmtruncate_range(struct inode * inode, loff_t offset, loff_t end);
11274 extern int install_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot);
11275 extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot);
11276 # 764 "include/linux/mm.h"
11277 static inline __attribute__((always_inline)) int handle_mm_fault(struct mm_struct *mm,
11278 struct vm_area_struct *vma, unsigned long address,
11279 int write_access)
11280 {
11281
11282 do { printk("BUG: failure at %s:%d/%s()!\n", "include/linux/mm.h", 769, (__func__)); panic("BUG!"); } while (0);
11283 return 0x01;
11284 }
11285
11286
11287 extern int make_pages_present(unsigned long addr, unsigned long end);
11288 extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write);
11289 void install_arg_page(struct vm_area_struct *, struct page *, unsigned long);
11290
11291 int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start,
11292 int len, int write, int force, struct page **pages, struct vm_area_struct **vmas);
11293 void print_bad_pte(struct vm_area_struct *, pte_t, unsigned long);
11294
11295 extern int try_to_release_page(struct page * page, gfp_t gfp_mask);
11296 extern void do_invalidatepage(struct page *page, unsigned long offset);
11297
11298 int __set_page_dirty_nobuffers(struct page *page);
11299 int __set_page_dirty_no_writeback(struct page *page);
11300 int redirty_page_for_writepage(struct writeback_control *wbc,
11301 struct page *page);
11302 int set_page_dirty(struct page *page);
11303 int set_page_dirty_lock(struct page *page);
11304 int clear_page_dirty_for_io(struct page *page);
11305
11306 extern unsigned long do_mremap(unsigned long addr,
11307 unsigned long old_len, unsigned long new_len,
11308 unsigned long flags, unsigned long new_addr);
11309 # 808 "include/linux/mm.h"
11310 typedef int (*shrinker_t)(int nr_to_scan, gfp_t gfp_mask);
11311
11312
11313
11314
11315
11316
11317
11318 struct shrinker;
11319 extern struct shrinker *set_shrinker(int, shrinker_t);
11320 extern void remove_shrinker(struct shrinker *shrinker);
11321
11322
11323
11324
11325
11326
11327
11328 static inline __attribute__((always_inline)) int vma_wants_writenotify(struct vm_area_struct *vma)
11329 {
11330 unsigned int vm_flags = vma->vm_flags;
11331
11332
11333 if ((vm_flags & (0x00000002|0x00000008)) != ((0x00000002|0x00000008)))
11334 return 0;
11335
11336
11337 if (vma->vm_ops && vma->vm_ops->page_mkwrite)
11338 return 1;
11339
11340
11341 if (((vma->vm_page_prot).pgprot) !=
11342 ((protection_map[vm_flags & (0x00000001|0x00000002|0x00000004|0x00000008)]).pgprot))
11343
11344 return 0;
11345
11346
11347 if (vm_flags & (0x00000400|0x02000000))
11348 return 0;
11349
11350
11351 return vma->vm_file && vma->vm_file->f_mapping &&
11352 (!(((vma->vm_file->f_mapping)->backing_dev_info)->capabilities & 0x00000001));
11353 }
11354
11355 extern pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl);
11356
11357 int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address);
11358 int __pmd_alloc(struct mm_struct *mm, pgd_t *pud, unsigned long address);
11359 int __pte_alloc(struct mm_struct *mm, pmd_t *pmd, unsigned long address);
11360 int __pte_alloc_kernel(pmd_t *pmd, unsigned long address);
11361 # 926 "include/linux/mm.h"
11362 extern void free_area_init(unsigned long * zones_size);
11363 extern void free_area_init_node(int nid, pg_data_t *pgdat,
11364 unsigned long * zones_size, unsigned long zone_start_pfn,
11365 unsigned long *zholes_size);
11366 # 979 "include/linux/mm.h"
11367 extern void set_dma_reserve(unsigned long new_dma_reserve);
11368 extern void memmap_init_zone(unsigned long, int, unsigned long,
11369 unsigned long, enum memmap_context);
11370 extern void setup_per_zone_pages_min(void);
11371 extern void mem_init(void);
11372 extern void show_mem(void);
11373 extern void si_meminfo(struct sysinfo * val);
11374 extern void si_meminfo_node(struct sysinfo *val, int nid);
11375
11376
11377
11378
11379 static inline __attribute__((always_inline)) void setup_per_cpu_pageset(void) {}
11380
11381
11382
11383 void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old);
11384 void vma_prio_tree_insert(struct vm_area_struct *, struct prio_tree_root *);
11385 void vma_prio_tree_remove(struct vm_area_struct *, struct prio_tree_root *);
11386 struct vm_area_struct *vma_prio_tree_next(struct vm_area_struct *vma,
11387 struct prio_tree_iter *iter);
11388
11389
11390
11391
11392
11393 static inline __attribute__((always_inline)) void vma_nonlinear_insert(struct vm_area_struct *vma,
11394 struct list_head *list)
11395 {
11396 vma->shared.vm_set.parent = ((void *)0);
11397 list_add_tail(&vma->shared.vm_set.list, list);
11398 }
11399
11400
11401 extern int __vm_enough_memory(long pages, int cap_sys_admin);
11402 extern void vma_adjust(struct vm_area_struct *vma, unsigned long start,
11403 unsigned long end, unsigned long pgoff, struct vm_area_struct *insert);
11404 extern struct vm_area_struct *vma_merge(struct mm_struct *,
11405 struct vm_area_struct *prev, unsigned long addr, unsigned long end,
11406 unsigned long vm_flags, struct anon_vma *, struct file *, unsigned long,
11407 struct mempolicy *);
11408 extern struct anon_vma *find_mergeable_anon_vma(struct vm_area_struct *);
11409 extern int split_vma(struct mm_struct *,
11410 struct vm_area_struct *, unsigned long addr, int new_below);
11411 extern int insert_vm_struct(struct mm_struct *, struct vm_area_struct *);
11412 extern void __vma_link_rb(struct mm_struct *, struct vm_area_struct *,
11413 struct rb_node **, struct rb_node *);
11414 extern void unlink_file_vma(struct vm_area_struct *);
11415 extern struct vm_area_struct *copy_vma(struct vm_area_struct **,
11416 unsigned long addr, unsigned long len, unsigned long pgoff);
11417 extern void exit_mmap(struct mm_struct *);
11418 extern int may_expand_vm(struct mm_struct *mm, unsigned long npages);
11419 extern int install_special_mapping(struct mm_struct *mm,
11420 unsigned long addr, unsigned long len,
11421 unsigned long flags, struct page **pages);
11422
11423 extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
11424
11425 extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
11426 unsigned long len, unsigned long prot,
11427 unsigned long flag, unsigned long pgoff);
11428
11429 static inline __attribute__((always_inline)) unsigned long do_mmap(struct file *file, unsigned long addr,
11430 unsigned long len, unsigned long prot,
11431 unsigned long flag, unsigned long offset)
11432 {
11433 unsigned long ret = -22;
11434 if ((offset + (((len)+(1UL << 12)-1)&(~((1UL << 12)-1)))) < offset)
11435 goto out;
11436 if (!(offset & ~(~((1UL << 12)-1))))
11437 ret = do_mmap_pgoff(file, addr, len, prot, flag, offset >> 12);
11438 out:
11439 return ret;
11440 }
11441
11442 extern int do_munmap(struct mm_struct *, unsigned long, size_t);
11443
11444 extern unsigned long do_brk(unsigned long, unsigned long);
11445
11446
11447 extern unsigned long page_unuse(struct page *);
11448 extern void truncate_inode_pages(struct address_space *, loff_t);
11449 extern void truncate_inode_pages_range(struct address_space *,
11450 loff_t lstart, loff_t lend);
11451
11452
11453 extern struct page *filemap_nopage(struct vm_area_struct *, unsigned long, int *);
11454 extern int filemap_populate(struct vm_area_struct *, unsigned long,
11455 unsigned long, pgprot_t, unsigned long, int);
11456
11457
11458 int write_one_page(struct page *page, int wait);
11459
11460
11461
11462
11463
11464
11465
11466 int do_page_cache_readahead(struct address_space *mapping, struct file *filp,
11467 unsigned long offset, unsigned long nr_to_read);
11468 int force_page_cache_readahead(struct address_space *mapping, struct file *filp,
11469 unsigned long offset, unsigned long nr_to_read);
11470 unsigned long page_cache_readahead(struct address_space *mapping,
11471 struct file_ra_state *ra,
11472 struct file *filp,
11473 unsigned long offset,
11474 unsigned long size);
11475 void handle_ra_miss(struct address_space *mapping,
11476 struct file_ra_state *ra, unsigned long offset);
11477 unsigned long max_sane_readahead(unsigned long nr);
11478
11479
11480 extern int expand_stack(struct vm_area_struct *vma, unsigned long address);
11481
11482
11483
11484
11485
11486 extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr);
11487 extern struct vm_area_struct * find_vma_prev(struct mm_struct * mm, unsigned long addr,
11488 struct vm_area_struct **pprev);
11489
11490
11491
11492 static inline __attribute__((always_inline)) struct vm_area_struct * find_vma_intersection(struct mm_struct * mm, unsigned long start_addr, unsigned long end_addr)
11493 {
11494 struct vm_area_struct * vma = find_vma(mm,start_addr);
11495
11496 if (vma && end_addr <= vma->vm_start)
11497 vma = ((void *)0);
11498 return vma;
11499 }
11500
11501 static inline __attribute__((always_inline)) unsigned long vma_pages(struct vm_area_struct *vma)
11502 {
11503 return (vma->vm_end - vma->vm_start) >> 12;
11504 }
11505
11506 pgprot_t vm_get_page_prot(unsigned long vm_flags);
11507 struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr);
11508 struct page *vmalloc_to_page(void *addr);
11509 unsigned long vmalloc_to_pfn(void *addr);
11510 int remap_pfn_range(struct vm_area_struct *, unsigned long addr,
11511 unsigned long pfn, unsigned long size, pgprot_t);
11512 int vm_insert_page(struct vm_area_struct *, unsigned long addr, struct page *);
11513 int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr,
11514 unsigned long pfn);
11515
11516 struct page *follow_page(struct vm_area_struct *, unsigned long address,
11517 unsigned int foll_flags);
11518
11519
11520
11521
11522
11523
11524 void vm_stat_account(struct mm_struct *, unsigned long, struct file *, long);
11525 # 1145 "include/linux/mm.h"
11526 static inline __attribute__((always_inline)) void
11527 kernel_map_pages(struct page *page, int numpages, int enable) {}
11528
11529
11530 extern struct vm_area_struct *get_gate_vma(struct task_struct *tsk);
11531
11532
11533
11534
11535 int in_gate_area_no_task(unsigned long addr);
11536
11537
11538
11539 int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *,
11540 void *, size_t *, loff_t *);
11541 unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask,
11542 unsigned long lru_pages);
11543 void drop_pagecache(void);
11544 void drop_slab(void);
11545
11546
11547
11548
11549
11550
11551
11552 __attribute__((weak)) const char *arch_vma_name(struct vm_area_struct *vma);
11553 # 14 "include/asm/uaccess.h" 2
11554 # 24 "include/asm/uaccess.h"
11555 static inline __attribute__((always_inline)) void set_fs(mm_segment_t fs)
11556 {
11557 current_thread_info()->addr_limit = fs;
11558 }
11559 # 36 "include/asm/uaccess.h"
11560 static inline __attribute__((always_inline)) int is_in_rom(unsigned long addr)
11561 {
11562 # 46 "include/asm/uaccess.h"
11563 if ((addr < _ramstart) || (addr >= _ramend))
11564 return (1);
11565
11566
11567 return (0);
11568 }
11569 # 63 "include/asm/uaccess.h"
11570 extern int _access_ok(unsigned long addr, unsigned long size)__attribute__((l1_text));
11571 # 82 "include/asm/uaccess.h"
11572 struct exception_table_entry {
11573 unsigned long insn, fixup;
11574 };
11575
11576
11577 extern unsigned long search_exception_table(unsigned long);
11578 # 129 "include/asm/uaccess.h"
11579 static inline __attribute__((always_inline)) int bad_user_access_length(void)
11580 {
11581 panic("bad_user_access_length");
11582 return -1;
11583 }
11584 # 212 "include/asm/uaccess.h"
11585 static inline __attribute__((always_inline)) long copy_from_user(void *to,
11586 const void * from, unsigned long n)
11587 {
11588 if (_access_ok((unsigned long)(from),(n)))
11589 memcpy(to, from, n);
11590 else
11591 return n;
11592 return 0;
11593 }
11594
11595 static inline __attribute__((always_inline)) long copy_to_user(void *to,
11596 const void * from, unsigned long n)
11597 {
11598 if (_access_ok((unsigned long)(to),(n)))
11599 memcpy(to, from, n);
11600 else
11601 return n;
11602 return 0;
11603 }
11604
11605
11606
11607
11608
11609 static inline __attribute__((always_inline)) long strncpy_from_user(char *dst,
11610 const char *src, long count)
11611 {
11612 char *tmp;
11613 if (!_access_ok((unsigned long)(src),(1)))
11614 return -14;
11615 strncpy(dst, src, count);
11616 for (tmp = dst; *tmp && count > 0; tmp++, count--) ;
11617 return (tmp - dst);
11618 }
11619
11620
11621
11622
11623
11624
11625 static inline __attribute__((always_inline)) long strnlen_user(const char *src, long n)
11626 {
11627 return (strlen(src) + 1);
11628 }
11629
11630
11631
11632
11633
11634
11635
11636 static inline __attribute__((always_inline)) unsigned long clear_user(void *to, unsigned long n)
11637 {
11638 memset(to, 0, n);
11639 return 0;
11640 }
11641 # 2 "fs/foo.c" 2
11642
11643 ssize_t sys_sendfile(int out_fd, int in_fd, off_t *offset, size_t count)
11644 {
11645 loff_t pos;
11646 off_t off;
11647 ssize_t ret;
11648
11649 if (offset) {
11650 if (__builtin_expect(!!(({ int _err = 0; typeof(*(offset)) *_p = (offset); if (!_access_ok((unsigned long)(_p),(sizeof(*(_p))))) { _err = -14; } else { switch (sizeof(*(_p))) { case 1: { unsigned long _tmp; __asm__ ("%0 =" "B" "[%1]""(Z)"";\n\t" : "=d" (_tmp) : "a" (((unsigned long *)(_p)))); (off) = (__typeof__(*(_p))) _tmp; }; break; case 2: { unsigned long _tmp; __asm__ ("%0 =" "W" "[%1]""(Z)"";\n\t" : "=d" (_tmp) : "a" (((unsigned long *)(_p)))); (off) = (__typeof__(*(_p))) _tmp; }; break; case 4: { unsigned long _tmp; __asm__ ("%0 =" "" "[%1]"""";\n\t" : "=d" (_tmp) : "a" (((unsigned long *)(_p)))); (off) = (__typeof__(*(_p))) _tmp; }; break; case 8: { unsigned long _xl, _xh; { unsigned long _tmp; __asm__ ("%0 =" "" "[%1]"""";\n\t" : "=d" (_tmp) : "a" (((unsigned long *)(((unsigned long *)_p)+0)))); (_xl) = (__typeof__(*(((unsigned long *)_p)+0))) _tmp; }; { unsigned long _tmp; __asm__ ("%0 =" "" "[%1]"""";\n\t" : "=d" (_tmp) : "a" (((unsigned long *)(((unsigned long *)_p)+1)))); (_xh) = (__typeof__(*(((unsigned long *)_p)+1))) _tmp; }; ((unsigned long *)&off)[0] = _xl; ((unsigned long *)&off)[1] = _xh; } break; default: off = 0; printk("<6>" "get_user_bad: %s:%d %s\n", "fs/foo.c", 10, (__func__)); _err = (bad_user_access_length(), (-14)); break; } } _err; })), 0))
11651 return -14;
11652 pos = off;
11653 ret = -1;
11654 if (__builtin_expect(!!(({ int _err = 0; typeof(*(offset)) _x = (pos); typeof(*(offset)) *_p = (offset); if (!_access_ok((unsigned long)(_p),(sizeof(*(_p))))) { _err = -14; } else { switch (sizeof (*(_p))) { case 1: __asm__ ("B""[%1] = %0;\n\t" : :"d" (_x),"a" (((unsigned long *)(_p))) : "memory"); break; case 2: __asm__ ("W""[%1] = %0;\n\t" : :"d" (_x),"a" (((unsigned long *)(_p))) : "memory"); break; case 4: __asm__ ("""[%1] = %0;\n\t" : :"d" (_x),"a" (((unsigned long *)(_p))) : "memory"); break; case 8: { long _xl, _xh; _xl = ((long *)&_x)[0]; _xh = ((long *)&_x)[1]; __asm__ ("""[%1] = %0;\n\t" : :"d" (_xl),"a" (((unsigned long *)(((long *)_p)+0))) : "memory"); __asm__ ("""[%1] = %0;\n\t" : :"d" (_xh),"a" (((unsigned long *)(((long *)_p)+1))) : "memory"); } break; default: _err = (printk("<6>" "put_user_bad %s:%d %s\n", "fs/foo.c", 14, (__func__)), bad_user_access_length(), (-14)); break; } } _err; })), 0))
11655 return -14;
11656 return ret;
11657 }
11658
11659 return -1;
11660 }