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