initial import
[ICEs.git] / bfin-rets-insn / initramfs.i.0
1 # 1 "init/initramfs.c"
2 # 1 "<built-in>"
3 # 1 "<command line>"
4 # 1 "./include/linux/autoconf.h" 1
5 # 1 "<command line>" 2
6 # 1 "init/initramfs.c"
7 # 1 "include/linux/init.h" 1
8
9
10
11 # 1 "include/linux/compiler.h" 1
12 # 40 "include/linux/compiler.h"
13 # 1 "include/linux/compiler-gcc4.h" 1
14
15
16
17 # 1 "include/linux/compiler-gcc.h" 1
18 # 5 "include/linux/compiler-gcc4.h" 2
19 # 41 "include/linux/compiler.h" 2
20 # 5 "include/linux/init.h" 2
21 # 76 "include/linux/init.h"
22 typedef int (*initcall_t)(void);
23 typedef void (*exitcall_t)(void);
24
25 extern initcall_t __con_initcall_start[], __con_initcall_end[];
26 extern initcall_t __security_initcall_start[], __security_initcall_end[];
27
28
29 extern char __attribute__ ((__section__ (".init.data"))) boot_command_line[];
30 extern char *saved_command_line;
31 extern unsigned int reset_devices;
32
33
34 void setup_arch(char **);
35 void prepare_namespace(void);
36 # 148 "include/linux/init.h"
37 struct obs_kernel_param {
38 const char *str;
39 int (*setup_func)(char *);
40 int early;
41 };
42 # 183 "include/linux/init.h"
43 void __attribute__ ((__section__ (".init.text"))) parse_early_param(void);
44 # 2 "init/initramfs.c" 2
45 # 1 "include/linux/fs.h" 1
46 # 9 "include/linux/fs.h"
47 # 1 "include/linux/limits.h" 1
48 # 10 "include/linux/fs.h" 2
49 # 1 "include/linux/ioctl.h" 1
50
51
52
53 # 1 "include/asm/ioctl.h" 1
54 # 1 "include/asm-generic/ioctl.h" 1
55 # 51 "include/asm-generic/ioctl.h"
56 extern unsigned int __invalid_size_argument_for_IOC;
57 # 1 "include/asm/ioctl.h" 2
58 # 5 "include/linux/ioctl.h" 2
59 # 11 "include/linux/fs.h" 2
60 # 36 "include/linux/fs.h"
61 struct files_stat_struct {
62 int nr_files;
63 int nr_free_files;
64 int max_files;
65 };
66 extern struct files_stat_struct files_stat;
67 extern int get_max_files(void);
68
69 struct inodes_stat_t {
70 int nr_inodes;
71 int nr_unused;
72 int dummy[5];
73 };
74 extern struct inodes_stat_t inodes_stat;
75
76 extern int leases_enable, lease_break_time;
77 # 271 "include/linux/fs.h"
78 # 1 "include/linux/linkage.h" 1
79
80
81
82 # 1 "include/asm/linkage.h" 1
83 # 5 "include/linux/linkage.h" 2
84 # 272 "include/linux/fs.h" 2
85 # 1 "include/linux/wait.h" 1
86 # 22 "include/linux/wait.h"
87 # 1 "include/linux/list.h" 1
88
89
90
91
92
93 # 1 "include/linux/stddef.h" 1
94 # 15 "include/linux/stddef.h"
95 enum {
96 false = 0,
97 true = 1
98 };
99 # 7 "include/linux/list.h" 2
100 # 1 "include/linux/poison.h" 1
101 # 8 "include/linux/list.h" 2
102 # 1 "include/linux/prefetch.h" 1
103 # 13 "include/linux/prefetch.h"
104 # 1 "include/linux/types.h" 1
105 # 14 "include/linux/types.h"
106 # 1 "include/linux/posix_types.h" 1
107 # 36 "include/linux/posix_types.h"
108 typedef struct {
109 unsigned long fds_bits [(1024/(8 * sizeof(unsigned long)))];
110 } __kernel_fd_set;
111
112
113 typedef void (*__kernel_sighandler_t)(int);
114
115
116 typedef int __kernel_key_t;
117 typedef int __kernel_mqd_t;
118
119 # 1 "include/asm/posix_types.h" 1
120 # 10 "include/asm/posix_types.h"
121 typedef unsigned long __kernel_ino_t;
122 typedef unsigned short __kernel_mode_t;
123 typedef unsigned short __kernel_nlink_t;
124 typedef long __kernel_off_t;
125 typedef int __kernel_pid_t;
126 typedef unsigned int __kernel_ipc_pid_t;
127 typedef unsigned int __kernel_uid_t;
128 typedef unsigned int __kernel_gid_t;
129 typedef unsigned long __kernel_size_t;
130 typedef long __kernel_ssize_t;
131 typedef int __kernel_ptrdiff_t;
132 typedef long __kernel_time_t;
133 typedef long __kernel_suseconds_t;
134 typedef long __kernel_clock_t;
135 typedef int __kernel_timer_t;
136 typedef int __kernel_clockid_t;
137 typedef int __kernel_daddr_t;
138 typedef char *__kernel_caddr_t;
139 typedef unsigned short __kernel_uid16_t;
140 typedef unsigned short __kernel_gid16_t;
141 typedef unsigned int __kernel_uid32_t;
142 typedef unsigned int __kernel_gid32_t;
143
144 typedef unsigned short __kernel_old_uid_t;
145 typedef unsigned short __kernel_old_gid_t;
146 typedef unsigned short __kernel_old_dev_t;
147
148
149 typedef long long __kernel_loff_t;
150
151
152 typedef struct {
153
154 int val[2];
155
156
157
158 } __kernel_fsid_t;
159 # 48 "include/linux/posix_types.h" 2
160 # 15 "include/linux/types.h" 2
161 # 1 "include/asm/types.h" 1
162 # 13 "include/asm/types.h"
163 typedef unsigned short umode_t;
164
165
166
167
168
169
170 typedef __signed__ char __s8;
171 typedef unsigned char __u8;
172
173 typedef __signed__ short __s16;
174 typedef unsigned short __u16;
175
176 typedef __signed__ int __s32;
177 typedef unsigned int __u32;
178
179
180
181 typedef __signed__ long long __s64;
182 typedef unsigned long long __u64;
183 # 45 "include/asm/types.h"
184 typedef signed char s8;
185 typedef unsigned char u8;
186
187 typedef signed short s16;
188 typedef unsigned short u16;
189
190 typedef signed int s32;
191 typedef unsigned int u32;
192
193 typedef signed long long s64;
194 typedef unsigned long long u64;
195
196
197
198 typedef u32 dma_addr_t;
199 typedef u64 dma64_addr_t;
200 # 16 "include/linux/types.h" 2
201
202
203
204 typedef __u32 __kernel_dev_t;
205
206 typedef __kernel_fd_set fd_set;
207 typedef __kernel_dev_t dev_t;
208 typedef __kernel_ino_t ino_t;
209 typedef __kernel_mode_t mode_t;
210 typedef __kernel_nlink_t nlink_t;
211 typedef __kernel_off_t off_t;
212 typedef __kernel_pid_t pid_t;
213 typedef __kernel_daddr_t daddr_t;
214 typedef __kernel_key_t key_t;
215 typedef __kernel_suseconds_t suseconds_t;
216 typedef __kernel_timer_t timer_t;
217 typedef __kernel_clockid_t clockid_t;
218 typedef __kernel_mqd_t mqd_t;
219
220
221 typedef _Bool bool;
222
223 typedef __kernel_uid32_t uid_t;
224 typedef __kernel_gid32_t gid_t;
225 typedef __kernel_uid16_t uid16_t;
226 typedef __kernel_gid16_t gid16_t;
227
228
229
230 typedef __kernel_old_uid_t old_uid_t;
231 typedef __kernel_old_gid_t old_gid_t;
232 # 58 "include/linux/types.h"
233 typedef __kernel_loff_t loff_t;
234 # 67 "include/linux/types.h"
235 typedef __kernel_size_t size_t;
236
237
238
239
240 typedef __kernel_ssize_t ssize_t;
241
242
243
244
245 typedef __kernel_ptrdiff_t ptrdiff_t;
246
247
248
249
250 typedef __kernel_time_t time_t;
251
252
253
254
255 typedef __kernel_clock_t clock_t;
256
257
258
259
260 typedef __kernel_caddr_t caddr_t;
261
262
263
264 typedef unsigned char u_char;
265 typedef unsigned short u_short;
266 typedef unsigned int u_int;
267 typedef unsigned long u_long;
268
269
270 typedef unsigned char unchar;
271 typedef unsigned short ushort;
272 typedef unsigned int uint;
273 typedef unsigned long ulong;
274
275
276
277
278 typedef __u8 u_int8_t;
279 typedef __s8 int8_t;
280 typedef __u16 u_int16_t;
281 typedef __s16 int16_t;
282 typedef __u32 u_int32_t;
283 typedef __s32 int32_t;
284
285
286
287 typedef __u8 uint8_t;
288 typedef __u16 uint16_t;
289 typedef __u32 uint32_t;
290
291
292 typedef __u64 uint64_t;
293 typedef __u64 u_int64_t;
294 typedef __s64 int64_t;
295 # 143 "include/linux/types.h"
296 typedef unsigned long sector_t;
297 # 152 "include/linux/types.h"
298 typedef unsigned long blkcnt_t;
299 # 181 "include/linux/types.h"
300 typedef __u16 __le16;
301 typedef __u16 __be16;
302 typedef __u32 __le32;
303 typedef __u32 __be32;
304
305 typedef __u64 __le64;
306 typedef __u64 __be64;
307
308 typedef __u16 __sum16;
309 typedef __u32 __wsum;
310
311
312 typedef unsigned gfp_t;
313
314
315
316
317 typedef u32 resource_size_t;
318
319
320
321
322 struct ustat {
323 __kernel_daddr_t f_tfree;
324 __kernel_ino_t f_tinode;
325 char f_fname[6];
326 char f_fpack[6];
327 };
328 # 14 "include/linux/prefetch.h" 2
329 # 1 "include/asm/processor.h" 1
330 # 10 "include/asm/processor.h"
331 # 1 "include/asm/blackfin.h" 1
332 # 14 "include/asm/blackfin.h"
333 # 1 "include/asm/mach/anomaly.h" 1
334 # 15 "include/asm/blackfin.h" 2
335
336
337
338
339 static inline __attribute__((always_inline)) void SSYNC(void)
340 {
341 int _tmp;
342 if ((1))
343 __asm__ __volatile__(
344 "cli %0;"
345 "nop;"
346 "nop;"
347 "ssync;"
348 "sti %0;"
349 : "=d" (_tmp)
350 );
351 else if ((0x0002 < 3))
352 __asm__ __volatile__(
353 "nop;"
354 "nop;"
355 "nop;"
356 "ssync;"
357 );
358 else
359 __asm__ __volatile__("ssync;");
360 }
361
362
363 static inline __attribute__((always_inline)) void CSYNC(void)
364 {
365 int _tmp;
366 if ((1))
367 __asm__ __volatile__(
368 "cli %0;"
369 "nop;"
370 "nop;"
371 "csync;"
372 "sti %0;"
373 : "=d" (_tmp)
374 );
375 else if ((0x0002 < 3))
376 __asm__ __volatile__(
377 "nop;"
378 "nop;"
379 "nop;"
380 "csync;"
381 );
382 else
383 __asm__ __volatile__("csync;");
384 }
385 # 89 "include/asm/blackfin.h"
386 # 1 "include/asm/mach/blackfin.h" 1
387 # 37 "include/asm/mach/blackfin.h"
388 # 1 "include/asm/mach/bf537.h" 1
389 # 38 "include/asm/mach/blackfin.h" 2
390 # 1 "include/asm/mach/mem_map.h" 1
391 # 39 "include/asm/mach/blackfin.h" 2
392 # 1 "include/asm/mach/defBF534.h" 1
393 # 35 "include/asm/mach/defBF534.h"
394 # 1 "include/asm/mach-common/def_LPBlackfin.h" 1
395 # 36 "include/asm/mach/defBF534.h" 2
396 # 40 "include/asm/mach/blackfin.h" 2
397 # 1 "include/asm/mach/anomaly.h" 1
398 # 41 "include/asm/mach/blackfin.h" 2
399
400
401 # 1 "include/asm/mach/defBF537.h" 1
402 # 36 "include/asm/mach/defBF537.h"
403 # 1 "include/asm/mach-common/cdef_LPBlackfin.h" 1
404 # 37 "include/asm/mach/defBF537.h" 2
405 # 44 "include/asm/mach/blackfin.h" 2
406
407
408
409 # 1 "include/asm/mach/cdefBF534.h" 1
410 # 35 "include/asm/mach/cdefBF534.h"
411 # 1 "include/asm/blackfin.h" 1
412 # 36 "include/asm/mach/cdefBF534.h" 2
413
414
415
416
417
418
419
420 # 1 "include/asm/system.h" 1
421 # 45 "include/asm/system.h"
422 extern unsigned long irq_flags;
423 # 151 "include/asm/system.h"
424 struct __xchg_dummy {
425 unsigned long a[100];
426 };
427
428
429 static inline __attribute__((always_inline)) unsigned long __xchg(unsigned long x, volatile void *ptr,
430 int size)
431 {
432 unsigned long tmp = 0;
433 unsigned long flags = 0;
434
435 __asm__ __volatile__( "cli %0;" : "=&d" (flags) );
436
437 switch (size) {
438 case 1:
439 __asm__ __volatile__
440 ("%0 = b%2 (z);\n\t"
441 "b%2 = %1;\n\t"
442 : "=&d" (tmp) : "d" (x), "m" (*((volatile struct __xchg_dummy *)(ptr))) : "memory");
443 break;
444 case 2:
445 __asm__ __volatile__
446 ("%0 = w%2 (z);\n\t"
447 "w%2 = %1;\n\t"
448 : "=&d" (tmp) : "d" (x), "m" (*((volatile struct __xchg_dummy *)(ptr))) : "memory");
449 break;
450 case 4:
451 __asm__ __volatile__
452 ("%0 = %2;\n\t"
453 "%2 = %1;\n\t"
454 : "=&d" (tmp) : "d" (x), "m" (*((volatile struct __xchg_dummy *)(ptr))) : "memory");
455 break;
456 }
457 do { if (((flags) != 0x1f)) __asm__ __volatile__( "sti %0;" : : "d" (irq_flags) ); } while (0);
458 return tmp;
459 }
460
461
462
463
464
465
466 static inline __attribute__((always_inline)) unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
467 unsigned long new, int size)
468 {
469 unsigned long tmp = 0;
470 unsigned long flags = 0;
471
472 __asm__ __volatile__( "cli %0;" : "=&d" (flags) );
473
474 switch (size) {
475 case 1:
476 __asm__ __volatile__
477 ("%0 = b%3 (z);\n\t"
478 "CC = %1 == %0;\n\t"
479 "IF !CC JUMP 1f;\n\t"
480 "b%3 = %2;\n\t"
481 "1:\n\t"
482 : "=&d" (tmp) : "d" (old), "d" (new), "m" (*((volatile struct __xchg_dummy *)(ptr))) : "memory");
483 break;
484 case 2:
485 __asm__ __volatile__
486 ("%0 = w%3 (z);\n\t"
487 "CC = %1 == %0;\n\t"
488 "IF !CC JUMP 1f;\n\t"
489 "w%3 = %2;\n\t"
490 "1:\n\t"
491 : "=&d" (tmp) : "d" (old), "d" (new), "m" (*((volatile struct __xchg_dummy *)(ptr))) : "memory");
492 break;
493 case 4:
494 __asm__ __volatile__
495 ("%0 = %3;\n\t"
496 "CC = %1 == %0;\n\t"
497 "IF !CC JUMP 1f;\n\t"
498 "%3 = %2;\n\t"
499 "1:\n\t"
500 : "=&d" (tmp) : "d" (old), "d" (new), "m" (*((volatile struct __xchg_dummy *)(ptr))) : "memory");
501 break;
502 }
503 do { if (((flags) != 0x1f)) __asm__ __volatile__( "sti %0;" : : "d" (irq_flags) ); } while (0);
504 return tmp;
505 }
506 # 247 "include/asm/system.h"
507 struct task_struct *resume(struct task_struct *prev, struct task_struct *next);
508 # 44 "include/asm/mach/cdefBF534.h" 2
509 # 52 "include/asm/mach/cdefBF534.h"
510 static __inline__ __attribute__((always_inline)) void bfin_write_VR_CTL(unsigned int val)
511 {
512 unsigned long flags, iwr;
513
514
515 iwr = ({ uint32_t __v; __asm__ __volatile__( "%0 = [%1];" : "=d" (__v) : "a" (0xFFC00124) ); __v; });
516
517 __asm__ __volatile__( "[%0] = %1;" : : "a" (0xFFC00124), "d" ((1 << ((0)&0x1F))) : "memory" );
518
519 __asm__ __volatile__( "w[%0] = %1;" : : "a" (0xFFC00008), "d" ((uint16_t)(val)) : "memory" );
520 SSYNC();
521
522 __asm__ __volatile__( "cli %0;" : "=&d" (flags) );
523 asm("IDLE;");
524 do { if (((flags) != 0x1f)) __asm__ __volatile__( "sti %0;" : : "d" (irq_flags) ); } while (0);
525 __asm__ __volatile__( "[%0] = %1;" : : "a" (0xFFC00124), "d" (iwr) : "memory" );
526 }
527 # 48 "include/asm/mach/blackfin.h" 2
528 # 74 "include/asm/mach/blackfin.h"
529 # 1 "include/asm/mach/cdefBF537.h" 1
530 # 75 "include/asm/mach/blackfin.h" 2
531 # 90 "include/asm/blackfin.h" 2
532 # 1 "include/asm/bfin-global.h" 1
533 # 34 "include/asm/bfin-global.h"
534 # 1 "include/asm-generic/sections.h" 1
535
536
537
538
539
540 extern char _text[], _stext[], _etext[];
541 extern char _data[], _sdata[], _edata[];
542 extern char __bss_start[], __bss_stop[];
543 extern char __init_begin[], __init_end[];
544 extern char _sinittext[], _einittext[];
545 extern char _end[];
546 extern char __per_cpu_start[], __per_cpu_end[];
547 extern char __kprobes_text_start[], __kprobes_text_end[];
548 extern char __initdata_begin[], __initdata_end[];
549 extern char __start_rodata[], __end_rodata[];
550 # 35 "include/asm/bfin-global.h" 2
551 # 1 "include/asm/ptrace.h" 1
552 # 24 "include/asm/ptrace.h"
553 struct pt_regs {
554 long orig_pc;
555 long ipend;
556 long seqstat;
557 long rete;
558 long retn;
559 long retx;
560 long pc;
561 long rets;
562 long reserved;
563 long astat;
564 long lb1;
565 long lb0;
566 long lt1;
567 long lt0;
568 long lc1;
569 long lc0;
570 long a1w;
571 long a1x;
572 long a0w;
573 long a0x;
574 long b3;
575 long b2;
576 long b1;
577 long b0;
578 long l3;
579 long l2;
580 long l1;
581 long l0;
582 long m3;
583 long m2;
584 long m1;
585 long m0;
586 long i3;
587 long i2;
588 long i1;
589 long i0;
590 long usp;
591 long fp;
592 long p5;
593 long p4;
594 long p3;
595 long p2;
596 long p1;
597 long p0;
598 long r7;
599 long r6;
600 long r5;
601 long r4;
602 long r3;
603 long r2;
604 long r1;
605 long r0;
606 long orig_r0;
607 long orig_p0;
608 long syscfg;
609 };
610 # 99 "include/asm/ptrace.h"
611 extern void show_regs(struct pt_regs *);
612 # 36 "include/asm/bfin-global.h" 2
613 # 1 "include/asm/user.h" 1
614 # 36 "include/asm/user.h"
615 struct user_bfinfp_struct {
616 };
617
618
619
620
621 struct user_regs_struct {
622 long r0, r1, r2, r3, r4, r5, r6, r7;
623 long p0, p1, p2, p3, p4, p5, usp, fp;
624 long i0, i1, i2, i3;
625 long l0, l1, l2, l3;
626 long b0, b1, b2, b3;
627 long m0, m1, m2, m3;
628 long a0w, a1w;
629 long a0x, a1x;
630 unsigned long rets;
631 unsigned long astat;
632 unsigned long pc;
633 unsigned long orig_p0;
634 };
635
636
637
638
639
640 struct user {
641
642
643
644 struct user_regs_struct regs;
645
646
647 unsigned long int u_tsize;
648 unsigned long int u_dsize;
649 unsigned long int u_ssize;
650 unsigned long start_code;
651 unsigned long start_stack;
652
653
654
655 long int signal;
656 int reserved;
657 struct user_regs_struct *u_ar0;
658
659
660 unsigned long magic;
661 char u_comm[32];
662 };
663 # 37 "include/asm/bfin-global.h" 2
664 # 48 "include/asm/bfin-global.h"
665 extern unsigned long get_cclk(void);
666 extern unsigned long get_sclk(void);
667 extern unsigned long sclk_to_usecs(unsigned long sclk);
668 extern unsigned long usecs_to_sclk(unsigned long usecs);
669
670 extern void dump_bfin_process(struct pt_regs *regs);
671 extern void dump_bfin_mem(struct pt_regs *regs);
672 extern void dump_bfin_trace_buffer(void);
673
674 extern int init_arch_irq(void);
675 extern void bfin_reset(void);
676 extern void _cplb_hdr(void);
677
678 extern void bfin_icache_init(void);
679 extern void bfin_dcache_init(void);
680 extern int read_iloc(void);
681 extern int bfin_console_init(void);
682 extern void lower_to_irq14(void);
683 extern void bfin_return_from_exception(void);
684 extern void init_exception_vectors(void);
685 extern void init_dma(void);
686 extern void program_IAR(void);
687 extern void evt14_softirq(void);
688 extern void asm_do_IRQ(unsigned int irq, struct pt_regs *regs);
689 extern void bfin_gpio_interrupt_setup(int irq, int irq_pfx, int type);
690
691 extern void finish_atomic_sections (struct pt_regs *regs);
692 extern char fixed_code_start;
693 extern char fixed_code_end;
694 extern int atomic_xchg32(void);
695 extern int atomic_cas32(void);
696 extern int atomic_add32(void);
697 extern int atomic_sub32(void);
698 extern int atomic_ior32(void);
699 extern int atomic_and32(void);
700 extern int atomic_xor32(void);
701 extern void safe_user_instruction(void);
702 extern void sigreturn_stub(void);
703
704 extern void *l1_data_A_sram_alloc(size_t);
705 extern void *l1_data_B_sram_alloc(size_t);
706 extern void *l1_inst_sram_alloc(size_t);
707 extern void *l1_data_sram_alloc(size_t);
708 extern void *l1_data_sram_zalloc(size_t);
709 extern int l1_data_A_sram_free(const void*);
710 extern int l1_data_B_sram_free(const void*);
711 extern int l1_inst_sram_free(const void*);
712 extern int l1_data_sram_free(const void*);
713 extern int sram_free(const void*);
714
715
716
717
718
719 extern void *sram_alloc_with_lsl(size_t, unsigned long);
720 extern int sram_free_with_lsl(const void*);
721
722 extern void led_on(int);
723 extern void led_off(int);
724 extern void led_toggle(int);
725 extern void led_disp_num(int);
726 extern void led_toggle_num(int);
727 extern void init_leds(void);
728
729 extern const char bfin_board_name[];
730 extern unsigned long wall_jiffies;
731 extern unsigned long ipdt_table[];
732 extern unsigned long dpdt_table[];
733 extern unsigned long icplb_table[];
734 extern unsigned long dcplb_table[];
735
736 extern unsigned long ipdt_swapcount_table[];
737 extern unsigned long dpdt_swapcount_table[];
738
739 extern unsigned long table_start, table_end;
740
741 extern u16 _bfin_swrst;
742 extern struct file_operations dpmc_fops;
743 extern char _start;
744 extern unsigned long _ramstart, _ramend, _rambase;
745 extern unsigned long memory_start, memory_end, physical_mem_end;
746 extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[],
747 _ebss_l1[], _l1_lma_start[], _sdata_b_l1[], _ebss_b_l1[];
748 # 91 "include/asm/blackfin.h" 2
749 # 11 "include/asm/processor.h" 2
750 # 1 "include/asm/segment.h" 1
751 # 12 "include/asm/processor.h" 2
752
753
754 static inline __attribute__((always_inline)) unsigned long rdusp(void)
755 {
756 unsigned long usp;
757
758 __asm__ __volatile__("%0 = usp;\n\t":"=da"(usp));
759 return usp;
760 }
761
762 static inline __attribute__((always_inline)) void wrusp(unsigned long usp)
763 {
764 __asm__ __volatile__("usp = %0;\n\t"::"da"(usp));
765 }
766
767
768
769
770 extern unsigned long memory_end;
771
772
773
774
775 struct thread_struct {
776 unsigned long ksp;
777 unsigned long usp;
778 unsigned short seqstat;
779 unsigned long esp0;
780 unsigned long pc;
781 void * debuggerinfo;
782 };
783 # 70 "include/asm/processor.h"
784 struct task_struct;
785
786
787 static inline __attribute__((always_inline)) void release_thread(struct task_struct *dead_task)
788 {
789 }
790
791
792
793 extern int kernel_thread(int (*fn) (void *), void *arg, unsigned long flags);
794
795
796
797
798 static inline __attribute__((always_inline)) void exit_thread(void)
799 {
800 }
801
802
803
804
805
806
807 unsigned long get_wchan(struct task_struct *p);
808 # 107 "include/asm/processor.h"
809 static inline __attribute__((always_inline)) __attribute__((pure)) uint32_t bfin_revid(void)
810 {
811
812 return ({ uint32_t __v; __asm__ __volatile__( "%0 = [%1];" : "=d" (__v) : "a" (0xFFC00014) ); __v; }) >> 28;
813 }
814
815 static inline __attribute__((always_inline)) __attribute__((pure)) uint32_t bfin_compiled_revid(void)
816 {
817
818
819
820
821
822 return 2;
823 # 132 "include/asm/processor.h"
824 }
825 # 15 "include/linux/prefetch.h" 2
826 # 1 "include/asm/cache.h" 1
827 # 16 "include/linux/prefetch.h" 2
828 # 43 "include/linux/prefetch.h"
829 static inline __attribute__((always_inline)) void prefetch(const void *x) {;}
830
831
832
833 static inline __attribute__((always_inline)) void prefetchw(const void *x) {;}
834 # 58 "include/linux/prefetch.h"
835 static inline __attribute__((always_inline)) void prefetch_range(void *addr, size_t len)
836 {
837
838
839
840
841
842
843
844 }
845 # 9 "include/linux/list.h" 2
846 # 21 "include/linux/list.h"
847 struct list_head {
848 struct list_head *next, *prev;
849 };
850
851
852
853
854
855
856 static inline __attribute__((always_inline)) void INIT_LIST_HEAD(struct list_head *list)
857 {
858 list->next = list;
859 list->prev = list;
860 }
861 # 43 "include/linux/list.h"
862 static inline __attribute__((always_inline)) void __list_add(struct list_head *new,
863 struct list_head *prev,
864 struct list_head *next)
865 {
866 next->prev = new;
867 new->next = next;
868 new->prev = prev;
869 prev->next = new;
870 }
871 # 67 "include/linux/list.h"
872 static inline __attribute__((always_inline)) void list_add(struct list_head *new, struct list_head *head)
873 {
874 __list_add(new, head, head->next);
875 }
876 # 84 "include/linux/list.h"
877 static inline __attribute__((always_inline)) void list_add_tail(struct list_head *new, struct list_head *head)
878 {
879 __list_add(new, head->prev, head);
880 }
881
882
883
884
885
886
887
888 static inline __attribute__((always_inline)) void __list_add_rcu(struct list_head * new,
889 struct list_head * prev, struct list_head * next)
890 {
891 new->next = next;
892 new->prev = prev;
893 __asm__ __volatile__("": : :"memory");
894 next->prev = new;
895 prev->next = new;
896 }
897 # 121 "include/linux/list.h"
898 static inline __attribute__((always_inline)) void list_add_rcu(struct list_head *new, struct list_head *head)
899 {
900 __list_add_rcu(new, head, head->next);
901 }
902 # 142 "include/linux/list.h"
903 static inline __attribute__((always_inline)) void list_add_tail_rcu(struct list_head *new,
904 struct list_head *head)
905 {
906 __list_add_rcu(new, head->prev, head);
907 }
908 # 155 "include/linux/list.h"
909 static inline __attribute__((always_inline)) void __list_del(struct list_head * prev, struct list_head * next)
910 {
911 next->prev = prev;
912 prev->next = next;
913 }
914 # 168 "include/linux/list.h"
915 static inline __attribute__((always_inline)) void list_del(struct list_head *entry)
916 {
917 __list_del(entry->prev, entry->next);
918 entry->next = ((void *) 0x00100100);
919 entry->prev = ((void *) 0x00200200);
920 }
921 # 202 "include/linux/list.h"
922 static inline __attribute__((always_inline)) void list_del_rcu(struct list_head *entry)
923 {
924 __list_del(entry->prev, entry->next);
925 entry->prev = ((void *) 0x00200200);
926 }
927 # 215 "include/linux/list.h"
928 static inline __attribute__((always_inline)) void list_replace(struct list_head *old,
929 struct list_head *new)
930 {
931 new->next = old->next;
932 new->next->prev = new;
933 new->prev = old->prev;
934 new->prev->next = new;
935 }
936
937 static inline __attribute__((always_inline)) void list_replace_init(struct list_head *old,
938 struct list_head *new)
939 {
940 list_replace(old, new);
941 INIT_LIST_HEAD(old);
942 }
943 # 239 "include/linux/list.h"
944 static inline __attribute__((always_inline)) void list_replace_rcu(struct list_head *old,
945 struct list_head *new)
946 {
947 new->next = old->next;
948 new->prev = old->prev;
949 __asm__ __volatile__("": : :"memory");
950 new->next->prev = new;
951 new->prev->next = new;
952 old->prev = ((void *) 0x00200200);
953 }
954
955
956
957
958
959 static inline __attribute__((always_inline)) void list_del_init(struct list_head *entry)
960 {
961 __list_del(entry->prev, entry->next);
962 INIT_LIST_HEAD(entry);
963 }
964
965
966
967
968
969
970 static inline __attribute__((always_inline)) void list_move(struct list_head *list, struct list_head *head)
971 {
972 __list_del(list->prev, list->next);
973 list_add(list, head);
974 }
975
976
977
978
979
980
981 static inline __attribute__((always_inline)) void list_move_tail(struct list_head *list,
982 struct list_head *head)
983 {
984 __list_del(list->prev, list->next);
985 list_add_tail(list, head);
986 }
987
988
989
990
991
992
993 static inline __attribute__((always_inline)) int list_is_last(const struct list_head *list,
994 const struct list_head *head)
995 {
996 return list->next == head;
997 }
998
999
1000
1001
1002
1003 static inline __attribute__((always_inline)) int list_empty(const struct list_head *head)
1004 {
1005 return head->next == head;
1006 }
1007 # 316 "include/linux/list.h"
1008 static inline __attribute__((always_inline)) int list_empty_careful(const struct list_head *head)
1009 {
1010 struct list_head *next = head->next;
1011 return (next == head) && (next == head->prev);
1012 }
1013
1014 static inline __attribute__((always_inline)) void __list_splice(struct list_head *list,
1015 struct list_head *head)
1016 {
1017 struct list_head *first = list->next;
1018 struct list_head *last = list->prev;
1019 struct list_head *at = head->next;
1020
1021 first->prev = head;
1022 head->next = first;
1023
1024 last->next = at;
1025 at->prev = last;
1026 }
1027
1028
1029
1030
1031
1032
1033 static inline __attribute__((always_inline)) void list_splice(struct list_head *list, struct list_head *head)
1034 {
1035 if (!list_empty(list))
1036 __list_splice(list, head);
1037 }
1038 # 354 "include/linux/list.h"
1039 static inline __attribute__((always_inline)) void list_splice_init(struct list_head *list,
1040 struct list_head *head)
1041 {
1042 if (!list_empty(list)) {
1043 __list_splice(list, head);
1044 INIT_LIST_HEAD(list);
1045 }
1046 }
1047 # 380 "include/linux/list.h"
1048 static inline __attribute__((always_inline)) void list_splice_init_rcu(struct list_head *list,
1049 struct list_head *head,
1050 void (*sync)(void))
1051 {
1052 struct list_head *first = list->next;
1053 struct list_head *last = list->prev;
1054 struct list_head *at = head->next;
1055
1056 if (list_empty(head))
1057 return;
1058
1059
1060
1061 INIT_LIST_HEAD(list);
1062 # 402 "include/linux/list.h"
1063 sync();
1064 # 412 "include/linux/list.h"
1065 last->next = at;
1066 __asm__ __volatile__("": : :"memory");
1067 head->next = first;
1068 first->prev = head;
1069 at->prev = last;
1070 }
1071 # 675 "include/linux/list.h"
1072 struct hlist_head {
1073 struct hlist_node *first;
1074 };
1075
1076 struct hlist_node {
1077 struct hlist_node *next, **pprev;
1078 };
1079
1080
1081
1082
1083 static inline __attribute__((always_inline)) void INIT_HLIST_NODE(struct hlist_node *h)
1084 {
1085 h->next = ((void *)0);
1086 h->pprev = ((void *)0);
1087 }
1088
1089 static inline __attribute__((always_inline)) int hlist_unhashed(const struct hlist_node *h)
1090 {
1091 return !h->pprev;
1092 }
1093
1094 static inline __attribute__((always_inline)) int hlist_empty(const struct hlist_head *h)
1095 {
1096 return !h->first;
1097 }
1098
1099 static inline __attribute__((always_inline)) void __hlist_del(struct hlist_node *n)
1100 {
1101 struct hlist_node *next = n->next;
1102 struct hlist_node **pprev = n->pprev;
1103 *pprev = next;
1104 if (next)
1105 next->pprev = pprev;
1106 }
1107
1108 static inline __attribute__((always_inline)) void hlist_del(struct hlist_node *n)
1109 {
1110 __hlist_del(n);
1111 n->next = ((void *) 0x00100100);
1112 n->pprev = ((void *) 0x00200200);
1113 }
1114 # 737 "include/linux/list.h"
1115 static inline __attribute__((always_inline)) void hlist_del_rcu(struct hlist_node *n)
1116 {
1117 __hlist_del(n);
1118 n->pprev = ((void *) 0x00200200);
1119 }
1120
1121 static inline __attribute__((always_inline)) void hlist_del_init(struct hlist_node *n)
1122 {
1123 if (!hlist_unhashed(n)) {
1124 __hlist_del(n);
1125 INIT_HLIST_NODE(n);
1126 }
1127 }
1128 # 758 "include/linux/list.h"
1129 static inline __attribute__((always_inline)) void hlist_replace_rcu(struct hlist_node *old,
1130 struct hlist_node *new)
1131 {
1132 struct hlist_node *next = old->next;
1133
1134 new->next = next;
1135 new->pprev = old->pprev;
1136 __asm__ __volatile__("": : :"memory");
1137 if (next)
1138 new->next->pprev = &new->next;
1139 *new->pprev = new;
1140 old->pprev = ((void *) 0x00200200);
1141 }
1142
1143 static inline __attribute__((always_inline)) void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
1144 {
1145 struct hlist_node *first = h->first;
1146 n->next = first;
1147 if (first)
1148 first->pprev = &n->next;
1149 h->first = n;
1150 n->pprev = &h->first;
1151 }
1152 # 802 "include/linux/list.h"
1153 static inline __attribute__((always_inline)) void hlist_add_head_rcu(struct hlist_node *n,
1154 struct hlist_head *h)
1155 {
1156 struct hlist_node *first = h->first;
1157 n->next = first;
1158 n->pprev = &h->first;
1159 __asm__ __volatile__("": : :"memory");
1160 if (first)
1161 first->pprev = &n->next;
1162 h->first = n;
1163 }
1164
1165
1166 static inline __attribute__((always_inline)) void hlist_add_before(struct hlist_node *n,
1167 struct hlist_node *next)
1168 {
1169 n->pprev = next->pprev;
1170 n->next = next;
1171 next->pprev = &n->next;
1172 *(n->pprev) = n;
1173 }
1174
1175 static inline __attribute__((always_inline)) void hlist_add_after(struct hlist_node *n,
1176 struct hlist_node *next)
1177 {
1178 next->next = n->next;
1179 n->next = next;
1180 next->pprev = &n->next;
1181
1182 if(next->next)
1183 next->next->pprev = &next->next;
1184 }
1185 # 853 "include/linux/list.h"
1186 static inline __attribute__((always_inline)) void hlist_add_before_rcu(struct hlist_node *n,
1187 struct hlist_node *next)
1188 {
1189 n->pprev = next->pprev;
1190 n->next = next;
1191 __asm__ __volatile__("": : :"memory");
1192 next->pprev = &n->next;
1193 *(n->pprev) = n;
1194 }
1195 # 881 "include/linux/list.h"
1196 static inline __attribute__((always_inline)) void hlist_add_after_rcu(struct hlist_node *prev,
1197 struct hlist_node *n)
1198 {
1199 n->next = prev->next;
1200 n->pprev = &prev->next;
1201 __asm__ __volatile__("": : :"memory");
1202 prev->next = n;
1203 if (n->next)
1204 n->next->pprev = &n->next;
1205 }
1206 # 23 "include/linux/wait.h" 2
1207
1208 # 1 "include/linux/spinlock.h" 1
1209 # 49 "include/linux/spinlock.h"
1210 # 1 "include/linux/preempt.h" 1
1211 # 9 "include/linux/preempt.h"
1212 # 1 "include/linux/thread_info.h" 1
1213 # 15 "include/linux/thread_info.h"
1214 struct restart_block {
1215 long (*fn)(struct restart_block *);
1216 union {
1217 struct {
1218 unsigned long arg0, arg1, arg2, arg3;
1219 };
1220
1221 struct {
1222 u32 *uaddr;
1223 u32 val;
1224 u32 flags;
1225 u64 time;
1226 } futex;
1227 };
1228 };
1229
1230 extern long do_no_restart_syscall(struct restart_block *parm);
1231
1232 # 1 "include/linux/bitops.h" 1
1233 # 9 "include/linux/bitops.h"
1234 # 1 "include/asm/bitops.h" 1
1235 # 9 "include/asm/bitops.h"
1236 # 1 "include/asm/byteorder.h" 1
1237 # 9 "include/asm/byteorder.h"
1238 static __inline__ __attribute__((always_inline)) __attribute__((__const__)) __u32 ___arch__swahb32(__u32 xx)
1239 {
1240 __u32 tmp;
1241 __asm__("%1 = %0 >> 8 (V);\n\t"
1242 "%0 = %0 << 8 (V);\n\t"
1243 "%0 = %0 | %1;\n\t"
1244 : "+d"(xx), "=&d"(tmp));
1245 return xx;
1246 }
1247
1248 static __inline__ __attribute__((always_inline)) __attribute__((__const__)) __u32 ___arch__swahw32(__u32 xx)
1249 {
1250 __u32 rv;
1251 __asm__("%0 = PACK(%1.L, %1.H);\n\t": "=d"(rv): "d"(xx));
1252 return rv;
1253 }
1254
1255
1256
1257
1258
1259 static __inline__ __attribute__((always_inline)) __attribute__((__const__)) __u16 ___arch__swab16(__u16 xx)
1260 {
1261 __u32 xw = xx;
1262 __asm__("%0 <<= 8;\n %0.L = %0.L + %0.H (NS);\n": "+d"(xw));
1263 return (__u16)xw;
1264 }
1265 # 46 "include/asm/byteorder.h"
1266 # 1 "include/linux/byteorder/little_endian.h" 1
1267 # 12 "include/linux/byteorder/little_endian.h"
1268 # 1 "include/linux/byteorder/swab.h" 1
1269 # 64 "include/linux/byteorder/swab.h"
1270 static __inline__ __attribute__((always_inline)) __attribute__((__const__)) __u16 ___swab16(__u16 x)
1271 {
1272 return x<<8 | x>>8;
1273 }
1274 static __inline__ __attribute__((always_inline)) __attribute__((__const__)) __u32 ___swab32(__u32 x)
1275 {
1276 return x<<24 | x>>24 |
1277 (x & (__u32)0x0000ff00UL)<<8 |
1278 (x & (__u32)0x00ff0000UL)>>8;
1279 }
1280 static __inline__ __attribute__((always_inline)) __attribute__((__const__)) __u64 ___swab64(__u64 x)
1281 {
1282 return x<<56 | x>>56 |
1283 (x & (__u64)0x000000000000ff00ULL)<<40 |
1284 (x & (__u64)0x0000000000ff0000ULL)<<24 |
1285 (x & (__u64)0x00000000ff000000ULL)<< 8 |
1286 (x & (__u64)0x000000ff00000000ULL)>> 8 |
1287 (x & (__u64)0x0000ff0000000000ULL)>>24 |
1288 (x & (__u64)0x00ff000000000000ULL)>>40;
1289 }
1290 # 163 "include/linux/byteorder/swab.h"
1291 static __inline__ __attribute__((always_inline)) __attribute__((__const__)) __u16 __fswab16(__u16 x)
1292 {
1293 return ___arch__swab16(x);
1294 }
1295 static __inline__ __attribute__((always_inline)) __u16 __swab16p(const __u16 *x)
1296 {
1297 return ___arch__swab16(*(x));
1298 }
1299 static __inline__ __attribute__((always_inline)) void __swab16s(__u16 *addr)
1300 {
1301 ((void)(*(addr) = ___arch__swab16(*(addr))));
1302 }
1303
1304 static __inline__ __attribute__((always_inline)) __attribute__((__const__)) __u32 __fswab32(__u32 x)
1305 {
1306 return ___arch__swahb32(___arch__swahw32(x));
1307 }
1308 static __inline__ __attribute__((always_inline)) __u32 __swab32p(const __u32 *x)
1309 {
1310 return ___arch__swahb32(___arch__swahw32(*(x)));
1311 }
1312 static __inline__ __attribute__((always_inline)) void __swab32s(__u32 *addr)
1313 {
1314 ((void)(*(addr) = ___arch__swahb32(___arch__swahw32(*(addr)))));
1315 }
1316
1317
1318 static __inline__ __attribute__((always_inline)) __attribute__((__const__)) __u64 __fswab64(__u64 x)
1319 {
1320
1321 __u32 h = x >> 32;
1322 __u32 l = x & ((1ULL<<32)-1);
1323 return (((__u64)(__builtin_constant_p((__u32)(l)) ? ((__u32)( (((__u32)((l)) & (__u32)0x000000ffUL) << 24) | (((__u32)((l)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((l)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((l)) & (__u32)0xff000000UL) >> 24) )) : __fswab32((l)))) << 32) | ((__u64)((__builtin_constant_p((__u32)(h)) ? ((__u32)( (((__u32)((h)) & (__u32)0x000000ffUL) << 24) | (((__u32)((h)) & (__u32)0x0000ff00UL) << 8) | (((__u32)((h)) & (__u32)0x00ff0000UL) >> 8) | (((__u32)((h)) & (__u32)0xff000000UL) >> 24) )) : __fswab32((h)))));
1324
1325
1326
1327 }
1328 static __inline__ __attribute__((always_inline)) __u64 __swab64p(const __u64 *x)
1329 {
1330 return ___swab64(*(x));
1331 }
1332 static __inline__ __attribute__((always_inline)) void __swab64s(__u64 *addr)
1333 {
1334 ((void)(*(addr) = ___swab64(*(addr))));
1335 }
1336 # 13 "include/linux/byteorder/little_endian.h" 2
1337 # 43 "include/linux/byteorder/little_endian.h"
1338 static inline __attribute__((always_inline)) __le64 __cpu_to_le64p(const __u64 *p)
1339 {
1340 return ( __le64)*p;
1341 }
1342 static inline __attribute__((always_inline)) __u64 __le64_to_cpup(const __le64 *p)
1343 {
1344 return ( __u64)*p;
1345 }
1346 static inline __attribute__((always_inline)) __le32 __cpu_to_le32p(const __u32 *p)
1347 {
1348 return ( __le32)*p;
1349 }
1350 static inline __attribute__((always_inline)) __u32 __le32_to_cpup(const __le32 *p)
1351 {
1352 return ( __u32)*p;
1353 }
1354 static inline __attribute__((always_inline)) __le16 __cpu_to_le16p(const __u16 *p)
1355 {
1356 return ( __le16)*p;
1357 }
1358 static inline __attribute__((always_inline)) __u16 __le16_to_cpup(const __le16 *p)
1359 {
1360 return ( __u16)*p;
1361 }
1362 static inline __attribute__((always_inline)) __be64 __cpu_to_be64p(const __u64 *p)
1363 {
1364 return ( __be64)__swab64p(p);
1365 }
1366 static inline __attribute__((always_inline)) __u64 __be64_to_cpup(const __be64 *p)
1367 {
1368 return __swab64p((__u64 *)p);
1369 }
1370 static inline __attribute__((always_inline)) __be32 __cpu_to_be32p(const __u32 *p)
1371 {
1372 return ( __be32)__swab32p(p);
1373 }
1374 static inline __attribute__((always_inline)) __u32 __be32_to_cpup(const __be32 *p)
1375 {
1376 return __swab32p((__u32 *)p);
1377 }
1378 static inline __attribute__((always_inline)) __be16 __cpu_to_be16p(const __u16 *p)
1379 {
1380 return ( __be16)__swab16p(p);
1381 }
1382 static inline __attribute__((always_inline)) __u16 __be16_to_cpup(const __be16 *p)
1383 {
1384 return __swab16p((__u16 *)p);
1385 }
1386 # 104 "include/linux/byteorder/little_endian.h"
1387 # 1 "include/linux/byteorder/generic.h" 1
1388 # 105 "include/linux/byteorder/little_endian.h" 2
1389 # 47 "include/asm/byteorder.h" 2
1390 # 10 "include/asm/bitops.h" 2
1391
1392
1393
1394
1395 # 1 "include/asm-generic/bitops/ffs.h" 1
1396 # 12 "include/asm-generic/bitops/ffs.h"
1397 static inline __attribute__((always_inline)) int ffs(int x)
1398 {
1399 int r = 1;
1400
1401 if (!x)
1402 return 0;
1403 if (!(x & 0xffff)) {
1404 x >>= 16;
1405 r += 16;
1406 }
1407 if (!(x & 0xff)) {
1408 x >>= 8;
1409 r += 8;
1410 }
1411 if (!(x & 0xf)) {
1412 x >>= 4;
1413 r += 4;
1414 }
1415 if (!(x & 3)) {
1416 x >>= 2;
1417 r += 2;
1418 }
1419 if (!(x & 1)) {
1420 x >>= 1;
1421 r += 1;
1422 }
1423 return r;
1424 }
1425 # 15 "include/asm/bitops.h" 2
1426 # 1 "include/asm-generic/bitops/__ffs.h" 1
1427 # 12 "include/asm-generic/bitops/__ffs.h"
1428 static inline __attribute__((always_inline)) unsigned long __ffs(unsigned long word)
1429 {
1430 int num = 0;
1431
1432
1433
1434
1435
1436
1437
1438 if ((word & 0xffff) == 0) {
1439 num += 16;
1440 word >>= 16;
1441 }
1442 if ((word & 0xff) == 0) {
1443 num += 8;
1444 word >>= 8;
1445 }
1446 if ((word & 0xf) == 0) {
1447 num += 4;
1448 word >>= 4;
1449 }
1450 if ((word & 0x3) == 0) {
1451 num += 2;
1452 word >>= 2;
1453 }
1454 if ((word & 0x1) == 0)
1455 num += 1;
1456 return num;
1457 }
1458 # 16 "include/asm/bitops.h" 2
1459 # 1 "include/asm-generic/bitops/sched.h" 1
1460 # 13 "include/asm-generic/bitops/sched.h"
1461 static inline __attribute__((always_inline)) int sched_find_first_bit(const unsigned long *b)
1462 {
1463
1464
1465
1466
1467
1468
1469
1470 if (__builtin_expect(!!(b[0]), 0))
1471 return __ffs(b[0]);
1472 if (__builtin_expect(!!(b[1]), 0))
1473 return __ffs(b[1]) + 32;
1474 if (__builtin_expect(!!(b[2]), 0))
1475 return __ffs(b[2]) + 64;
1476 if (b[3])
1477 return __ffs(b[3]) + 96;
1478 return __ffs(b[4]) + 128;
1479
1480
1481
1482 }
1483 # 17 "include/asm/bitops.h" 2
1484 # 1 "include/asm-generic/bitops/ffz.h" 1
1485 # 18 "include/asm/bitops.h" 2
1486
1487 static __inline__ __attribute__((always_inline)) void set_bit(int nr, volatile unsigned long *addr)
1488 {
1489 int *a = (int *)addr;
1490 int mask;
1491 unsigned long flags;
1492
1493 a += nr >> 5;
1494 mask = 1 << (nr & 0x1f);
1495 __asm__ __volatile__( "cli %0;" : "=&d" (flags) );
1496 *a |= mask;
1497 do { if (((flags) != 0x1f)) __asm__ __volatile__( "sti %0;" : : "d" (irq_flags) ); } while (0);
1498 }
1499
1500 static __inline__ __attribute__((always_inline)) void __set_bit(int nr, volatile unsigned long *addr)
1501 {
1502 int *a = (int *)addr;
1503 int mask;
1504
1505 a += nr >> 5;
1506 mask = 1 << (nr & 0x1f);
1507 *a |= mask;
1508 }
1509
1510
1511
1512
1513
1514
1515
1516 static __inline__ __attribute__((always_inline)) void clear_bit(int nr, volatile unsigned long *addr)
1517 {
1518 int *a = (int *)addr;
1519 int mask;
1520 unsigned long flags;
1521 a += nr >> 5;
1522 mask = 1 << (nr & 0x1f);
1523 __asm__ __volatile__( "cli %0;" : "=&d" (flags) );
1524 *a &= ~mask;
1525 do { if (((flags) != 0x1f)) __asm__ __volatile__( "sti %0;" : : "d" (irq_flags) ); } while (0);
1526 }
1527
1528 static __inline__ __attribute__((always_inline)) void __clear_bit(int nr, volatile unsigned long *addr)
1529 {
1530 int *a = (int *)addr;
1531 int mask;
1532
1533 a += nr >> 5;
1534 mask = 1 << (nr & 0x1f);
1535 *a &= ~mask;
1536 }
1537
1538 static __inline__ __attribute__((always_inline)) void change_bit(int nr, volatile unsigned long *addr)
1539 {
1540 int mask, flags;
1541 unsigned long *ADDR = (unsigned long *)addr;
1542
1543 ADDR += nr >> 5;
1544 mask = 1 << (nr & 31);
1545 __asm__ __volatile__( "cli %0;" : "=&d" (flags) );
1546 *ADDR ^= mask;
1547 do { if (((flags) != 0x1f)) __asm__ __volatile__( "sti %0;" : : "d" (irq_flags) ); } while (0);
1548 }
1549
1550 static __inline__ __attribute__((always_inline)) void __change_bit(int nr, volatile unsigned long *addr)
1551 {
1552 int mask;
1553 unsigned long *ADDR = (unsigned long *)addr;
1554
1555 ADDR += nr >> 5;
1556 mask = 1 << (nr & 31);
1557 *ADDR ^= mask;
1558 }
1559
1560 static __inline__ __attribute__((always_inline)) int test_and_set_bit(int nr, void *addr)
1561 {
1562 int mask, retval;
1563 volatile unsigned int *a = (volatile unsigned int *)addr;
1564 unsigned long flags;
1565
1566 a += nr >> 5;
1567 mask = 1 << (nr & 0x1f);
1568 __asm__ __volatile__( "cli %0;" : "=&d" (flags) );
1569 retval = (mask & *a) != 0;
1570 *a |= mask;
1571 do { if (((flags) != 0x1f)) __asm__ __volatile__( "sti %0;" : : "d" (irq_flags) ); } while (0);
1572
1573 return retval;
1574 }
1575
1576 static __inline__ __attribute__((always_inline)) int __test_and_set_bit(int nr, volatile unsigned long *addr)
1577 {
1578 int mask, retval;
1579 volatile unsigned int *a = (volatile unsigned int *)addr;
1580
1581 a += nr >> 5;
1582 mask = 1 << (nr & 0x1f);
1583 retval = (mask & *a) != 0;
1584 *a |= mask;
1585 return retval;
1586 }
1587
1588 static __inline__ __attribute__((always_inline)) int test_and_clear_bit(int nr, volatile unsigned long *addr)
1589 {
1590 int mask, retval;
1591 volatile unsigned int *a = (volatile unsigned int *)addr;
1592 unsigned long flags;
1593
1594 a += nr >> 5;
1595 mask = 1 << (nr & 0x1f);
1596 __asm__ __volatile__( "cli %0;" : "=&d" (flags) );
1597 retval = (mask & *a) != 0;
1598 *a &= ~mask;
1599 do { if (((flags) != 0x1f)) __asm__ __volatile__( "sti %0;" : : "d" (irq_flags) ); } while (0);
1600
1601 return retval;
1602 }
1603
1604 static __inline__ __attribute__((always_inline)) int __test_and_clear_bit(int nr, volatile unsigned long *addr)
1605 {
1606 int mask, retval;
1607 volatile unsigned int *a = (volatile unsigned int *)addr;
1608
1609 a += nr >> 5;
1610 mask = 1 << (nr & 0x1f);
1611 retval = (mask & *a) != 0;
1612 *a &= ~mask;
1613 return retval;
1614 }
1615
1616 static __inline__ __attribute__((always_inline)) int test_and_change_bit(int nr, volatile unsigned long *addr)
1617 {
1618 int mask, retval;
1619 volatile unsigned int *a = (volatile unsigned int *)addr;
1620 unsigned long flags;
1621
1622 a += nr >> 5;
1623 mask = 1 << (nr & 0x1f);
1624 __asm__ __volatile__( "cli %0;" : "=&d" (flags) );
1625 retval = (mask & *a) != 0;
1626 *a ^= mask;
1627 do { if (((flags) != 0x1f)) __asm__ __volatile__( "sti %0;" : : "d" (irq_flags) ); } while (0);
1628 return retval;
1629 }
1630
1631 static __inline__ __attribute__((always_inline)) int __test_and_change_bit(int nr,
1632 volatile unsigned long *addr)
1633 {
1634 int mask, retval;
1635 volatile unsigned int *a = (volatile unsigned int *)addr;
1636
1637 a += nr >> 5;
1638 mask = 1 << (nr & 0x1f);
1639 retval = (mask & *a) != 0;
1640 *a ^= mask;
1641 return retval;
1642 }
1643
1644
1645
1646
1647 static __inline__ __attribute__((always_inline)) int __constant_test_bit(int nr, const void *addr)
1648 {
1649 return ((1UL << (nr & 31)) &
1650 (((const volatile unsigned int *)addr)[nr >> 5])) != 0;
1651 }
1652
1653 static __inline__ __attribute__((always_inline)) int __test_bit(int nr, const void *addr)
1654 {
1655 int *a = (int *)addr;
1656 int mask;
1657
1658 a += nr >> 5;
1659 mask = 1 << (nr & 0x1f);
1660 return ((mask & *a) != 0);
1661 }
1662
1663
1664
1665
1666
1667
1668 # 1 "include/asm-generic/bitops/find.h" 1
1669
1670
1671
1672 extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
1673 size, unsigned long offset);
1674
1675 extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
1676 long size, unsigned long offset);
1677 # 201 "include/asm/bitops.h" 2
1678 # 1 "include/asm-generic/bitops/hweight.h" 1
1679
1680
1681
1682
1683
1684 extern unsigned int hweight32(unsigned int w);
1685 extern unsigned int hweight16(unsigned int w);
1686 extern unsigned int hweight8(unsigned int w);
1687 extern unsigned long hweight64(__u64 w);
1688 # 202 "include/asm/bitops.h" 2
1689
1690 # 1 "include/asm-generic/bitops/ext2-atomic.h" 1
1691 # 204 "include/asm/bitops.h" 2
1692 # 1 "include/asm-generic/bitops/ext2-non-atomic.h" 1
1693
1694
1695
1696 # 1 "include/asm-generic/bitops/le.h" 1
1697 # 5 "include/asm-generic/bitops/ext2-non-atomic.h" 2
1698 # 205 "include/asm/bitops.h" 2
1699
1700 # 1 "include/asm-generic/bitops/minix.h" 1
1701 # 207 "include/asm/bitops.h" 2
1702
1703
1704
1705 # 1 "include/asm-generic/bitops/fls.h" 1
1706 # 12 "include/asm-generic/bitops/fls.h"
1707 static inline __attribute__((always_inline)) int fls(int x)
1708 {
1709 int r = 32;
1710
1711 if (!x)
1712 return 0;
1713 if (!(x & 0xffff0000u)) {
1714 x <<= 16;
1715 r -= 16;
1716 }
1717 if (!(x & 0xff000000u)) {
1718 x <<= 8;
1719 r -= 8;
1720 }
1721 if (!(x & 0xf0000000u)) {
1722 x <<= 4;
1723 r -= 4;
1724 }
1725 if (!(x & 0xc0000000u)) {
1726 x <<= 2;
1727 r -= 2;
1728 }
1729 if (!(x & 0x80000000u)) {
1730 x <<= 1;
1731 r -= 1;
1732 }
1733 return r;
1734 }
1735 # 211 "include/asm/bitops.h" 2
1736 # 1 "include/asm-generic/bitops/fls64.h" 1
1737
1738
1739
1740
1741
1742 static inline __attribute__((always_inline)) int fls64(__u64 x)
1743 {
1744 __u32 h = x >> 32;
1745 if (h)
1746 return fls(h) + 32;
1747 return fls(x);
1748 }
1749 # 212 "include/asm/bitops.h" 2
1750 # 10 "include/linux/bitops.h" 2
1751
1752 static __inline__ __attribute__((always_inline)) int get_bitmask_order(unsigned int count)
1753 {
1754 int order;
1755
1756 order = fls(count);
1757 return order;
1758 }
1759
1760 static __inline__ __attribute__((always_inline)) int get_count_order(unsigned int count)
1761 {
1762 int order;
1763
1764 order = fls(count) - 1;
1765 if (count & (count - 1))
1766 order++;
1767 return order;
1768 }
1769
1770 static inline __attribute__((always_inline)) unsigned long hweight_long(unsigned long w)
1771 {
1772 return sizeof(w) == 4 ? hweight32(w) : hweight64(w);
1773 }
1774
1775
1776
1777
1778
1779
1780 static inline __attribute__((always_inline)) __u32 rol32(__u32 word, unsigned int shift)
1781 {
1782 return (word << shift) | (word >> (32 - shift));
1783 }
1784
1785
1786
1787
1788
1789
1790 static inline __attribute__((always_inline)) __u32 ror32(__u32 word, unsigned int shift)
1791 {
1792 return (word >> shift) | (word << (32 - shift));
1793 }
1794
1795 static inline __attribute__((always_inline)) unsigned fls_long(unsigned long l)
1796 {
1797 if (sizeof(l) == 4)
1798 return fls(l);
1799 return fls64(l);
1800 }
1801 # 34 "include/linux/thread_info.h" 2
1802 # 1 "include/asm/thread_info.h" 1
1803 # 30 "include/asm/thread_info.h"
1804 # 1 "include/asm/page.h" 1
1805 # 16 "include/asm/page.h"
1806 # 1 "include/asm/setup.h" 1
1807 # 17 "include/asm/page.h" 2
1808 # 32 "include/asm/page.h"
1809 typedef struct {
1810 unsigned long pte;
1811 } pte_t;
1812 typedef struct {
1813 unsigned long pmd[16];
1814 } pmd_t;
1815 typedef struct {
1816 unsigned long pgd;
1817 } pgd_t;
1818 typedef struct {
1819 unsigned long pgprot;
1820 } pgprot_t;
1821 # 58 "include/asm/page.h"
1822 extern unsigned long memory_start;
1823 extern unsigned long memory_end;
1824
1825
1826
1827 # 1 "include/asm/page_offset.h" 1
1828 # 64 "include/asm/page.h" 2
1829 # 1 "include/asm/io.h" 1
1830 # 23 "include/asm/io.h"
1831 static inline __attribute__((always_inline)) unsigned char readb(const volatile void *addr)
1832 {
1833 unsigned int val;
1834 int tmp;
1835
1836 __asm__ __volatile__ ("cli %1;\n\t"
1837 "NOP; NOP; SSYNC;\n\t"
1838 "%0 = b [%2] (z);\n\t"
1839 "sti %1;\n\t"
1840 : "=d"(val), "=d"(tmp): "a"(addr)
1841 );
1842
1843 return (unsigned char) val;
1844 }
1845
1846 static inline __attribute__((always_inline)) unsigned short readw(const volatile void *addr)
1847 {
1848 unsigned int val;
1849 int tmp;
1850
1851 __asm__ __volatile__ ("cli %1;\n\t"
1852 "NOP; NOP; SSYNC;\n\t"
1853 "%0 = w [%2] (z);\n\t"
1854 "sti %1;\n\t"
1855 : "=d"(val), "=d"(tmp): "a"(addr)
1856 );
1857
1858 return (unsigned short) val;
1859 }
1860
1861 static inline __attribute__((always_inline)) unsigned int readl(const volatile void *addr)
1862 {
1863 unsigned int val;
1864 int tmp;
1865
1866 __asm__ __volatile__ ("cli %1;\n\t"
1867 "NOP; NOP; SSYNC;\n\t"
1868 "%0 = [%2];\n\t"
1869 "sti %1;\n\t"
1870 : "=d"(val), "=d"(tmp): "a"(addr)
1871 );
1872 return val;
1873 }
1874 # 118 "include/asm/io.h"
1875 extern void outsb(unsigned long port, const void *addr, unsigned long count);
1876 extern void outsw(unsigned long port, const void *addr, unsigned long count);
1877 extern void outsl(unsigned long port, const void *addr, unsigned long count);
1878
1879 extern void insb(unsigned long port, void *addr, unsigned long count);
1880 extern void insw(unsigned long port, void *addr, unsigned long count);
1881 extern void insl(unsigned long port, void *addr, unsigned long count);
1882 extern void insl_16(unsigned long port, void *addr, unsigned long count);
1883
1884 extern void dma_outsb(unsigned long port, const void *addr, unsigned short count);
1885 extern void dma_outsw(unsigned long port, const void *addr, unsigned short count);
1886 extern void dma_outsl(unsigned long port, const void *addr, unsigned short count);
1887
1888 extern void dma_insb(unsigned long port, void *addr, unsigned short count);
1889 extern void dma_insw(unsigned long port, void *addr, unsigned short count);
1890 extern void dma_insl(unsigned long port, void *addr, unsigned short count);
1891
1892
1893
1894
1895 static inline __attribute__((always_inline)) void *__ioremap(unsigned long physaddr, unsigned long size,
1896 int cacheflag)
1897 {
1898 return (void *)physaddr;
1899 }
1900
1901
1902
1903
1904 static inline __attribute__((always_inline)) void iounmap(void *addr)
1905 {
1906 }
1907
1908
1909
1910
1911
1912
1913 static inline __attribute__((always_inline)) void __iounmap(void *addr, unsigned long size)
1914 {
1915 }
1916
1917
1918
1919
1920
1921
1922 static inline __attribute__((always_inline)) void kernel_set_cachemode(void *addr, unsigned long size,
1923 int cmode)
1924 {
1925 }
1926
1927 static inline __attribute__((always_inline)) void *ioremap(unsigned long physaddr, unsigned long size)
1928 {
1929 return __ioremap(physaddr, size, 1);
1930 }
1931 static inline __attribute__((always_inline)) void *ioremap_nocache(unsigned long physaddr,
1932 unsigned long size)
1933 {
1934 return __ioremap(physaddr, size, 1);
1935 }
1936
1937 extern void blkfin_inv_cache_all(void);
1938 # 65 "include/asm/page.h" 2
1939 # 88 "include/asm/page.h"
1940 # 1 "include/asm-generic/page.h" 1
1941 # 10 "include/asm-generic/page.h"
1942 static __inline__ __attribute__((always_inline)) __attribute__((__const__)) int get_order(unsigned long size)
1943 {
1944 int order;
1945
1946 size = (size - 1) >> (12 - 1);
1947 order = -1;
1948 do {
1949 size >>= 1;
1950 order++;
1951 } while (size);
1952 return order;
1953 }
1954 # 89 "include/asm/page.h" 2
1955 # 31 "include/asm/thread_info.h" 2
1956 # 1 "include/asm/entry.h" 1
1957 # 32 "include/asm/thread_info.h" 2
1958 # 1 "include/asm/l1layout.h" 1
1959 # 16 "include/asm/l1layout.h"
1960 struct l1_scratch_task_info
1961 {
1962
1963 void *stack_start;
1964
1965
1966
1967 void *lowest_sp;
1968 };
1969 # 33 "include/asm/thread_info.h" 2
1970 # 49 "include/asm/thread_info.h"
1971 typedef unsigned long mm_segment_t;
1972
1973
1974
1975
1976
1977
1978 struct thread_info {
1979 struct task_struct *task;
1980 struct exec_domain *exec_domain;
1981 unsigned long flags;
1982 int cpu;
1983 int preempt_count;
1984 mm_segment_t addr_limit;
1985 struct restart_block restart_block;
1986 struct l1_scratch_task_info l1_task_info;
1987 };
1988 # 86 "include/asm/thread_info.h"
1989 static inline __attribute__((always_inline)) struct thread_info *current_thread_info(void)
1990 __attribute__ ((__const__));
1991
1992
1993
1994
1995 static inline __attribute__((always_inline)) struct thread_info *current_thread_info(void)
1996 {
1997 struct thread_info *ti;
1998 __asm__("%0 = sp;": "=&d"(ti):
1999 );
2000 return (struct thread_info *)((long)ti & ~((long)8192 -1));
2001 }
2002 # 35 "include/linux/thread_info.h" 2
2003 # 43 "include/linux/thread_info.h"
2004 static inline __attribute__((always_inline)) void set_ti_thread_flag(struct thread_info *ti, int flag)
2005 {
2006 set_bit(flag,&ti->flags);
2007 }
2008
2009 static inline __attribute__((always_inline)) void clear_ti_thread_flag(struct thread_info *ti, int flag)
2010 {
2011 clear_bit(flag,&ti->flags);
2012 }
2013
2014 static inline __attribute__((always_inline)) int test_and_set_ti_thread_flag(struct thread_info *ti, int flag)
2015 {
2016 return test_and_set_bit(flag,&ti->flags);
2017 }
2018
2019 static inline __attribute__((always_inline)) int test_and_clear_ti_thread_flag(struct thread_info *ti, int flag)
2020 {
2021 return test_and_clear_bit(flag,&ti->flags);
2022 }
2023
2024 static inline __attribute__((always_inline)) int test_ti_thread_flag(struct thread_info *ti, int flag)
2025 {
2026 return (__builtin_constant_p(flag) ? __constant_test_bit((flag),(&ti->flags)) : __test_bit((flag),(&ti->flags)));
2027 }
2028 # 10 "include/linux/preempt.h" 2
2029 # 50 "include/linux/spinlock.h" 2
2030
2031
2032
2033 # 1 "include/linux/kernel.h" 1
2034 # 10 "include/linux/kernel.h"
2035 # 1 "/usr/local/src/blackfin/toolchains/20071218/bfin-uclinux/lib/gcc/bfin-uclinux/4.1.2/include/stdarg.h" 1 3 4
2036 # 43 "/usr/local/src/blackfin/toolchains/20071218/bfin-uclinux/lib/gcc/bfin-uclinux/4.1.2/include/stdarg.h" 3 4
2037 typedef __builtin_va_list __gnuc_va_list;
2038 # 105 "/usr/local/src/blackfin/toolchains/20071218/bfin-uclinux/lib/gcc/bfin-uclinux/4.1.2/include/stdarg.h" 3 4
2039 typedef __gnuc_va_list va_list;
2040 # 11 "include/linux/kernel.h" 2
2041
2042
2043
2044
2045
2046 # 1 "include/linux/log2.h" 1
2047 # 21 "include/linux/log2.h"
2048 extern __attribute__((const, noreturn))
2049 int ____ilog2_NaN(void);
2050 # 31 "include/linux/log2.h"
2051 static inline __attribute__((always_inline)) __attribute__((const))
2052 int __ilog2_u32(u32 n)
2053 {
2054 return fls(n) - 1;
2055 }
2056
2057
2058
2059 static inline __attribute__((always_inline)) __attribute__((const))
2060 int __ilog2_u64(u64 n)
2061 {
2062 return fls64(n) - 1;
2063 }
2064
2065
2066
2067
2068
2069
2070
2071 static inline __attribute__((always_inline)) __attribute__((const))
2072 bool is_power_of_2(unsigned long n)
2073 {
2074 return (n != 0 && ((n & (n - 1)) == 0));
2075 }
2076
2077
2078
2079
2080 static inline __attribute__((always_inline)) __attribute__((const))
2081 unsigned long __roundup_pow_of_two(unsigned long n)
2082 {
2083 return 1UL << fls_long(n - 1);
2084 }
2085 # 17 "include/linux/kernel.h" 2
2086
2087 # 1 "include/asm/bug.h" 1
2088
2089
2090 # 1 "include/asm-generic/bug.h" 1
2091 # 4 "include/asm/bug.h" 2
2092 # 19 "include/linux/kernel.h" 2
2093
2094 extern const char linux_banner[];
2095 extern const char linux_proc_banner[];
2096 # 63 "include/linux/kernel.h"
2097 extern int console_printk[];
2098
2099
2100
2101
2102
2103
2104 struct completion;
2105 struct pt_regs;
2106 struct user;
2107 # 85 "include/linux/kernel.h"
2108 extern int cond_resched(void);
2109 # 106 "include/linux/kernel.h"
2110 extern struct atomic_notifier_head panic_notifier_list;
2111 extern long (*panic_blink)(long time);
2112 void panic(const char * fmt, ...)
2113 __attribute__ ((noreturn, format (printf, 1, 2)));
2114 extern void oops_enter(void);
2115 extern void oops_exit(void);
2116 extern int oops_may_print(void);
2117 void do_exit(long error_code)
2118 __attribute__((noreturn));
2119 void complete_and_exit(struct completion *, long)
2120 __attribute__((noreturn));
2121 extern unsigned long simple_strtoul(const char *,char **,unsigned int);
2122 extern long simple_strtol(const char *,char **,unsigned int);
2123 extern unsigned long long simple_strtoull(const char *,char **,unsigned int);
2124 extern long long simple_strtoll(const char *,char **,unsigned int);
2125 extern int sprintf(char * buf, const char * fmt, ...)
2126 __attribute__ ((format (printf, 2, 3)));
2127 extern int vsprintf(char *buf, const char *, va_list)
2128 __attribute__ ((format (printf, 2, 0)));
2129 extern int snprintf(char * buf, size_t size, const char * fmt, ...)
2130 __attribute__ ((format (printf, 3, 4)));
2131 extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
2132 __attribute__ ((format (printf, 3, 0)));
2133 extern int scnprintf(char * buf, size_t size, const char * fmt, ...)
2134 __attribute__ ((format (printf, 3, 4)));
2135 extern int vscnprintf(char *buf, size_t size, const char *fmt, va_list args)
2136 __attribute__ ((format (printf, 3, 0)));
2137 extern char *kasprintf(gfp_t gfp, const char *fmt, ...)
2138 __attribute__ ((format (printf, 2, 3)));
2139 extern char *kvasprintf(gfp_t gfp, const char *fmt, va_list args);
2140
2141 extern int sscanf(const char *, const char *, ...)
2142 __attribute__ ((format (scanf, 2, 3)));
2143 extern int vsscanf(const char *, const char *, va_list)
2144 __attribute__ ((format (scanf, 2, 0)));
2145
2146 extern int get_option(char **str, int *pint);
2147 extern char *get_options(const char *str, int nints, int *ints);
2148 extern unsigned long long memparse(char *ptr, char **retptr);
2149
2150 extern int core_kernel_text(unsigned long addr);
2151 extern int __kernel_text_address(unsigned long addr);
2152 extern int kernel_text_address(unsigned long addr);
2153 struct pid;
2154 extern struct pid *session_of_pgrp(struct pid *pgrp);
2155
2156 extern void dump_thread(struct pt_regs *regs, struct user *dump);
2157
2158
2159 int vprintk(const char *fmt, va_list args)
2160 __attribute__ ((format (printf, 1, 0)));
2161 int printk(const char * fmt, ...)
2162 __attribute__ ((format (printf, 1, 2)));
2163 extern int log_buf_get_len(void);
2164 extern int log_buf_read(int idx);
2165 extern int log_buf_copy(char *dest, int idx, int len);
2166 # 174 "include/linux/kernel.h"
2167 unsigned long int_sqrt(unsigned long);
2168
2169 extern int printk_ratelimit(void);
2170 extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst);
2171 extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
2172 unsigned int interval_msec);
2173
2174 static inline __attribute__((always_inline)) void console_silent(void)
2175 {
2176 (console_printk[0]) = 0;
2177 }
2178
2179 static inline __attribute__((always_inline)) void console_verbose(void)
2180 {
2181 if ((console_printk[0]))
2182 (console_printk[0]) = 15;
2183 }
2184
2185 extern void bust_spinlocks(int yes);
2186 extern void wake_up_klogd(void);
2187 extern int oops_in_progress;
2188 extern int panic_timeout;
2189 extern int panic_on_oops;
2190 extern int panic_on_unrecovered_nmi;
2191 extern int tainted;
2192 extern const char *print_tainted(void);
2193 extern void add_taint(unsigned);
2194
2195
2196 extern enum system_states {
2197 SYSTEM_BOOTING,
2198 SYSTEM_RUNNING,
2199 SYSTEM_HALT,
2200 SYSTEM_POWER_OFF,
2201 SYSTEM_RESTART,
2202 SYSTEM_SUSPEND_DISK,
2203 } system_state;
2204 # 220 "include/linux/kernel.h"
2205 extern void dump_stack(void);
2206
2207 enum {
2208 DUMP_PREFIX_NONE,
2209 DUMP_PREFIX_ADDRESS,
2210 DUMP_PREFIX_OFFSET
2211 };
2212 extern void hex_dump_to_buffer(const void *buf, size_t len,
2213 int rowsize, int groupsize,
2214 char *linebuf, size_t linebuflen, bool ascii);
2215 extern void print_hex_dump(const char *level, const char *prefix_str,
2216 int prefix_type, int rowsize, int groupsize,
2217 void *buf, size_t len, bool ascii);
2218 extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
2219 void *buf, size_t len);
2220
2221
2222
2223
2224
2225
2226
2227 static inline __attribute__((always_inline)) int __attribute__ ((format (printf, 1, 2))) pr_debug(const char * fmt, ...)
2228 {
2229 return 0;
2230 }
2231 # 346 "include/linux/kernel.h"
2232 struct sysinfo;
2233 extern int do_sysinfo(struct sysinfo *info);
2234
2235
2236
2237
2238 struct sysinfo {
2239 long uptime;
2240 unsigned long loads[3];
2241 unsigned long totalram;
2242 unsigned long freeram;
2243 unsigned long sharedram;
2244 unsigned long bufferram;
2245 unsigned long totalswap;
2246 unsigned long freeswap;
2247 unsigned short procs;
2248 unsigned short pad;
2249 unsigned long totalhigh;
2250 unsigned long freehigh;
2251 unsigned int mem_unit;
2252 char _f[20-2*sizeof(long)-sizeof(int)];
2253 };
2254 # 54 "include/linux/spinlock.h" 2
2255 # 1 "include/linux/stringify.h" 1
2256 # 55 "include/linux/spinlock.h" 2
2257 # 1 "include/linux/bottom_half.h" 1
2258
2259
2260
2261 extern void local_bh_disable(void);
2262 extern void __local_bh_enable(void);
2263 extern void _local_bh_enable(void);
2264 extern void local_bh_enable(void);
2265 extern void local_bh_enable_ip(unsigned long ip);
2266 # 56 "include/linux/spinlock.h" 2
2267 # 79 "include/linux/spinlock.h"
2268 # 1 "include/linux/spinlock_types.h" 1
2269 # 12 "include/linux/spinlock_types.h"
2270 # 1 "include/linux/lockdep.h" 1
2271 # 11 "include/linux/lockdep.h"
2272 struct task_struct;
2273 # 252 "include/linux/lockdep.h"
2274 static inline __attribute__((always_inline)) void lockdep_off(void)
2275 {
2276 }
2277
2278 static inline __attribute__((always_inline)) void lockdep_on(void)
2279 {
2280 }
2281 # 278 "include/linux/lockdep.h"
2282 struct lock_class_key { };
2283 # 287 "include/linux/lockdep.h"
2284 static inline __attribute__((always_inline)) void early_init_irq_lock_class(void)
2285 {
2286 }
2287
2288
2289
2290
2291
2292
2293
2294 static inline __attribute__((always_inline)) void early_boot_irqs_off(void)
2295 {
2296 }
2297 static inline __attribute__((always_inline)) void early_boot_irqs_on(void)
2298 {
2299 }
2300 static inline __attribute__((always_inline)) void print_irqtrace_events(struct task_struct *curr)
2301 {
2302 }
2303 # 13 "include/linux/spinlock_types.h" 2
2304
2305
2306
2307
2308 # 1 "include/linux/spinlock_types_up.h" 1
2309 # 29 "include/linux/spinlock_types_up.h"
2310 typedef struct { } raw_spinlock_t;
2311
2312
2313
2314
2315
2316 typedef struct {
2317
2318
2319
2320
2321 } raw_rwlock_t;
2322 # 18 "include/linux/spinlock_types.h" 2
2323
2324
2325 typedef struct {
2326 raw_spinlock_t raw_lock;
2327 # 32 "include/linux/spinlock_types.h"
2328 } spinlock_t;
2329
2330
2331
2332 typedef struct {
2333 raw_rwlock_t raw_lock;
2334 # 48 "include/linux/spinlock_types.h"
2335 } rwlock_t;
2336 # 80 "include/linux/spinlock.h" 2
2337
2338 extern int __attribute__((section(".spinlock.text"))) generic__raw_read_trylock(raw_rwlock_t *lock);
2339
2340
2341
2342
2343
2344
2345
2346 # 1 "include/linux/spinlock_up.h" 1
2347 # 90 "include/linux/spinlock.h" 2
2348 # 135 "include/linux/spinlock.h"
2349 # 1 "include/linux/spinlock_api_up.h" 1
2350 # 136 "include/linux/spinlock.h" 2
2351 # 289 "include/linux/spinlock.h"
2352 static inline __attribute__((always_inline)) void double_spin_lock(spinlock_t *l1, spinlock_t *l2,
2353 bool l1_first)
2354
2355
2356 {
2357 if (l1_first) {
2358 do { do { } while (0); (void)0; (void)(l1); } while (0);
2359 do { do { } while (0); (void)0; (void)(l2); } while (0);
2360 } else {
2361 do { do { } while (0); (void)0; (void)(l2); } while (0);
2362 do { do { } while (0); (void)0; (void)(l1); } while (0);
2363 }
2364 }
2365
2366
2367
2368
2369
2370
2371 static inline __attribute__((always_inline)) void double_spin_unlock(spinlock_t *l1, spinlock_t *l2,
2372 bool l1_taken_first)
2373
2374
2375 {
2376 if (l1_taken_first) {
2377 do { do { } while (0); (void)0; (void)(l2); } while (0);
2378 do { do { } while (0); (void)0; (void)(l1); } while (0);
2379 } else {
2380 do { do { } while (0); (void)0; (void)(l1); } while (0);
2381 do { do { } while (0); (void)0; (void)(l2); } while (0);
2382 }
2383 }
2384
2385
2386
2387
2388
2389 # 1 "include/asm/atomic.h" 1
2390 # 16 "include/asm/atomic.h"
2391 typedef struct {
2392 int counter;
2393 } atomic_t;
2394
2395
2396
2397
2398
2399 static __inline__ __attribute__((always_inline)) void atomic_add(int i, atomic_t * v)
2400 {
2401 long flags;
2402
2403 __asm__ __volatile__( "cli %0;" : "=&d" (flags) );
2404 v->counter += i;
2405 do { if (((flags) != 0x1f)) __asm__ __volatile__( "sti %0;" : : "d" (irq_flags) ); } while (0);
2406 }
2407
2408 static __inline__ __attribute__((always_inline)) void atomic_sub(int i, atomic_t * v)
2409 {
2410 long flags;
2411
2412 __asm__ __volatile__( "cli %0;" : "=&d" (flags) );
2413 v->counter -= i;
2414 do { if (((flags) != 0x1f)) __asm__ __volatile__( "sti %0;" : : "d" (irq_flags) ); } while (0);
2415
2416 }
2417
2418 static inline __attribute__((always_inline)) int atomic_add_return(int i, atomic_t * v)
2419 {
2420 int __temp = 0;
2421 long flags;
2422
2423 __asm__ __volatile__( "cli %0;" : "=&d" (flags) );
2424 v->counter += i;
2425 __temp = v->counter;
2426 do { if (((flags) != 0x1f)) __asm__ __volatile__( "sti %0;" : : "d" (irq_flags) ); } while (0);
2427
2428
2429 return __temp;
2430 }
2431
2432
2433 static inline __attribute__((always_inline)) int atomic_sub_return(int i, atomic_t * v)
2434 {
2435 int __temp = 0;
2436 long flags;
2437
2438 __asm__ __volatile__( "cli %0;" : "=&d" (flags) );
2439 v->counter -= i;
2440 __temp = v->counter;
2441 do { if (((flags) != 0x1f)) __asm__ __volatile__( "sti %0;" : : "d" (irq_flags) ); } while (0);
2442
2443 return __temp;
2444 }
2445
2446 static __inline__ __attribute__((always_inline)) void atomic_inc(volatile atomic_t * v)
2447 {
2448 long flags;
2449
2450 __asm__ __volatile__( "cli %0;" : "=&d" (flags) );
2451 v->counter++;
2452 do { if (((flags) != 0x1f)) __asm__ __volatile__( "sti %0;" : : "d" (irq_flags) ); } while (0);
2453 }
2454 # 93 "include/asm/atomic.h"
2455 static __inline__ __attribute__((always_inline)) void atomic_dec(volatile atomic_t * v)
2456 {
2457 long flags;
2458
2459 __asm__ __volatile__( "cli %0;" : "=&d" (flags) );
2460 v->counter--;
2461 do { if (((flags) != 0x1f)) __asm__ __volatile__( "sti %0;" : : "d" (irq_flags) ); } while (0);
2462 }
2463
2464 static __inline__ __attribute__((always_inline)) void atomic_clear_mask(unsigned int mask, atomic_t * v)
2465 {
2466 long flags;
2467
2468 __asm__ __volatile__( "cli %0;" : "=&d" (flags) );
2469 v->counter &= ~mask;
2470 do { if (((flags) != 0x1f)) __asm__ __volatile__( "sti %0;" : : "d" (irq_flags) ); } while (0);
2471 }
2472
2473 static __inline__ __attribute__((always_inline)) void atomic_set_mask(unsigned int mask, atomic_t * v)
2474 {
2475 long flags;
2476
2477 __asm__ __volatile__( "cli %0;" : "=&d" (flags) );
2478 v->counter |= mask;
2479 do { if (((flags) != 0x1f)) __asm__ __volatile__( "sti %0;" : : "d" (irq_flags) ); } while (0);
2480 }
2481 # 142 "include/asm/atomic.h"
2482 # 1 "include/asm-generic/atomic.h" 1
2483 # 141 "include/asm-generic/atomic.h"
2484 typedef atomic_t atomic_long_t;
2485
2486
2487 static inline __attribute__((always_inline)) long atomic_long_read(atomic_long_t *l)
2488 {
2489 atomic_t *v = (atomic_t *)l;
2490
2491 return (long)((v)->counter);
2492 }
2493
2494 static inline __attribute__((always_inline)) void atomic_long_set(atomic_long_t *l, long i)
2495 {
2496 atomic_t *v = (atomic_t *)l;
2497
2498 (((v)->counter) = i);
2499 }
2500
2501 static inline __attribute__((always_inline)) void atomic_long_inc(atomic_long_t *l)
2502 {
2503 atomic_t *v = (atomic_t *)l;
2504
2505 atomic_inc(v);
2506 }
2507
2508 static inline __attribute__((always_inline)) void atomic_long_dec(atomic_long_t *l)
2509 {
2510 atomic_t *v = (atomic_t *)l;
2511
2512 atomic_dec(v);
2513 }
2514
2515 static inline __attribute__((always_inline)) void atomic_long_add(long i, atomic_long_t *l)
2516 {
2517 atomic_t *v = (atomic_t *)l;
2518
2519 atomic_add(i, v);
2520 }
2521
2522 static inline __attribute__((always_inline)) void atomic_long_sub(long i, atomic_long_t *l)
2523 {
2524 atomic_t *v = (atomic_t *)l;
2525
2526 atomic_sub(i, v);
2527 }
2528
2529 static inline __attribute__((always_inline)) int atomic_long_sub_and_test(long i, atomic_long_t *l)
2530 {
2531 atomic_t *v = (atomic_t *)l;
2532
2533 return (atomic_sub_return((i), (v)) == 0);
2534 }
2535
2536 static inline __attribute__((always_inline)) int atomic_long_dec_and_test(atomic_long_t *l)
2537 {
2538 atomic_t *v = (atomic_t *)l;
2539
2540 return (atomic_sub_return(1, (v)) == 0);
2541 }
2542
2543 static inline __attribute__((always_inline)) int atomic_long_inc_and_test(atomic_long_t *l)
2544 {
2545 atomic_t *v = (atomic_t *)l;
2546
2547 return (atomic_add_return(1,(v)) == 0);
2548 }
2549
2550 static inline __attribute__((always_inline)) int atomic_long_add_negative(long i, atomic_long_t *l)
2551 {
2552 atomic_t *v = (atomic_t *)l;
2553
2554 return (atomic_add_return((i), (v)) < 0);
2555 }
2556
2557 static inline __attribute__((always_inline)) long atomic_long_add_return(long i, atomic_long_t *l)
2558 {
2559 atomic_t *v = (atomic_t *)l;
2560
2561 return (long)atomic_add_return(i, v);
2562 }
2563
2564 static inline __attribute__((always_inline)) long atomic_long_sub_return(long i, atomic_long_t *l)
2565 {
2566 atomic_t *v = (atomic_t *)l;
2567
2568 return (long)atomic_sub_return(i, v);
2569 }
2570
2571 static inline __attribute__((always_inline)) long atomic_long_inc_return(atomic_long_t *l)
2572 {
2573 atomic_t *v = (atomic_t *)l;
2574
2575 return (long)atomic_add_return(1,(v));
2576 }
2577
2578 static inline __attribute__((always_inline)) long atomic_long_dec_return(atomic_long_t *l)
2579 {
2580 atomic_t *v = (atomic_t *)l;
2581
2582 return (long)atomic_sub_return(1,(v));
2583 }
2584
2585 static inline __attribute__((always_inline)) long atomic_long_add_unless(atomic_long_t *l, long a, long u)
2586 {
2587 atomic_t *v = (atomic_t *)l;
2588
2589 return (long)({ int c, old; c = ((v)->counter); while (c != (u) && (old = ((int)((__typeof__(*(&(((v))->counter))))__cmpxchg((&(((v))->counter)),(unsigned long)((c)), (unsigned long)((c + (a))),sizeof(*(&(((v))->counter))))))) != c) c = old; c != (u); });
2590 }
2591 # 143 "include/asm/atomic.h" 2
2592 # 327 "include/linux/spinlock.h" 2
2593
2594
2595
2596
2597
2598 extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock);
2599 # 25 "include/linux/wait.h" 2
2600
2601 # 1 "include/asm/current.h" 1
2602 # 13 "include/asm/current.h"
2603 struct task_struct;
2604
2605 static inline __attribute__((always_inline)) struct task_struct *get_current(void) __attribute__ ((__const__));
2606 static inline __attribute__((always_inline)) struct task_struct *get_current(void)
2607 {
2608 return (current_thread_info()->task);
2609 }
2610 # 27 "include/linux/wait.h" 2
2611
2612 typedef struct __wait_queue wait_queue_t;
2613 typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int sync, void *key);
2614 int default_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
2615
2616 struct __wait_queue {
2617 unsigned int flags;
2618
2619 void *private;
2620 wait_queue_func_t func;
2621 struct list_head task_list;
2622 };
2623
2624 struct wait_bit_key {
2625 void *flags;
2626 int bit_nr;
2627 };
2628
2629 struct wait_bit_queue {
2630 struct wait_bit_key key;
2631 wait_queue_t wait;
2632 };
2633
2634 struct __wait_queue_head {
2635 spinlock_t lock;
2636 struct list_head task_list;
2637 };
2638 typedef struct __wait_queue_head wait_queue_head_t;
2639
2640 struct task_struct;
2641 # 80 "include/linux/wait.h"
2642 extern void init_waitqueue_head(wait_queue_head_t *q);
2643 # 91 "include/linux/wait.h"
2644 static inline __attribute__((always_inline)) void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p)
2645 {
2646 q->flags = 0;
2647 q->private = p;
2648 q->func = default_wake_function;
2649 }
2650
2651 static inline __attribute__((always_inline)) void init_waitqueue_func_entry(wait_queue_t *q,
2652 wait_queue_func_t func)
2653 {
2654 q->flags = 0;
2655 q->private = ((void *)0);
2656 q->func = func;
2657 }
2658
2659 static inline __attribute__((always_inline)) int waitqueue_active(wait_queue_head_t *q)
2660 {
2661 return !list_empty(&q->task_list);
2662 }
2663 # 120 "include/linux/wait.h"
2664 extern void add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait);
2665 extern void add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t * wait);
2666 extern void remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait);
2667
2668 static inline __attribute__((always_inline)) void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new)
2669 {
2670 list_add(&new->task_list, &head->task_list);
2671 }
2672
2673
2674
2675
2676 static inline __attribute__((always_inline)) void __add_wait_queue_tail(wait_queue_head_t *head,
2677 wait_queue_t *new)
2678 {
2679 list_add_tail(&new->task_list, &head->task_list);
2680 }
2681
2682 static inline __attribute__((always_inline)) void __remove_wait_queue(wait_queue_head_t *head,
2683 wait_queue_t *old)
2684 {
2685 list_del(&old->task_list);
2686 }
2687
2688 void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key);
2689 extern void __wake_up_locked(wait_queue_head_t *q, unsigned int mode);
2690 extern void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr);
2691 void __wake_up_bit(wait_queue_head_t *, void *, int);
2692 int __wait_on_bit(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned);
2693 int __wait_on_bit_lock(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned);
2694 void wake_up_bit(void *, int);
2695 int out_of_line_wait_on_bit(void *, int, int (*)(void *), unsigned);
2696 int out_of_line_wait_on_bit_lock(void *, int, int (*)(void *), unsigned);
2697 wait_queue_head_t *bit_waitqueue(void *, int);
2698 # 351 "include/linux/wait.h"
2699 static inline __attribute__((always_inline)) void add_wait_queue_exclusive_locked(wait_queue_head_t *q,
2700 wait_queue_t * wait)
2701 {
2702 wait->flags |= 0x01;
2703 __add_wait_queue_tail(q, wait);
2704 }
2705
2706
2707
2708
2709 static inline __attribute__((always_inline)) void remove_wait_queue_locked(wait_queue_head_t *q,
2710 wait_queue_t * wait)
2711 {
2712 __remove_wait_queue(q, wait);
2713 }
2714
2715
2716
2717
2718
2719
2720 extern void sleep_on(wait_queue_head_t *q);
2721 extern long sleep_on_timeout(wait_queue_head_t *q, signed long timeout);
2722
2723 extern void interruptible_sleep_on(wait_queue_head_t *q);
2724 extern long interruptible_sleep_on_timeout(wait_queue_head_t *q, signed long timeout);
2725
2726
2727
2728
2729
2730 void prepare_to_wait(wait_queue_head_t *q, wait_queue_t *wait, int state);
2731
2732 void prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int state);
2733
2734 void finish_wait(wait_queue_head_t *q, wait_queue_t *wait);
2735 int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
2736 int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
2737 # 429 "include/linux/wait.h"
2738 static inline __attribute__((always_inline)) int wait_on_bit(void *word, int bit,
2739 int (*action)(void *), unsigned mode)
2740 {
2741 if (!(__builtin_constant_p(bit) ? __constant_test_bit((bit),(word)) : __test_bit((bit),(word))))
2742 return 0;
2743 return out_of_line_wait_on_bit(word, bit, action, mode);
2744 }
2745 # 453 "include/linux/wait.h"
2746 static inline __attribute__((always_inline)) int wait_on_bit_lock(void *word, int bit,
2747 int (*action)(void *), unsigned mode)
2748 {
2749 if (!test_and_set_bit(bit, word))
2750 return 0;
2751 return out_of_line_wait_on_bit_lock(word, bit, action, mode);
2752 }
2753 # 273 "include/linux/fs.h" 2
2754
2755 # 1 "include/linux/kdev_t.h" 1
2756 # 21 "include/linux/kdev_t.h"
2757 static inline __attribute__((always_inline)) int old_valid_dev(dev_t dev)
2758 {
2759 return ((unsigned int) ((dev) >> 20)) < 256 && ((unsigned int) ((dev) & ((1U << 20) - 1))) < 256;
2760 }
2761
2762 static inline __attribute__((always_inline)) u16 old_encode_dev(dev_t dev)
2763 {
2764 return (((unsigned int) ((dev) >> 20)) << 8) | ((unsigned int) ((dev) & ((1U << 20) - 1)));
2765 }
2766
2767 static inline __attribute__((always_inline)) dev_t old_decode_dev(u16 val)
2768 {
2769 return ((((val >> 8) & 255) << 20) | (val & 255));
2770 }
2771
2772 static inline __attribute__((always_inline)) int new_valid_dev(dev_t dev)
2773 {
2774 return 1;
2775 }
2776
2777 static inline __attribute__((always_inline)) u32 new_encode_dev(dev_t dev)
2778 {
2779 unsigned major = ((unsigned int) ((dev) >> 20));
2780 unsigned minor = ((unsigned int) ((dev) & ((1U << 20) - 1)));
2781 return (minor & 0xff) | (major << 8) | ((minor & ~0xff) << 12);
2782 }
2783
2784 static inline __attribute__((always_inline)) dev_t new_decode_dev(u32 dev)
2785 {
2786 unsigned major = (dev & 0xfff00) >> 8;
2787 unsigned minor = (dev & 0xff) | ((dev >> 12) & 0xfff00);
2788 return (((major) << 20) | (minor));
2789 }
2790
2791 static inline __attribute__((always_inline)) int huge_valid_dev(dev_t dev)
2792 {
2793 return 1;
2794 }
2795
2796 static inline __attribute__((always_inline)) u64 huge_encode_dev(dev_t dev)
2797 {
2798 return new_encode_dev(dev);
2799 }
2800
2801 static inline __attribute__((always_inline)) dev_t huge_decode_dev(u64 dev)
2802 {
2803 return new_decode_dev(dev);
2804 }
2805
2806 static inline __attribute__((always_inline)) int sysv_valid_dev(dev_t dev)
2807 {
2808 return ((unsigned int) ((dev) >> 20)) < (1<<14) && ((unsigned int) ((dev) & ((1U << 20) - 1))) < (1<<18);
2809 }
2810
2811 static inline __attribute__((always_inline)) u32 sysv_encode_dev(dev_t dev)
2812 {
2813 return ((unsigned int) ((dev) & ((1U << 20) - 1))) | (((unsigned int) ((dev) >> 20)) << 18);
2814 }
2815
2816 static inline __attribute__((always_inline)) unsigned sysv_major(u32 dev)
2817 {
2818 return (dev >> 18) & 0x3fff;
2819 }
2820
2821 static inline __attribute__((always_inline)) unsigned sysv_minor(u32 dev)
2822 {
2823 return dev & 0x3ffff;
2824 }
2825 # 275 "include/linux/fs.h" 2
2826 # 1 "include/linux/dcache.h" 1
2827 # 9 "include/linux/dcache.h"
2828 # 1 "include/linux/cache.h" 1
2829 # 10 "include/linux/dcache.h" 2
2830 # 1 "include/linux/rcupdate.h" 1
2831 # 40 "include/linux/rcupdate.h"
2832 # 1 "include/linux/threads.h" 1
2833 # 41 "include/linux/rcupdate.h" 2
2834 # 1 "include/linux/percpu.h" 1
2835
2836
2837
2838
2839 # 1 "include/linux/slab.h" 1
2840 # 14 "include/linux/slab.h"
2841 # 1 "include/linux/gfp.h" 1
2842
2843
2844
2845 # 1 "include/linux/mmzone.h" 1
2846 # 12 "include/linux/mmzone.h"
2847 # 1 "include/linux/numa.h" 1
2848 # 13 "include/linux/mmzone.h" 2
2849
2850 # 1 "include/linux/seqlock.h" 1
2851 # 32 "include/linux/seqlock.h"
2852 typedef struct {
2853 unsigned sequence;
2854 spinlock_t lock;
2855 } seqlock_t;
2856 # 60 "include/linux/seqlock.h"
2857 static inline __attribute__((always_inline)) void write_seqlock(seqlock_t *sl)
2858 {
2859 do { do { } while (0); (void)0; (void)(&sl->lock); } while (0);
2860 ++sl->sequence;
2861 __asm__ __volatile__("": : :"memory");
2862 }
2863
2864 static inline __attribute__((always_inline)) void write_sequnlock(seqlock_t *sl)
2865 {
2866 __asm__ __volatile__("": : :"memory");
2867 sl->sequence++;
2868 do { do { } while (0); (void)0; (void)(&sl->lock); } while (0);
2869 }
2870
2871 static inline __attribute__((always_inline)) int write_tryseqlock(seqlock_t *sl)
2872 {
2873 int ret = (({ do { do { } while (0); (void)0; (void)(&sl->lock); } while (0); 1; }));
2874
2875 if (ret) {
2876 ++sl->sequence;
2877 __asm__ __volatile__("": : :"memory");
2878 }
2879 return ret;
2880 }
2881
2882
2883 static inline __attribute__((always_inline)) __attribute__((always_inline)) unsigned read_seqbegin(const seqlock_t *sl)
2884 {
2885 unsigned ret = sl->sequence;
2886 __asm__ __volatile__("": : :"memory");
2887 return ret;
2888 }
2889 # 101 "include/linux/seqlock.h"
2890 static inline __attribute__((always_inline)) __attribute__((always_inline)) int read_seqretry(const seqlock_t *sl, unsigned iv)
2891 {
2892 __asm__ __volatile__("": : :"memory");
2893 return (iv & 1) | (sl->sequence ^ iv);
2894 }
2895 # 115 "include/linux/seqlock.h"
2896 typedef struct seqcount {
2897 unsigned sequence;
2898 } seqcount_t;
2899
2900
2901
2902
2903
2904 static inline __attribute__((always_inline)) unsigned read_seqcount_begin(const seqcount_t *s)
2905 {
2906 unsigned ret = s->sequence;
2907 __asm__ __volatile__("": : :"memory");
2908 return ret;
2909 }
2910
2911
2912
2913
2914
2915
2916 static inline __attribute__((always_inline)) int read_seqcount_retry(const seqcount_t *s, unsigned iv)
2917 {
2918 __asm__ __volatile__("": : :"memory");
2919 return (iv & 1) | (s->sequence ^ iv);
2920 }
2921
2922
2923
2924
2925
2926
2927 static inline __attribute__((always_inline)) void write_seqcount_begin(seqcount_t *s)
2928 {
2929 s->sequence++;
2930 __asm__ __volatile__("": : :"memory");
2931 }
2932
2933 static inline __attribute__((always_inline)) void write_seqcount_end(seqcount_t *s)
2934 {
2935 __asm__ __volatile__("": : :"memory");
2936 s->sequence++;
2937 }
2938 # 15 "include/linux/mmzone.h" 2
2939 # 1 "include/linux/nodemask.h" 1
2940 # 85 "include/linux/nodemask.h"
2941 # 1 "include/linux/bitmap.h" 1
2942
2943
2944
2945
2946
2947
2948
2949 # 1 "include/linux/string.h" 1
2950 # 16 "include/linux/string.h"
2951 extern char *strndup_user(const char *, long);
2952
2953
2954
2955
2956 # 1 "include/asm/string.h" 1
2957 # 9 "include/asm/string.h"
2958 extern inline __attribute__((always_inline)) char *strcpy(char *dest, const char *src)
2959 {
2960 char *xdest = dest;
2961 char temp = 0;
2962
2963 __asm__ __volatile__ (
2964 "1:"
2965 "%2 = B [%1++] (Z);"
2966 "B [%0++] = %2;"
2967 "CC = %2;"
2968 "if cc jump 1b (bp);"
2969 : "+&a" (dest), "+&a" (src), "=&d" (temp)
2970 :
2971 : "memory", "CC");
2972
2973 return xdest;
2974 }
2975
2976
2977 extern inline __attribute__((always_inline)) char *strncpy(char *dest, const char *src, size_t n)
2978 {
2979 char *xdest = dest;
2980 char temp = 0;
2981
2982 if (n == 0)
2983 return xdest;
2984
2985 __asm__ __volatile__ (
2986 "1:"
2987 "%3 = B [%1++] (Z);"
2988 "B [%0++] = %3;"
2989 "CC = %3;"
2990 "if ! cc jump 2f;"
2991 "%2 += -1;"
2992 "CC = %2 == 0;"
2993 "if ! cc jump 1b (bp);"
2994 "jump 4f;"
2995 "2:"
2996
2997 "%3 = 0;"
2998 "3:"
2999 "%2 += -1;"
3000 "CC = %2 == 0;"
3001 "if cc jump 4f;"
3002 "B [%0++] = %3;"
3003 "jump 3b;"
3004 "4:"
3005 : "+&a" (dest), "+&a" (src), "+&da" (n), "=&d" (temp)
3006 :
3007 : "memory", "CC");
3008
3009 return xdest;
3010 }
3011
3012
3013 extern inline __attribute__((always_inline)) int strcmp(const char *cs, const char *ct)
3014 {
3015
3016
3017
3018 int __res1, __res2;
3019
3020 __asm__ __volatile__ (
3021 "1:"
3022 "%2 = B[%0++] (Z);"
3023 "%3 = B[%1++] (Z);"
3024 "CC = %2 == %3;"
3025 "if ! cc jump 2f;"
3026 "CC = %2;"
3027 "if cc jump 1b (bp);"
3028 "jump.s 3f;"
3029 "2:"
3030 "%2 = %2 - %3;"
3031 "3:"
3032 : "+&a" (cs), "+&a" (ct), "=&d" (__res1), "=&d" (__res2)
3033 :
3034 : "memory", "CC");
3035
3036 return __res1;
3037 }
3038
3039
3040 extern inline __attribute__((always_inline)) int strncmp(const char *cs, const char *ct, size_t count)
3041 {
3042
3043
3044
3045 int __res1, __res2;
3046
3047 if (!count)
3048 return 0;
3049
3050 __asm__ __volatile__ (
3051 "1:"
3052 "%3 = B[%0++] (Z);"
3053 "%4 = B[%1++] (Z);"
3054 "CC = %3 == %4;"
3055 "if ! cc jump 3f;"
3056 "CC = %3;"
3057 "if ! cc jump 4f;"
3058 "%2 += -1;"
3059 "CC = %2 == 0;"
3060 "if ! cc jump 1b;"
3061 "2:"
3062 "%3 = 0;"
3063 "jump.s 4f;"
3064 "3:"
3065 "%3 = %3 - %4;"
3066 "4:"
3067 : "+&a" (cs), "+&a" (ct), "+&da" (count), "=&d" (__res1), "=&d" (__res2)
3068 :
3069 : "memory", "CC");
3070
3071 return __res1;
3072 }
3073
3074
3075 extern void *memset(void *s, int c, size_t count);
3076
3077 extern void *memcpy(void *d, const void *s, size_t count);
3078
3079 extern int memcmp(const void *, const void *, __kernel_size_t);
3080
3081 extern void *memchr(const void *s, int c, size_t n);
3082
3083 extern void *memmove(void *dest, const void *src, size_t count);
3084 # 22 "include/linux/string.h" 2
3085 # 30 "include/linux/string.h"
3086 size_t strlcpy(char *, const char *, size_t);
3087
3088
3089 extern char * strcat(char *, const char *);
3090
3091
3092 extern char * strncat(char *, const char *, __kernel_size_t);
3093
3094
3095 extern size_t strlcat(char *, const char *, __kernel_size_t);
3096 # 48 "include/linux/string.h"
3097 extern int strnicmp(const char *, const char *, __kernel_size_t);
3098
3099
3100 extern int strcasecmp(const char *s1, const char *s2);
3101
3102
3103 extern int strncasecmp(const char *s1, const char *s2, size_t n);
3104
3105
3106 extern char * strchr(const char *,int);
3107
3108
3109 extern char * strnchr(const char *, size_t, int);
3110
3111
3112 extern char * strrchr(const char *,int);
3113
3114 extern char * strstrip(char *);
3115
3116 extern char * strstr(const char *,const char *);
3117
3118
3119 extern __kernel_size_t strlen(const char *);
3120
3121
3122 extern __kernel_size_t strnlen(const char *,__kernel_size_t);
3123
3124
3125 extern char * strpbrk(const char *,const char *);
3126
3127
3128 extern char * strsep(char **,const char *);
3129
3130
3131 extern __kernel_size_t strspn(const char *,const char *);
3132
3133
3134 extern __kernel_size_t strcspn(const char *,const char *);
3135 # 98 "include/linux/string.h"
3136 extern void * memscan(void *,int,__kernel_size_t);
3137 # 107 "include/linux/string.h"
3138 extern char *kstrdup(const char *s, gfp_t gfp);
3139 extern void *kmemdup(const void *src, size_t len, gfp_t gfp);
3140 # 9 "include/linux/bitmap.h" 2
3141 # 84 "include/linux/bitmap.h"
3142 extern int __bitmap_empty(const unsigned long *bitmap, int bits);
3143 extern int __bitmap_full(const unsigned long *bitmap, int bits);
3144 extern int __bitmap_equal(const unsigned long *bitmap1,
3145 const unsigned long *bitmap2, int bits);
3146 extern void __bitmap_complement(unsigned long *dst, const unsigned long *src,
3147 int bits);
3148 extern void __bitmap_shift_right(unsigned long *dst,
3149 const unsigned long *src, int shift, int bits);
3150 extern void __bitmap_shift_left(unsigned long *dst,
3151 const unsigned long *src, int shift, int bits);
3152 extern void __bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
3153 const unsigned long *bitmap2, int bits);
3154 extern void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1,
3155 const unsigned long *bitmap2, int bits);
3156 extern void __bitmap_xor(unsigned long *dst, const unsigned long *bitmap1,
3157 const unsigned long *bitmap2, int bits);
3158 extern void __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1,
3159 const unsigned long *bitmap2, int bits);
3160 extern int __bitmap_intersects(const unsigned long *bitmap1,
3161 const unsigned long *bitmap2, int bits);
3162 extern int __bitmap_subset(const unsigned long *bitmap1,
3163 const unsigned long *bitmap2, int bits);
3164 extern int __bitmap_weight(const unsigned long *bitmap, int bits);
3165
3166 extern int bitmap_scnprintf(char *buf, unsigned int len,
3167 const unsigned long *src, int nbits);
3168 extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user,
3169 unsigned long *dst, int nbits);
3170 extern int bitmap_parse_user(const char *ubuf, unsigned int ulen,
3171 unsigned long *dst, int nbits);
3172 extern int bitmap_scnlistprintf(char *buf, unsigned int len,
3173 const unsigned long *src, int nbits);
3174 extern int bitmap_parselist(const char *buf, unsigned long *maskp,
3175 int nmaskbits);
3176 extern void bitmap_remap(unsigned long *dst, const unsigned long *src,
3177 const unsigned long *old, const unsigned long *new, int bits);
3178 extern int bitmap_bitremap(int oldbit,
3179 const unsigned long *old, const unsigned long *new, int bits);
3180 extern int bitmap_find_free_region(unsigned long *bitmap, int bits, int order);
3181 extern void bitmap_release_region(unsigned long *bitmap, int pos, int order);
3182 extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order);
3183
3184
3185
3186
3187
3188
3189
3190 static inline __attribute__((always_inline)) void bitmap_zero(unsigned long *dst, int nbits)
3191 {
3192 if (nbits <= 32)
3193 *dst = 0UL;
3194 else {
3195 int len = (((nbits)+32 -1)/32) * sizeof(unsigned long);
3196 memset(dst, 0, len);
3197 }
3198 }
3199
3200 static inline __attribute__((always_inline)) void bitmap_fill(unsigned long *dst, int nbits)
3201 {
3202 size_t nlongs = (((nbits)+32 -1)/32);
3203 if (nlongs > 1) {
3204 int len = (nlongs - 1) * sizeof(unsigned long);
3205 memset(dst, 0xff, len);
3206 }
3207 dst[nlongs - 1] = ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL );
3208 }
3209
3210 static inline __attribute__((always_inline)) void bitmap_copy(unsigned long *dst, const unsigned long *src,
3211 int nbits)
3212 {
3213 if (nbits <= 32)
3214 *dst = *src;
3215 else {
3216 int len = (((nbits)+32 -1)/32) * sizeof(unsigned long);
3217 memcpy(dst, src, len);
3218 }
3219 }
3220
3221 static inline __attribute__((always_inline)) void bitmap_and(unsigned long *dst, const unsigned long *src1,
3222 const unsigned long *src2, int nbits)
3223 {
3224 if (nbits <= 32)
3225 *dst = *src1 & *src2;
3226 else
3227 __bitmap_and(dst, src1, src2, nbits);
3228 }
3229
3230 static inline __attribute__((always_inline)) void bitmap_or(unsigned long *dst, const unsigned long *src1,
3231 const unsigned long *src2, int nbits)
3232 {
3233 if (nbits <= 32)
3234 *dst = *src1 | *src2;
3235 else
3236 __bitmap_or(dst, src1, src2, nbits);
3237 }
3238
3239 static inline __attribute__((always_inline)) void bitmap_xor(unsigned long *dst, const unsigned long *src1,
3240 const unsigned long *src2, int nbits)
3241 {
3242 if (nbits <= 32)
3243 *dst = *src1 ^ *src2;
3244 else
3245 __bitmap_xor(dst, src1, src2, nbits);
3246 }
3247
3248 static inline __attribute__((always_inline)) void bitmap_andnot(unsigned long *dst, const unsigned long *src1,
3249 const unsigned long *src2, int nbits)
3250 {
3251 if (nbits <= 32)
3252 *dst = *src1 & ~(*src2);
3253 else
3254 __bitmap_andnot(dst, src1, src2, nbits);
3255 }
3256
3257 static inline __attribute__((always_inline)) void bitmap_complement(unsigned long *dst, const unsigned long *src,
3258 int nbits)
3259 {
3260 if (nbits <= 32)
3261 *dst = ~(*src) & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL );
3262 else
3263 __bitmap_complement(dst, src, nbits);
3264 }
3265
3266 static inline __attribute__((always_inline)) int bitmap_equal(const unsigned long *src1,
3267 const unsigned long *src2, int nbits)
3268 {
3269 if (nbits <= 32)
3270 return ! ((*src1 ^ *src2) & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL ));
3271 else
3272 return __bitmap_equal(src1, src2, nbits);
3273 }
3274
3275 static inline __attribute__((always_inline)) int bitmap_intersects(const unsigned long *src1,
3276 const unsigned long *src2, int nbits)
3277 {
3278 if (nbits <= 32)
3279 return ((*src1 & *src2) & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL )) != 0;
3280 else
3281 return __bitmap_intersects(src1, src2, nbits);
3282 }
3283
3284 static inline __attribute__((always_inline)) int bitmap_subset(const unsigned long *src1,
3285 const unsigned long *src2, int nbits)
3286 {
3287 if (nbits <= 32)
3288 return ! ((*src1 & ~(*src2)) & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL ));
3289 else
3290 return __bitmap_subset(src1, src2, nbits);
3291 }
3292
3293 static inline __attribute__((always_inline)) int bitmap_empty(const unsigned long *src, int nbits)
3294 {
3295 if (nbits <= 32)
3296 return ! (*src & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL ));
3297 else
3298 return __bitmap_empty(src, nbits);
3299 }
3300
3301 static inline __attribute__((always_inline)) int bitmap_full(const unsigned long *src, int nbits)
3302 {
3303 if (nbits <= 32)
3304 return ! (~(*src) & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL ));
3305 else
3306 return __bitmap_full(src, nbits);
3307 }
3308
3309 static inline __attribute__((always_inline)) int bitmap_weight(const unsigned long *src, int nbits)
3310 {
3311 if (nbits <= 32)
3312 return hweight_long(*src & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL ));
3313 return __bitmap_weight(src, nbits);
3314 }
3315
3316 static inline __attribute__((always_inline)) void bitmap_shift_right(unsigned long *dst,
3317 const unsigned long *src, int n, int nbits)
3318 {
3319 if (nbits <= 32)
3320 *dst = *src >> n;
3321 else
3322 __bitmap_shift_right(dst, src, n, nbits);
3323 }
3324
3325 static inline __attribute__((always_inline)) void bitmap_shift_left(unsigned long *dst,
3326 const unsigned long *src, int n, int nbits)
3327 {
3328 if (nbits <= 32)
3329 *dst = (*src << n) & ( ((nbits) % 32) ? (1UL<<((nbits) % 32))-1 : ~0UL );
3330 else
3331 __bitmap_shift_left(dst, src, n, nbits);
3332 }
3333
3334 static inline __attribute__((always_inline)) int bitmap_parse(const char *buf, unsigned int buflen,
3335 unsigned long *maskp, int nmaskbits)
3336 {
3337 return __bitmap_parse(buf, buflen, 0, maskp, nmaskbits);
3338 }
3339 # 86 "include/linux/nodemask.h" 2
3340
3341
3342 typedef struct { unsigned long bits[((((1 << 0))+32 -1)/32)]; } nodemask_t;
3343 extern nodemask_t _unused_nodemask_arg_;
3344
3345
3346 static inline __attribute__((always_inline)) void __node_set(int node, volatile nodemask_t *dstp)
3347 {
3348 set_bit(node, dstp->bits);
3349 }
3350
3351
3352 static inline __attribute__((always_inline)) void __node_clear(int node, volatile nodemask_t *dstp)
3353 {
3354 clear_bit(node, dstp->bits);
3355 }
3356
3357
3358 static inline __attribute__((always_inline)) void __nodes_setall(nodemask_t *dstp, int nbits)
3359 {
3360 bitmap_fill(dstp->bits, nbits);
3361 }
3362
3363
3364 static inline __attribute__((always_inline)) void __nodes_clear(nodemask_t *dstp, int nbits)
3365 {
3366 bitmap_zero(dstp->bits, nbits);
3367 }
3368
3369
3370
3371
3372
3373
3374 static inline __attribute__((always_inline)) int __node_test_and_set(int node, nodemask_t *addr)
3375 {
3376 return test_and_set_bit(node, addr->bits);
3377 }
3378
3379
3380
3381 static inline __attribute__((always_inline)) void __nodes_and(nodemask_t *dstp, const nodemask_t *src1p,
3382 const nodemask_t *src2p, int nbits)
3383 {
3384 bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits);
3385 }
3386
3387
3388
3389 static inline __attribute__((always_inline)) void __nodes_or(nodemask_t *dstp, const nodemask_t *src1p,
3390 const nodemask_t *src2p, int nbits)
3391 {
3392 bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits);
3393 }
3394
3395
3396
3397 static inline __attribute__((always_inline)) void __nodes_xor(nodemask_t *dstp, const nodemask_t *src1p,
3398 const nodemask_t *src2p, int nbits)
3399 {
3400 bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits);
3401 }
3402
3403
3404
3405 static inline __attribute__((always_inline)) void __nodes_andnot(nodemask_t *dstp, const nodemask_t *src1p,
3406 const nodemask_t *src2p, int nbits)
3407 {
3408 bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);
3409 }
3410
3411
3412
3413 static inline __attribute__((always_inline)) void __nodes_complement(nodemask_t *dstp,
3414 const nodemask_t *srcp, int nbits)
3415 {
3416 bitmap_complement(dstp->bits, srcp->bits, nbits);
3417 }
3418
3419
3420
3421 static inline __attribute__((always_inline)) int __nodes_equal(const nodemask_t *src1p,
3422 const nodemask_t *src2p, int nbits)
3423 {
3424 return bitmap_equal(src1p->bits, src2p->bits, nbits);
3425 }
3426
3427
3428
3429 static inline __attribute__((always_inline)) int __nodes_intersects(const nodemask_t *src1p,
3430 const nodemask_t *src2p, int nbits)
3431 {
3432 return bitmap_intersects(src1p->bits, src2p->bits, nbits);
3433 }
3434
3435
3436
3437 static inline __attribute__((always_inline)) int __nodes_subset(const nodemask_t *src1p,
3438 const nodemask_t *src2p, int nbits)
3439 {
3440 return bitmap_subset(src1p->bits, src2p->bits, nbits);
3441 }
3442
3443
3444 static inline __attribute__((always_inline)) int __nodes_empty(const nodemask_t *srcp, int nbits)
3445 {
3446 return bitmap_empty(srcp->bits, nbits);
3447 }
3448
3449
3450 static inline __attribute__((always_inline)) int __nodes_full(const nodemask_t *srcp, int nbits)
3451 {
3452 return bitmap_full(srcp->bits, nbits);
3453 }
3454
3455
3456 static inline __attribute__((always_inline)) int __nodes_weight(const nodemask_t *srcp, int nbits)
3457 {
3458 return bitmap_weight(srcp->bits, nbits);
3459 }
3460
3461
3462
3463 static inline __attribute__((always_inline)) void __nodes_shift_right(nodemask_t *dstp,
3464 const nodemask_t *srcp, int n, int nbits)
3465 {
3466 bitmap_shift_right(dstp->bits, srcp->bits, n, nbits);
3467 }
3468
3469
3470
3471 static inline __attribute__((always_inline)) void __nodes_shift_left(nodemask_t *dstp,
3472 const nodemask_t *srcp, int n, int nbits)
3473 {
3474 bitmap_shift_left(dstp->bits, srcp->bits, n, nbits);
3475 }
3476
3477
3478
3479
3480
3481 static inline __attribute__((always_inline)) int __first_node(const nodemask_t *srcp)
3482 {
3483 return ({ int __x = ((1 << 0)); int __y = (find_next_bit((srcp->bits), ((1 << 0)), 0)); __x < __y ? __x: __y; });
3484 }
3485
3486
3487 static inline __attribute__((always_inline)) int __next_node(int n, const nodemask_t *srcp)
3488 {
3489 return ({ int __x = ((1 << 0)); int __y = (find_next_bit(srcp->bits, (1 << 0), n+1)); __x < __y ? __x: __y; });
3490 }
3491 # 251 "include/linux/nodemask.h"
3492 static inline __attribute__((always_inline)) int __first_unset_node(const nodemask_t *maskp)
3493 {
3494 return ({ int __x = ((1 << 0)); int __y = (find_next_zero_bit((maskp->bits), ((1 << 0)), 0)); __x < __y ? __x: __y; });
3495
3496 }
3497 # 285 "include/linux/nodemask.h"
3498 static inline __attribute__((always_inline)) int __nodemask_scnprintf(char *buf, int len,
3499 const nodemask_t *srcp, int nbits)
3500 {
3501 return bitmap_scnprintf(buf, len, srcp->bits, nbits);
3502 }
3503
3504
3505
3506 static inline __attribute__((always_inline)) int __nodemask_parse_user(const char *buf, int len,
3507 nodemask_t *dstp, int nbits)
3508 {
3509 return bitmap_parse_user(buf, len, dstp->bits, nbits);
3510 }
3511
3512
3513
3514 static inline __attribute__((always_inline)) int __nodelist_scnprintf(char *buf, int len,
3515 const nodemask_t *srcp, int nbits)
3516 {
3517 return bitmap_scnlistprintf(buf, len, srcp->bits, nbits);
3518 }
3519
3520
3521 static inline __attribute__((always_inline)) int __nodelist_parse(const char *buf, nodemask_t *dstp, int nbits)
3522 {
3523 return bitmap_parselist(buf, dstp->bits, nbits);
3524 }
3525
3526
3527
3528 static inline __attribute__((always_inline)) int __node_remap(int oldbit,
3529 const nodemask_t *oldp, const nodemask_t *newp, int nbits)
3530 {
3531 return bitmap_bitremap(oldbit, oldp->bits, newp->bits, nbits);
3532 }
3533
3534
3535
3536 static inline __attribute__((always_inline)) void __nodes_remap(nodemask_t *dstp, const nodemask_t *srcp,
3537 const nodemask_t *oldp, const nodemask_t *newp, int nbits)
3538 {
3539 bitmap_remap(dstp->bits, srcp->bits, oldp->bits, newp->bits, nbits);
3540 }
3541 # 345 "include/linux/nodemask.h"
3542 extern nodemask_t node_online_map;
3543 extern nodemask_t node_possible_map;
3544 # 16 "include/linux/mmzone.h" 2
3545 # 27 "include/linux/mmzone.h"
3546 struct free_area {
3547 struct list_head free_list;
3548 unsigned long nr_free;
3549 };
3550
3551 struct pglist_data;
3552 # 49 "include/linux/mmzone.h"
3553 enum zone_stat_item {
3554
3555 NR_FREE_PAGES,
3556 NR_INACTIVE,
3557 NR_ACTIVE,
3558 NR_ANON_PAGES,
3559 NR_FILE_MAPPED,
3560
3561 NR_FILE_PAGES,
3562 NR_FILE_DIRTY,
3563 NR_WRITEBACK,
3564
3565 NR_SLAB_RECLAIMABLE,
3566 NR_SLAB_UNRECLAIMABLE,
3567 NR_PAGETABLE,
3568 NR_UNSTABLE_NFS,
3569 NR_BOUNCE,
3570 NR_VMSCAN_WRITE,
3571 # 75 "include/linux/mmzone.h"
3572 NR_VM_ZONE_STAT_ITEMS };
3573
3574 struct per_cpu_pages {
3575 int count;
3576 int high;
3577 int batch;
3578 struct list_head list;
3579 };
3580
3581 struct per_cpu_pageset {
3582 struct per_cpu_pages pcp[2];
3583
3584
3585
3586
3587
3588
3589
3590 } ;
3591
3592
3593
3594
3595
3596
3597
3598 enum zone_type {
3599 # 122 "include/linux/mmzone.h"
3600 ZONE_DMA,
3601 # 137 "include/linux/mmzone.h"
3602 ZONE_NORMAL,
3603 # 149 "include/linux/mmzone.h"
3604 MAX_NR_ZONES
3605 };
3606 # 182 "include/linux/mmzone.h"
3607 struct zone {
3608
3609 unsigned long pages_min, pages_low, pages_high;
3610 # 193 "include/linux/mmzone.h"
3611 unsigned long lowmem_reserve[MAX_NR_ZONES];
3612
3613 unsigned long max_pagecache_pages;
3614 # 206 "include/linux/mmzone.h"
3615 struct per_cpu_pageset pageset[1];
3616
3617
3618
3619
3620 spinlock_t lock;
3621
3622
3623
3624
3625 struct free_area free_area[14];
3626
3627
3628
3629
3630
3631
3632
3633 spinlock_t lru_lock;
3634 struct list_head active_list;
3635 struct list_head inactive_list;
3636 unsigned long nr_scan_active;
3637 unsigned long nr_scan_inactive;
3638 unsigned long pages_scanned;
3639 int all_unreclaimable;
3640
3641
3642 atomic_t reclaim_in_progress;
3643
3644
3645 atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
3646 # 251 "include/linux/mmzone.h"
3647 int prev_priority;
3648
3649
3650
3651 # 281 "include/linux/mmzone.h"
3652 wait_queue_head_t * wait_table;
3653 unsigned long wait_table_hash_nr_entries;
3654 unsigned long wait_table_bits;
3655
3656
3657
3658
3659 struct pglist_data *zone_pgdat;
3660
3661 unsigned long zone_start_pfn;
3662 # 302 "include/linux/mmzone.h"
3663 unsigned long spanned_pages;
3664 unsigned long present_pages;
3665
3666
3667
3668
3669 const char *name;
3670 } ;
3671 # 387 "include/linux/mmzone.h"
3672 struct zonelist_cache;
3673 # 400 "include/linux/mmzone.h"
3674 struct zonelist {
3675 struct zonelist_cache *zlcache_ptr;
3676 struct zone *zones[((1 << 0) * MAX_NR_ZONES) + 1];
3677
3678
3679
3680 };
3681 # 418 "include/linux/mmzone.h"
3682 extern struct page *mem_map;
3683 # 432 "include/linux/mmzone.h"
3684 struct bootmem_data;
3685 typedef struct pglist_data {
3686 struct zone node_zones[MAX_NR_ZONES];
3687 struct zonelist node_zonelists[MAX_NR_ZONES];
3688 int nr_zones;
3689
3690 struct page *node_mem_map;
3691
3692 struct bootmem_data *bdata;
3693 # 451 "include/linux/mmzone.h"
3694 unsigned long node_start_pfn;
3695 unsigned long node_present_pages;
3696 unsigned long node_spanned_pages;
3697
3698 int node_id;
3699 wait_queue_head_t kswapd_wait;
3700 struct task_struct *kswapd;
3701 int kswapd_max_order;
3702 } pg_data_t;
3703 # 470 "include/linux/mmzone.h"
3704 # 1 "include/linux/memory_hotplug.h" 1
3705
3706
3707
3708 # 1 "include/linux/mmzone.h" 1
3709 # 5 "include/linux/memory_hotplug.h" 2
3710
3711
3712 # 1 "include/linux/notifier.h" 1
3713 # 12 "include/linux/notifier.h"
3714 # 1 "include/linux/errno.h" 1
3715
3716
3717
3718 # 1 "include/asm/errno.h" 1
3719
3720
3721
3722 # 1 "include/asm-generic/errno.h" 1
3723
3724
3725
3726 # 1 "include/asm-generic/errno-base.h" 1
3727 # 5 "include/asm-generic/errno.h" 2
3728 # 5 "include/asm/errno.h" 2
3729 # 5 "include/linux/errno.h" 2
3730 # 13 "include/linux/notifier.h" 2
3731 # 1 "include/linux/mutex.h" 1
3732 # 47 "include/linux/mutex.h"
3733 struct mutex {
3734
3735 atomic_t count;
3736 spinlock_t wait_lock;
3737 struct list_head wait_list;
3738 # 60 "include/linux/mutex.h"
3739 };
3740
3741
3742
3743
3744
3745 struct mutex_waiter {
3746 struct list_head list;
3747 struct task_struct *task;
3748
3749
3750
3751
3752 };
3753 # 105 "include/linux/mutex.h"
3754 extern void __mutex_init(struct mutex *lock, const char *name,
3755 struct lock_class_key *key);
3756
3757
3758
3759
3760
3761
3762
3763 static inline __attribute__((always_inline)) int mutex_is_locked(struct mutex *lock)
3764 {
3765 return ((&lock->count)->counter) != 1;
3766 }
3767
3768
3769
3770
3771
3772 extern void mutex_lock(struct mutex *lock);
3773 extern int __attribute__((warn_unused_result)) mutex_lock_interruptible(struct mutex *lock);
3774 # 139 "include/linux/mutex.h"
3775 extern int mutex_trylock(struct mutex *lock);
3776 extern void mutex_unlock(struct mutex *lock);
3777 # 14 "include/linux/notifier.h" 2
3778 # 1 "include/linux/rwsem.h" 1
3779 # 19 "include/linux/rwsem.h"
3780 struct rw_semaphore;
3781
3782
3783 # 1 "include/linux/rwsem-spinlock.h" 1
3784 # 22 "include/linux/rwsem-spinlock.h"
3785 struct rwsem_waiter;
3786 # 31 "include/linux/rwsem-spinlock.h"
3787 struct rw_semaphore {
3788 __s32 activity;
3789 spinlock_t wait_lock;
3790 struct list_head wait_list;
3791
3792
3793
3794 };
3795 # 53 "include/linux/rwsem-spinlock.h"
3796 extern void __init_rwsem(struct rw_semaphore *sem, const char *name,
3797 struct lock_class_key *key);
3798 # 63 "include/linux/rwsem-spinlock.h"
3799 extern void __down_read(struct rw_semaphore *sem);
3800 extern int __down_read_trylock(struct rw_semaphore *sem);
3801 extern void __down_write(struct rw_semaphore *sem);
3802 extern void __down_write_nested(struct rw_semaphore *sem, int subclass);
3803 extern int __down_write_trylock(struct rw_semaphore *sem);
3804 extern void __up_read(struct rw_semaphore *sem);
3805 extern void __up_write(struct rw_semaphore *sem);
3806 extern void __downgrade_write(struct rw_semaphore *sem);
3807
3808 static inline __attribute__((always_inline)) int rwsem_is_locked(struct rw_semaphore *sem)
3809 {
3810 return (sem->activity != 0);
3811 }
3812 # 23 "include/linux/rwsem.h" 2
3813
3814
3815
3816
3817
3818
3819
3820 extern void down_read(struct rw_semaphore *sem);
3821
3822
3823
3824
3825 extern int down_read_trylock(struct rw_semaphore *sem);
3826
3827
3828
3829
3830 extern void down_write(struct rw_semaphore *sem);
3831
3832
3833
3834
3835 extern int down_write_trylock(struct rw_semaphore *sem);
3836
3837
3838
3839
3840 extern void up_read(struct rw_semaphore *sem);
3841
3842
3843
3844
3845 extern void up_write(struct rw_semaphore *sem);
3846
3847
3848
3849
3850 extern void downgrade_write(struct rw_semaphore *sem);
3851 # 15 "include/linux/notifier.h" 2
3852 # 1 "include/linux/srcu.h" 1
3853 # 30 "include/linux/srcu.h"
3854 struct srcu_struct_array {
3855 int c[2];
3856 };
3857
3858 struct srcu_struct {
3859 int completed;
3860 struct srcu_struct_array *per_cpu_ref;
3861 struct mutex mutex;
3862 };
3863
3864
3865
3866
3867
3868
3869
3870 int init_srcu_struct(struct srcu_struct *sp);
3871 void cleanup_srcu_struct(struct srcu_struct *sp);
3872 int srcu_read_lock(struct srcu_struct *sp) ;
3873 void srcu_read_unlock(struct srcu_struct *sp, int idx) ;
3874 void synchronize_srcu(struct srcu_struct *sp);
3875 long srcu_batches_completed(struct srcu_struct *sp);
3876 # 16 "include/linux/notifier.h" 2
3877 # 50 "include/linux/notifier.h"
3878 struct notifier_block {
3879 int (*notifier_call)(struct notifier_block *, unsigned long, void *);
3880 struct notifier_block *next;
3881 int priority;
3882 };
3883
3884 struct atomic_notifier_head {
3885 spinlock_t lock;
3886 struct notifier_block *head;
3887 };
3888
3889 struct blocking_notifier_head {
3890 struct rw_semaphore rwsem;
3891 struct notifier_block *head;
3892 };
3893
3894 struct raw_notifier_head {
3895 struct notifier_block *head;
3896 };
3897
3898 struct srcu_notifier_head {
3899 struct mutex mutex;
3900 struct srcu_struct srcu;
3901 struct notifier_block *head;
3902 };
3903 # 89 "include/linux/notifier.h"
3904 extern void srcu_init_notifier_head(struct srcu_notifier_head *nh);
3905 # 115 "include/linux/notifier.h"
3906 extern int atomic_notifier_chain_register(struct atomic_notifier_head *nh,
3907 struct notifier_block *nb);
3908 extern int blocking_notifier_chain_register(struct blocking_notifier_head *nh,
3909 struct notifier_block *nb);
3910 extern int raw_notifier_chain_register(struct raw_notifier_head *nh,
3911 struct notifier_block *nb);
3912 extern int srcu_notifier_chain_register(struct srcu_notifier_head *nh,
3913 struct notifier_block *nb);
3914
3915 extern int atomic_notifier_chain_unregister(struct atomic_notifier_head *nh,
3916 struct notifier_block *nb);
3917 extern int blocking_notifier_chain_unregister(struct blocking_notifier_head *nh,
3918 struct notifier_block *nb);
3919 extern int raw_notifier_chain_unregister(struct raw_notifier_head *nh,
3920 struct notifier_block *nb);
3921 extern int srcu_notifier_chain_unregister(struct srcu_notifier_head *nh,
3922 struct notifier_block *nb);
3923
3924 extern int atomic_notifier_call_chain(struct atomic_notifier_head *nh,
3925 unsigned long val, void *v);
3926 extern int __atomic_notifier_call_chain(struct atomic_notifier_head *nh,
3927 unsigned long val, void *v, int nr_to_call, int *nr_calls);
3928 extern int blocking_notifier_call_chain(struct blocking_notifier_head *nh,
3929 unsigned long val, void *v);
3930 extern int __blocking_notifier_call_chain(struct blocking_notifier_head *nh,
3931 unsigned long val, void *v, int nr_to_call, int *nr_calls);
3932 extern int raw_notifier_call_chain(struct raw_notifier_head *nh,
3933 unsigned long val, void *v);
3934 extern int __raw_notifier_call_chain(struct raw_notifier_head *nh,
3935 unsigned long val, void *v, int nr_to_call, int *nr_calls);
3936 extern int srcu_notifier_call_chain(struct srcu_notifier_head *nh,
3937 unsigned long val, void *v);
3938 extern int __srcu_notifier_call_chain(struct srcu_notifier_head *nh,
3939 unsigned long val, void *v, int nr_to_call, int *nr_calls);
3940 # 8 "include/linux/memory_hotplug.h" 2
3941
3942 struct page;
3943 struct zone;
3944 struct pglist_data;
3945 # 140 "include/linux/memory_hotplug.h"
3946 static inline __attribute__((always_inline)) void pgdat_resize_lock(struct pglist_data *p, unsigned long *f) {}
3947 static inline __attribute__((always_inline)) void pgdat_resize_unlock(struct pglist_data *p, unsigned long *f) {}
3948 static inline __attribute__((always_inline)) void pgdat_resize_init(struct pglist_data *pgdat) {}
3949
3950 static inline __attribute__((always_inline)) unsigned zone_span_seqbegin(struct zone *zone)
3951 {
3952 return 0;
3953 }
3954 static inline __attribute__((always_inline)) int zone_span_seqretry(struct zone *zone, unsigned iv)
3955 {
3956 return 0;
3957 }
3958 static inline __attribute__((always_inline)) void zone_span_writelock(struct zone *zone) {}
3959 static inline __attribute__((always_inline)) void zone_span_writeunlock(struct zone *zone) {}
3960 static inline __attribute__((always_inline)) void zone_seqlock_init(struct zone *zone) {}
3961
3962 static inline __attribute__((always_inline)) int mhp_notimplemented(const char *func)
3963 {
3964 printk("<4>" "%s() called, with CONFIG_MEMORY_HOTPLUG disabled\n", func);
3965 dump_stack();
3966 return -38;
3967 }
3968
3969
3970 static inline __attribute__((always_inline)) int __remove_pages(struct zone *zone, unsigned long start_pfn,
3971 unsigned long nr_pages)
3972 {
3973 printk("<4>" "%s() called, not yet supported\n", (__func__));
3974 dump_stack();
3975 return -38;
3976 }
3977
3978 extern int add_memory(int nid, u64 start, u64 size);
3979 extern int arch_add_memory(int nid, u64 start, u64 size);
3980 extern int remove_memory(u64 start, u64 size);
3981 extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn,
3982 int nr_pages);
3983 # 471 "include/linux/mmzone.h" 2
3984
3985 void get_zone_counts(unsigned long *active, unsigned long *inactive,
3986 unsigned long *free);
3987 void build_all_zonelists(void);
3988 void wakeup_kswapd(struct zone *zone, int order);
3989 int zone_watermark_ok(struct zone *z, int order, unsigned long mark,
3990 int classzone_idx, int alloc_flags);
3991 enum memmap_context {
3992 MEMMAP_EARLY,
3993 MEMMAP_HOTPLUG,
3994 };
3995 extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn,
3996 unsigned long size,
3997 enum memmap_context context);
3998
3999
4000
4001
4002 static inline __attribute__((always_inline)) void memory_present(int nid, unsigned long start, unsigned long end) {}
4003 # 501 "include/linux/mmzone.h"
4004 static inline __attribute__((always_inline)) int populated_zone(struct zone *zone)
4005 {
4006 return (!!zone->present_pages);
4007 }
4008
4009 static inline __attribute__((always_inline)) int is_highmem_idx(enum zone_type idx)
4010 {
4011
4012
4013
4014 return 0;
4015
4016 }
4017
4018 static inline __attribute__((always_inline)) int is_normal_idx(enum zone_type idx)
4019 {
4020 return (idx == ZONE_NORMAL);
4021 }
4022
4023
4024
4025
4026
4027
4028
4029 static inline __attribute__((always_inline)) int is_highmem(struct zone *zone)
4030 {
4031
4032
4033
4034 return 0;
4035
4036 }
4037
4038 static inline __attribute__((always_inline)) int is_normal(struct zone *zone)
4039 {
4040 return zone == zone->zone_pgdat->node_zones + ZONE_NORMAL;
4041 }
4042
4043 static inline __attribute__((always_inline)) int is_dma32(struct zone *zone)
4044 {
4045
4046
4047
4048 return 0;
4049
4050 }
4051
4052 static inline __attribute__((always_inline)) int is_dma(struct zone *zone)
4053 {
4054
4055 return zone == zone->zone_pgdat->node_zones + ZONE_DMA;
4056
4057
4058
4059 }
4060
4061
4062 struct ctl_table;
4063 struct file;
4064 int min_free_kbytes_sysctl_handler(struct ctl_table *, int, struct file *,
4065 void *, size_t *, loff_t *);
4066 extern int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1];
4067 int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, struct file *,
4068 void *, size_t *, loff_t *);
4069 int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *, int, struct file *,
4070 void *, size_t *, loff_t *);
4071 int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int,
4072 struct file *, void *, size_t *, loff_t *);
4073 int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int,
4074 struct file *, void *, size_t *, loff_t *);
4075 int sysctl_pagecache_ratio_sysctl_handler(struct ctl_table *, int,
4076 struct file *, void *, size_t *, loff_t *);
4077
4078 # 1 "include/linux/topology.h" 1
4079 # 30 "include/linux/topology.h"
4080 # 1 "include/linux/cpumask.h" 1
4081 # 88 "include/linux/cpumask.h"
4082 typedef struct { unsigned long bits[(((1)+32 -1)/32)]; } cpumask_t;
4083 extern cpumask_t _unused_cpumask_arg_;
4084
4085
4086 static inline __attribute__((always_inline)) void __cpu_set(int cpu, volatile cpumask_t *dstp)
4087 {
4088 set_bit(cpu, dstp->bits);
4089 }
4090
4091
4092 static inline __attribute__((always_inline)) void __cpu_clear(int cpu, volatile cpumask_t *dstp)
4093 {
4094 clear_bit(cpu, dstp->bits);
4095 }
4096
4097
4098 static inline __attribute__((always_inline)) void __cpus_setall(cpumask_t *dstp, int nbits)
4099 {
4100 bitmap_fill(dstp->bits, nbits);
4101 }
4102
4103
4104 static inline __attribute__((always_inline)) void __cpus_clear(cpumask_t *dstp, int nbits)
4105 {
4106 bitmap_zero(dstp->bits, nbits);
4107 }
4108
4109
4110
4111
4112
4113 static inline __attribute__((always_inline)) int __cpu_test_and_set(int cpu, cpumask_t *addr)
4114 {
4115 return test_and_set_bit(cpu, addr->bits);
4116 }
4117
4118
4119 static inline __attribute__((always_inline)) void __cpus_and(cpumask_t *dstp, const cpumask_t *src1p,
4120 const cpumask_t *src2p, int nbits)
4121 {
4122 bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits);
4123 }
4124
4125
4126 static inline __attribute__((always_inline)) void __cpus_or(cpumask_t *dstp, const cpumask_t *src1p,
4127 const cpumask_t *src2p, int nbits)
4128 {
4129 bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits);
4130 }
4131
4132
4133 static inline __attribute__((always_inline)) void __cpus_xor(cpumask_t *dstp, const cpumask_t *src1p,
4134 const cpumask_t *src2p, int nbits)
4135 {
4136 bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits);
4137 }
4138
4139
4140
4141 static inline __attribute__((always_inline)) void __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p,
4142 const cpumask_t *src2p, int nbits)
4143 {
4144 bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);
4145 }
4146
4147
4148 static inline __attribute__((always_inline)) void __cpus_complement(cpumask_t *dstp,
4149 const cpumask_t *srcp, int nbits)
4150 {
4151 bitmap_complement(dstp->bits, srcp->bits, nbits);
4152 }
4153
4154
4155 static inline __attribute__((always_inline)) int __cpus_equal(const cpumask_t *src1p,
4156 const cpumask_t *src2p, int nbits)
4157 {
4158 return bitmap_equal(src1p->bits, src2p->bits, nbits);
4159 }
4160
4161
4162 static inline __attribute__((always_inline)) int __cpus_intersects(const cpumask_t *src1p,
4163 const cpumask_t *src2p, int nbits)
4164 {
4165 return bitmap_intersects(src1p->bits, src2p->bits, nbits);
4166 }
4167
4168
4169 static inline __attribute__((always_inline)) int __cpus_subset(const cpumask_t *src1p,
4170 const cpumask_t *src2p, int nbits)
4171 {
4172 return bitmap_subset(src1p->bits, src2p->bits, nbits);
4173 }
4174
4175
4176 static inline __attribute__((always_inline)) int __cpus_empty(const cpumask_t *srcp, int nbits)
4177 {
4178 return bitmap_empty(srcp->bits, nbits);
4179 }
4180
4181
4182 static inline __attribute__((always_inline)) int __cpus_full(const cpumask_t *srcp, int nbits)
4183 {
4184 return bitmap_full(srcp->bits, nbits);
4185 }
4186
4187
4188 static inline __attribute__((always_inline)) int __cpus_weight(const cpumask_t *srcp, int nbits)
4189 {
4190 return bitmap_weight(srcp->bits, nbits);
4191 }
4192
4193
4194
4195 static inline __attribute__((always_inline)) void __cpus_shift_right(cpumask_t *dstp,
4196 const cpumask_t *srcp, int n, int nbits)
4197 {
4198 bitmap_shift_right(dstp->bits, srcp->bits, n, nbits);
4199 }
4200
4201
4202
4203 static inline __attribute__((always_inline)) void __cpus_shift_left(cpumask_t *dstp,
4204 const cpumask_t *srcp, int n, int nbits)
4205 {
4206 bitmap_shift_left(dstp->bits, srcp->bits, n, nbits);
4207 }
4208 # 270 "include/linux/cpumask.h"
4209 static inline __attribute__((always_inline)) int __cpumask_scnprintf(char *buf, int len,
4210 const cpumask_t *srcp, int nbits)
4211 {
4212 return bitmap_scnprintf(buf, len, srcp->bits, nbits);
4213 }
4214
4215
4216
4217 static inline __attribute__((always_inline)) int __cpumask_parse_user(const char *buf, int len,
4218 cpumask_t *dstp, int nbits)
4219 {
4220 return bitmap_parse_user(buf, len, dstp->bits, nbits);
4221 }
4222
4223
4224
4225 static inline __attribute__((always_inline)) int __cpulist_scnprintf(char *buf, int len,
4226 const cpumask_t *srcp, int nbits)
4227 {
4228 return bitmap_scnlistprintf(buf, len, srcp->bits, nbits);
4229 }
4230
4231
4232 static inline __attribute__((always_inline)) int __cpulist_parse(const char *buf, cpumask_t *dstp, int nbits)
4233 {
4234 return bitmap_parselist(buf, dstp->bits, nbits);
4235 }
4236
4237
4238
4239 static inline __attribute__((always_inline)) int __cpu_remap(int oldbit,
4240 const cpumask_t *oldp, const cpumask_t *newp, int nbits)
4241 {
4242 return bitmap_bitremap(oldbit, oldp->bits, newp->bits, nbits);
4243 }
4244
4245
4246
4247 static inline __attribute__((always_inline)) void __cpus_remap(cpumask_t *dstp, const cpumask_t *srcp,
4248 const cpumask_t *oldp, const cpumask_t *newp, int nbits)
4249 {
4250 bitmap_remap(dstp->bits, srcp->bits, oldp->bits, newp->bits, nbits);
4251 }
4252 # 380 "include/linux/cpumask.h"
4253 extern cpumask_t cpu_possible_map;
4254 extern cpumask_t cpu_online_map;
4255 extern cpumask_t cpu_present_map;
4256 # 31 "include/linux/topology.h" 2
4257
4258
4259 # 1 "include/linux/smp.h" 1
4260 # 11 "include/linux/smp.h"
4261 extern void cpu_idle(void);
4262 # 87 "include/linux/smp.h"
4263 static inline __attribute__((always_inline)) int up_smp_call_function(void)
4264 {
4265 return 0;
4266 }
4267 # 99 "include/linux/smp.h"
4268 static inline __attribute__((always_inline)) void smp_send_reschedule(int cpu) { }
4269
4270
4271 static inline __attribute__((always_inline)) int smp_call_function_single(int cpuid, void (*func) (void *info),
4272 void *info, int retry, int wait)
4273 {
4274 return -16;
4275 }
4276 # 136 "include/linux/smp.h"
4277 void smp_setup_processor_id(void);
4278 # 34 "include/linux/topology.h" 2
4279 # 1 "include/asm/topology.h" 1
4280
4281
4282
4283 # 1 "include/asm-generic/topology.h" 1
4284 # 5 "include/asm/topology.h" 2
4285 # 35 "include/linux/topology.h" 2
4286 # 576 "include/linux/mmzone.h" 2
4287
4288
4289
4290
4291
4292
4293
4294 extern struct pglist_data contig_page_data;
4295 # 594 "include/linux/mmzone.h"
4296 extern struct pglist_data *first_online_pgdat(void);
4297 extern struct pglist_data *next_online_pgdat(struct pglist_data *pgdat);
4298 extern struct zone *next_zone(struct zone *zone);
4299 # 793 "include/linux/mmzone.h"
4300 void memory_present(int nid, unsigned long start, unsigned long end);
4301 unsigned long __attribute__ ((__section__ (".init.text"))) node_memmap_size_bytes(int, unsigned long, unsigned long);
4302 # 5 "include/linux/gfp.h" 2
4303
4304
4305
4306 struct vm_area_struct;
4307 # 86 "include/linux/gfp.h"
4308 static inline __attribute__((always_inline)) enum zone_type gfp_zone(gfp_t flags)
4309 {
4310
4311 if (flags & (( gfp_t)0x01u))
4312 return ZONE_DMA;
4313 # 100 "include/linux/gfp.h"
4314 return ZONE_NORMAL;
4315 }
4316 # 119 "include/linux/gfp.h"
4317 static inline __attribute__((always_inline)) void arch_free_page(struct page *page, int order) { }
4318
4319
4320 static inline __attribute__((always_inline)) void arch_alloc_page(struct page *page, int order) { }
4321
4322
4323 extern struct page *
4324 __alloc_pages(gfp_t, unsigned int, struct zonelist *);
4325
4326 static inline __attribute__((always_inline)) struct page *alloc_pages_node(int nid, gfp_t gfp_mask,
4327 unsigned int order)
4328 {
4329 if (__builtin_expect(!!(order >= 14), 0))
4330 return ((void *)0);
4331
4332
4333 if (nid < 0)
4334 nid = ((0));
4335
4336 return __alloc_pages(gfp_mask, order,
4337 (&contig_page_data)->node_zonelists + gfp_zone(gfp_mask));
4338 }
4339 # 162 "include/linux/gfp.h"
4340 extern unsigned long __get_free_pages(gfp_t gfp_mask, unsigned int order);
4341 extern unsigned long get_zeroed_page(gfp_t gfp_mask);
4342
4343
4344
4345
4346
4347
4348
4349 extern void __free_pages(struct page *page, unsigned int order);
4350 extern void free_pages(unsigned long addr, unsigned int order);
4351 extern void free_hot_page(struct page *page);
4352 extern void free_cold_page(struct page *page);
4353
4354
4355
4356
4357 void page_alloc_init(void);
4358 void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp);
4359 # 15 "include/linux/slab.h" 2
4360
4361
4362 typedef struct kmem_cache kmem_cache_t __attribute__((deprecated));
4363 # 38 "include/linux/slab.h"
4364 void __attribute__ ((__section__ (".init.text"))) kmem_cache_init(void);
4365 int slab_is_available(void);
4366
4367 struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
4368 unsigned long,
4369 void (*)(void *, struct kmem_cache *, unsigned long),
4370 void (*)(void *, struct kmem_cache *, unsigned long));
4371 void kmem_cache_destroy(struct kmem_cache *);
4372 int kmem_cache_shrink(struct kmem_cache *);
4373 void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
4374 void *kmem_cache_zalloc(struct kmem_cache *, gfp_t);
4375 void kmem_cache_free(struct kmem_cache *, void *);
4376 unsigned int kmem_cache_size(struct kmem_cache *);
4377 const char *kmem_cache_name(struct kmem_cache *);
4378 int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr);
4379 # 69 "include/linux/slab.h"
4380 static inline __attribute__((always_inline)) void *kmem_cache_alloc_node(struct kmem_cache *cachep,
4381 gfp_t flags, int node)
4382 {
4383 return kmem_cache_alloc(cachep, flags);
4384 }
4385 # 94 "include/linux/slab.h"
4386 void *__kmalloc(size_t, gfp_t);
4387 void *__kzalloc(size_t, gfp_t);
4388 void * __attribute__((warn_unused_result)) krealloc(const void *, size_t, gfp_t);<