]>
Commit | Line | Data |
---|---|---|
45516216 | 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); | |
4389 | void kfree(const void *); | |
4390 | size_t ksize(const void *); | |
4391 | ||
4392 | ||
4393 | ||
4394 | ||
4395 | ||
4396 | ||
4397 | ||
4398 | static inline __attribute__((always_inline)) void *kcalloc(size_t n, size_t size, gfp_t flags) | |
4399 | { | |
4400 | if (n != 0 && size > (~0UL) / n) | |
4401 | return ((void *)0); | |
4402 | return __kzalloc(n * size, flags); | |
4403 | } | |
4404 | # 123 "include/linux/slab.h" | |
4405 | # 1 "include/linux/slab_def.h" 1 | |
4406 | # 19 "include/linux/slab_def.h" | |
4407 | struct cache_sizes { | |
4408 | size_t cs_size; | |
4409 | struct kmem_cache *cs_cachep; | |
4410 | ||
4411 | struct kmem_cache *cs_dmacachep; | |
4412 | ||
4413 | }; | |
4414 | extern struct cache_sizes malloc_sizes[]; | |
4415 | ||
4416 | static inline __attribute__((always_inline)) void *kmalloc(size_t size, gfp_t flags) | |
4417 | { | |
4418 | if (__builtin_constant_p(size)) { | |
4419 | int i = 0; | |
4420 | ||
4421 | ||
4422 | ||
4423 | ||
4424 | ||
4425 | # 1 "include/linux/kmalloc_sizes.h" 1 | |
4426 | ||
4427 | if (size <= 32) goto found; else i++; | |
4428 | ||
4429 | if (size <= 64) goto found; else i++; | |
4430 | ||
4431 | if (size <= 96) goto found; else i++; | |
4432 | ||
4433 | if (size <= 128) goto found; else i++; | |
4434 | ||
4435 | if (size <= 192) goto found; else i++; | |
4436 | ||
4437 | if (size <= 256) goto found; else i++; | |
4438 | if (size <= 512) goto found; else i++; | |
4439 | if (size <= 1024) goto found; else i++; | |
4440 | if (size <= 2048) goto found; else i++; | |
4441 | if (size <= 4096) goto found; else i++; | |
4442 | if (size <= 8192) goto found; else i++; | |
4443 | if (size <= 16384) goto found; else i++; | |
4444 | if (size <= 32768) goto found; else i++; | |
4445 | if (size <= 65536) goto found; else i++; | |
4446 | if (size <= 131072) goto found; else i++; | |
4447 | ||
4448 | if (size <= 262144) goto found; else i++; | |
4449 | ||
4450 | ||
4451 | if (size <= 524288) goto found; else i++; | |
4452 | ||
4453 | ||
4454 | if (size <= 1048576) goto found; else i++; | |
4455 | ||
4456 | ||
4457 | if (size <= 2097152) goto found; else i++; | |
4458 | ||
4459 | ||
4460 | if (size <= 4194304) goto found; else i++; | |
4461 | ||
4462 | ||
4463 | if (size <= 8388608) goto found; else i++; | |
4464 | ||
4465 | ||
4466 | if (size <= 16777216) goto found; else i++; | |
4467 | ||
4468 | ||
4469 | if (size <= 33554432) goto found; else i++; | |
4470 | # 38 "include/linux/slab_def.h" 2 | |
4471 | ||
4472 | { | |
4473 | extern void __you_cannot_kmalloc_that_much(void); | |
4474 | __you_cannot_kmalloc_that_much(); | |
4475 | } | |
4476 | found: | |
4477 | ||
4478 | if (flags & (( gfp_t)0x01u)) | |
4479 | return kmem_cache_alloc(malloc_sizes[i].cs_dmacachep, | |
4480 | flags); | |
4481 | ||
4482 | return kmem_cache_alloc(malloc_sizes[i].cs_cachep, flags); | |
4483 | } | |
4484 | return __kmalloc(size, flags); | |
4485 | } | |
4486 | ||
4487 | static inline __attribute__((always_inline)) void *kzalloc(size_t size, gfp_t flags) | |
4488 | { | |
4489 | if (__builtin_constant_p(size)) { | |
4490 | int i = 0; | |
4491 | ||
4492 | ||
4493 | ||
4494 | ||
4495 | ||
4496 | # 1 "include/linux/kmalloc_sizes.h" 1 | |
4497 | ||
4498 | if (size <= 32) goto found; else i++; | |
4499 | ||
4500 | if (size <= 64) goto found; else i++; | |
4501 | ||
4502 | if (size <= 96) goto found; else i++; | |
4503 | ||
4504 | if (size <= 128) goto found; else i++; | |
4505 | ||
4506 | if (size <= 192) goto found; else i++; | |
4507 | ||
4508 | if (size <= 256) goto found; else i++; | |
4509 | if (size <= 512) goto found; else i++; | |
4510 | if (size <= 1024) goto found; else i++; | |
4511 | if (size <= 2048) goto found; else i++; | |
4512 | if (size <= 4096) goto found; else i++; | |
4513 | if (size <= 8192) goto found; else i++; | |
4514 | if (size <= 16384) goto found; else i++; | |
4515 | if (size <= 32768) goto found; else i++; | |
4516 | if (size <= 65536) goto found; else i++; | |
4517 | if (size <= 131072) goto found; else i++; | |
4518 | ||
4519 | if (size <= 262144) goto found; else i++; | |
4520 | ||
4521 | ||
4522 | if (size <= 524288) goto found; else i++; | |
4523 | ||
4524 | ||
4525 | if (size <= 1048576) goto found; else i++; | |
4526 | ||
4527 | ||
4528 | if (size <= 2097152) goto found; else i++; | |
4529 | ||
4530 | ||
4531 | if (size <= 4194304) goto found; else i++; | |
4532 | ||
4533 | ||
4534 | if (size <= 8388608) goto found; else i++; | |
4535 | ||
4536 | ||
4537 | if (size <= 16777216) goto found; else i++; | |
4538 | ||
4539 | ||
4540 | if (size <= 33554432) goto found; else i++; | |
4541 | # 64 "include/linux/slab_def.h" 2 | |
4542 | ||
4543 | { | |
4544 | extern void __you_cannot_kzalloc_that_much(void); | |
4545 | __you_cannot_kzalloc_that_much(); | |
4546 | } | |
4547 | found: | |
4548 | ||
4549 | if (flags & (( gfp_t)0x01u)) | |
4550 | return kmem_cache_zalloc(malloc_sizes[i].cs_dmacachep, | |
4551 | flags); | |
4552 | ||
4553 | return kmem_cache_zalloc(malloc_sizes[i].cs_cachep, flags); | |
4554 | } | |
4555 | return __kzalloc(size, flags); | |
4556 | } | |
4557 | # 112 "include/linux/slab_def.h" | |
4558 | extern const struct seq_operations slabinfo_op; | |
4559 | ssize_t slabinfo_write(struct file *, const char *, size_t, loff_t *); | |
4560 | # 124 "include/linux/slab.h" 2 | |
4561 | # 194 "include/linux/slab.h" | |
4562 | static inline __attribute__((always_inline)) void *kmalloc_node(size_t size, gfp_t flags, int node) | |
4563 | { | |
4564 | return kmalloc(size, flags); | |
4565 | } | |
4566 | ||
4567 | static inline __attribute__((always_inline)) void *__kmalloc_node(size_t size, gfp_t flags, int node) | |
4568 | { | |
4569 | return __kmalloc(size, flags); | |
4570 | } | |
4571 | # 6 "include/linux/percpu.h" 2 | |
4572 | ||
4573 | ||
4574 | ||
4575 | ||
4576 | # 1 "include/asm/percpu.h" 1 | |
4577 | ||
4578 | ||
4579 | ||
4580 | # 1 "include/asm-generic/percpu.h" 1 | |
4581 | # 5 "include/asm/percpu.h" 2 | |
4582 | # 11 "include/linux/percpu.h" 2 | |
4583 | # 64 "include/linux/percpu.h" | |
4584 | static inline __attribute__((always_inline)) void percpu_depopulate(void *__pdata, int cpu) | |
4585 | { | |
4586 | } | |
4587 | ||
4588 | static inline __attribute__((always_inline)) void __percpu_depopulate_mask(void *__pdata, cpumask_t *mask) | |
4589 | { | |
4590 | } | |
4591 | ||
4592 | static inline __attribute__((always_inline)) void *percpu_populate(void *__pdata, size_t size, gfp_t gfp, | |
4593 | int cpu) | |
4594 | { | |
4595 | return ({ (void)(cpu); (__pdata); }); | |
4596 | } | |
4597 | ||
4598 | static inline __attribute__((always_inline)) int __percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp, | |
4599 | cpumask_t *mask) | |
4600 | { | |
4601 | return 0; | |
4602 | } | |
4603 | ||
4604 | static inline __attribute__((always_inline)) __attribute__((always_inline)) void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask) | |
4605 | { | |
4606 | return kzalloc(size, gfp); | |
4607 | } | |
4608 | ||
4609 | static inline __attribute__((always_inline)) void percpu_free(void *__pdata) | |
4610 | { | |
4611 | kfree(__pdata); | |
4612 | } | |
4613 | # 42 "include/linux/rcupdate.h" 2 | |
4614 | # 50 "include/linux/rcupdate.h" | |
4615 | struct rcu_head { | |
4616 | struct rcu_head *next; | |
4617 | void (*func)(struct rcu_head *head); | |
4618 | }; | |
4619 | # 64 "include/linux/rcupdate.h" | |
4620 | struct rcu_ctrlblk { | |
4621 | long cur; | |
4622 | long completed; | |
4623 | int next_pending; | |
4624 | ||
4625 | int signaled; | |
4626 | ||
4627 | spinlock_t lock ; | |
4628 | cpumask_t cpumask; | |
4629 | ||
4630 | } ; | |
4631 | ||
4632 | ||
4633 | static inline __attribute__((always_inline)) int rcu_batch_before(long a, long b) | |
4634 | { | |
4635 | return (a - b) < 0; | |
4636 | } | |
4637 | ||
4638 | ||
4639 | static inline __attribute__((always_inline)) int rcu_batch_after(long a, long b) | |
4640 | { | |
4641 | return (a - b) > 0; | |
4642 | } | |
4643 | ||
4644 | ||
4645 | ||
4646 | ||
4647 | ||
4648 | ||
4649 | struct rcu_data { | |
4650 | ||
4651 | long quiescbatch; | |
4652 | int passed_quiesc; | |
4653 | int qs_pending; | |
4654 | ||
4655 | ||
4656 | long batch; | |
4657 | struct rcu_head *nxtlist; | |
4658 | struct rcu_head **nxttail; | |
4659 | long qlen; | |
4660 | struct rcu_head *curlist; | |
4661 | struct rcu_head **curtail; | |
4662 | struct rcu_head *donelist; | |
4663 | struct rcu_head **donetail; | |
4664 | long blimit; | |
4665 | int cpu; | |
4666 | struct rcu_head barrier; | |
4667 | }; | |
4668 | ||
4669 | extern __typeof__(struct rcu_data) per_cpu__rcu_data; | |
4670 | extern __typeof__(struct rcu_data) per_cpu__rcu_bh_data; | |
4671 | ||
4672 | ||
4673 | ||
4674 | ||
4675 | ||
4676 | ||
4677 | ||
4678 | static inline __attribute__((always_inline)) void rcu_qsctr_inc(int cpu) | |
4679 | { | |
4680 | struct rcu_data *rdp = &(*((void)(cpu), &per_cpu__rcu_data)); | |
4681 | rdp->passed_quiesc = 1; | |
4682 | } | |
4683 | static inline __attribute__((always_inline)) void rcu_bh_qsctr_inc(int cpu) | |
4684 | { | |
4685 | struct rcu_data *rdp = &(*((void)(cpu), &per_cpu__rcu_bh_data)); | |
4686 | rdp->passed_quiesc = 1; | |
4687 | } | |
4688 | ||
4689 | extern int rcu_pending(int cpu); | |
4690 | extern int rcu_needs_cpu(int cpu); | |
4691 | # 272 "include/linux/rcupdate.h" | |
4692 | extern void rcu_init(void); | |
4693 | extern void rcu_check_callbacks(int cpu, int user); | |
4694 | extern void rcu_restart_cpu(int cpu); | |
4695 | extern long rcu_batches_completed(void); | |
4696 | extern long rcu_batches_completed_bh(void); | |
4697 | ||
4698 | ||
4699 | extern void call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *head)); | |
4700 | ||
4701 | extern void call_rcu_bh(struct rcu_head *head, void (*func)(struct rcu_head *head)); | |
4702 | ||
4703 | extern void synchronize_rcu(void); | |
4704 | void synchronize_idle(void); | |
4705 | extern void rcu_barrier(void); | |
4706 | # 11 "include/linux/dcache.h" 2 | |
4707 | ||
4708 | struct nameidata; | |
4709 | struct vfsmount; | |
4710 | # 33 "include/linux/dcache.h" | |
4711 | struct qstr { | |
4712 | unsigned int hash; | |
4713 | unsigned int len; | |
4714 | const unsigned char *name; | |
4715 | }; | |
4716 | ||
4717 | struct dentry_stat_t { | |
4718 | int nr_dentry; | |
4719 | int nr_unused; | |
4720 | int age_limit; | |
4721 | int want_pages; | |
4722 | int dummy[2]; | |
4723 | }; | |
4724 | extern struct dentry_stat_t dentry_stat; | |
4725 | ||
4726 | ||
4727 | ||
4728 | ||
4729 | ||
4730 | ||
4731 | static inline __attribute__((always_inline)) unsigned long | |
4732 | partial_name_hash(unsigned long c, unsigned long prevhash) | |
4733 | { | |
4734 | return (prevhash + (c << 4) + (c >> 4)) * 11; | |
4735 | } | |
4736 | ||
4737 | ||
4738 | ||
4739 | ||
4740 | ||
4741 | static inline __attribute__((always_inline)) unsigned long end_name_hash(unsigned long hash) | |
4742 | { | |
4743 | return (unsigned int) hash; | |
4744 | } | |
4745 | ||
4746 | ||
4747 | static inline __attribute__((always_inline)) unsigned int | |
4748 | full_name_hash(const unsigned char *name, unsigned int len) | |
4749 | { | |
4750 | unsigned long hash = 0; | |
4751 | while (len--) | |
4752 | hash = partial_name_hash(*name++, hash); | |
4753 | return end_name_hash(hash); | |
4754 | } | |
4755 | ||
4756 | struct dcookie_struct; | |
4757 | ||
4758 | ||
4759 | ||
4760 | struct dentry { | |
4761 | atomic_t d_count; | |
4762 | unsigned int d_flags; | |
4763 | spinlock_t d_lock; | |
4764 | struct inode *d_inode; | |
4765 | ||
4766 | ||
4767 | ||
4768 | ||
4769 | ||
4770 | struct hlist_node d_hash; | |
4771 | struct dentry *d_parent; | |
4772 | struct qstr d_name; | |
4773 | ||
4774 | struct list_head d_lru; | |
4775 | ||
4776 | ||
4777 | ||
4778 | union { | |
4779 | struct list_head d_child; | |
4780 | struct rcu_head d_rcu; | |
4781 | } d_u; | |
4782 | struct list_head d_subdirs; | |
4783 | struct list_head d_alias; | |
4784 | unsigned long d_time; | |
4785 | struct dentry_operations *d_op; | |
4786 | struct super_block *d_sb; | |
4787 | void *d_fsdata; | |
4788 | ||
4789 | ||
4790 | ||
4791 | int d_mounted; | |
4792 | unsigned char d_iname[36]; | |
4793 | }; | |
4794 | ||
4795 | ||
4796 | ||
4797 | ||
4798 | ||
4799 | ||
4800 | ||
4801 | enum dentry_d_lock_class | |
4802 | { | |
4803 | DENTRY_D_LOCK_NORMAL, | |
4804 | DENTRY_D_LOCK_NESTED | |
4805 | }; | |
4806 | ||
4807 | struct dentry_operations { | |
4808 | int (*d_revalidate)(struct dentry *, struct nameidata *); | |
4809 | int (*d_hash) (struct dentry *, struct qstr *); | |
4810 | int (*d_compare) (struct dentry *, struct qstr *, struct qstr *); | |
4811 | int (*d_delete)(struct dentry *); | |
4812 | void (*d_release)(struct dentry *); | |
4813 | void (*d_iput)(struct dentry *, struct inode *); | |
4814 | char *(*d_dname)(struct dentry *, char *, int); | |
4815 | }; | |
4816 | # 180 "include/linux/dcache.h" | |
4817 | extern spinlock_t dcache_lock; | |
4818 | # 198 "include/linux/dcache.h" | |
4819 | static inline __attribute__((always_inline)) void __d_drop(struct dentry *dentry) | |
4820 | { | |
4821 | if (!(dentry->d_flags & 0x0010)) { | |
4822 | dentry->d_flags |= 0x0010; | |
4823 | hlist_del_rcu(&dentry->d_hash); | |
4824 | } | |
4825 | } | |
4826 | ||
4827 | static inline __attribute__((always_inline)) void d_drop(struct dentry *dentry) | |
4828 | { | |
4829 | do { do { } while (0); (void)0; (void)(&dcache_lock); } while (0); | |
4830 | do { do { } while (0); (void)0; (void)(&dentry->d_lock); } while (0); | |
4831 | __d_drop(dentry); | |
4832 | do { do { } while (0); (void)0; (void)(&dentry->d_lock); } while (0); | |
4833 | do { do { } while (0); (void)0; (void)(&dcache_lock); } while (0); | |
4834 | } | |
4835 | ||
4836 | static inline __attribute__((always_inline)) int dname_external(struct dentry *dentry) | |
4837 | { | |
4838 | return dentry->d_name.name != dentry->d_iname; | |
4839 | } | |
4840 | ||
4841 | ||
4842 | ||
4843 | ||
4844 | extern void d_instantiate(struct dentry *, struct inode *); | |
4845 | extern struct dentry * d_instantiate_unique(struct dentry *, struct inode *); | |
4846 | extern struct dentry * d_materialise_unique(struct dentry *, struct inode *); | |
4847 | extern void d_delete(struct dentry *); | |
4848 | ||
4849 | ||
4850 | extern struct dentry * d_alloc(struct dentry *, const struct qstr *); | |
4851 | extern struct dentry * d_alloc_anon(struct inode *); | |
4852 | extern struct dentry * d_splice_alias(struct inode *, struct dentry *); | |
4853 | extern void shrink_dcache_sb(struct super_block *); | |
4854 | extern void shrink_dcache_parent(struct dentry *); | |
4855 | extern void shrink_dcache_for_umount(struct super_block *); | |
4856 | extern int d_invalidate(struct dentry *); | |
4857 | ||
4858 | ||
4859 | extern struct dentry * d_alloc_root(struct inode *); | |
4860 | ||
4861 | ||
4862 | extern void d_genocide(struct dentry *); | |
4863 | ||
4864 | extern struct dentry *d_find_alias(struct inode *); | |
4865 | extern void d_prune_aliases(struct inode *); | |
4866 | ||
4867 | ||
4868 | extern int have_submounts(struct dentry *); | |
4869 | ||
4870 | ||
4871 | ||
4872 | ||
4873 | extern void d_rehash(struct dentry *); | |
4874 | # 263 "include/linux/dcache.h" | |
4875 | static inline __attribute__((always_inline)) void d_add(struct dentry *entry, struct inode *inode) | |
4876 | { | |
4877 | d_instantiate(entry, inode); | |
4878 | d_rehash(entry); | |
4879 | } | |
4880 | # 277 "include/linux/dcache.h" | |
4881 | static inline __attribute__((always_inline)) struct dentry *d_add_unique(struct dentry *entry, struct inode *inode) | |
4882 | { | |
4883 | struct dentry *res; | |
4884 | ||
4885 | res = d_instantiate_unique(entry, inode); | |
4886 | d_rehash(res != ((void *)0) ? res : entry); | |
4887 | return res; | |
4888 | } | |
4889 | ||
4890 | ||
4891 | extern void d_move(struct dentry *, struct dentry *); | |
4892 | ||
4893 | ||
4894 | extern struct dentry * d_lookup(struct dentry *, struct qstr *); | |
4895 | extern struct dentry * __d_lookup(struct dentry *, struct qstr *); | |
4896 | extern struct dentry * d_hash_and_lookup(struct dentry *, struct qstr *); | |
4897 | ||
4898 | ||
4899 | extern int d_validate(struct dentry *, struct dentry *); | |
4900 | ||
4901 | ||
4902 | ||
4903 | ||
4904 | extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...); | |
4905 | ||
4906 | extern char * d_path(struct dentry *, struct vfsmount *, char *, int); | |
4907 | # 319 "include/linux/dcache.h" | |
4908 | static inline __attribute__((always_inline)) struct dentry *dget(struct dentry *dentry) | |
4909 | { | |
4910 | if (dentry) { | |
4911 | do { if (__builtin_expect(!!((!((&dentry->d_count)->counter))!=0), 0)) do { printk("BUG: failure at %s:%d/%s()!\n", "include/linux/dcache.h", 322, (__func__)); panic("BUG!"); } while (0); } while(0); | |
4912 | atomic_inc(&dentry->d_count); | |
4913 | } | |
4914 | return dentry; | |
4915 | } | |
4916 | ||
4917 | extern struct dentry * dget_locked(struct dentry *); | |
4918 | # 337 "include/linux/dcache.h" | |
4919 | static inline __attribute__((always_inline)) int d_unhashed(struct dentry *dentry) | |
4920 | { | |
4921 | return (dentry->d_flags & 0x0010); | |
4922 | } | |
4923 | ||
4924 | static inline __attribute__((always_inline)) struct dentry *dget_parent(struct dentry *dentry) | |
4925 | { | |
4926 | struct dentry *ret; | |
4927 | ||
4928 | do { do { } while (0); (void)0; (void)(&dentry->d_lock); } while (0); | |
4929 | ret = dget(dentry->d_parent); | |
4930 | do { do { } while (0); (void)0; (void)(&dentry->d_lock); } while (0); | |
4931 | return ret; | |
4932 | } | |
4933 | ||
4934 | extern void dput(struct dentry *); | |
4935 | ||
4936 | static inline __attribute__((always_inline)) int d_mountpoint(struct dentry *dentry) | |
4937 | { | |
4938 | return dentry->d_mounted; | |
4939 | } | |
4940 | ||
4941 | extern struct vfsmount *lookup_mnt(struct vfsmount *, struct dentry *); | |
4942 | extern struct vfsmount *__lookup_mnt(struct vfsmount *, struct dentry *, int); | |
4943 | extern struct dentry *lookup_create(struct nameidata *nd, int is_dir); | |
4944 | ||
4945 | extern int sysctl_vfs_cache_pressure; | |
4946 | # 276 "include/linux/fs.h" 2 | |
4947 | # 1 "include/linux/namei.h" 1 | |
4948 | ||
4949 | ||
4950 | ||
4951 | ||
4952 | ||
4953 | ||
4954 | struct vfsmount; | |
4955 | ||
4956 | struct open_intent { | |
4957 | int flags; | |
4958 | int create_mode; | |
4959 | struct file *file; | |
4960 | }; | |
4961 | ||
4962 | enum { MAX_NESTED_LINKS = 8 }; | |
4963 | ||
4964 | struct nameidata { | |
4965 | struct dentry *dentry; | |
4966 | struct vfsmount *mnt; | |
4967 | struct qstr last; | |
4968 | unsigned int flags; | |
4969 | int last_type; | |
4970 | unsigned depth; | |
4971 | char *saved_names[MAX_NESTED_LINKS + 1]; | |
4972 | ||
4973 | ||
4974 | union { | |
4975 | struct open_intent open; | |
4976 | } intent; | |
4977 | }; | |
4978 | ||
4979 | struct path { | |
4980 | struct vfsmount *mnt; | |
4981 | struct dentry *dentry; | |
4982 | }; | |
4983 | ||
4984 | ||
4985 | ||
4986 | ||
4987 | enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; | |
4988 | # 65 "include/linux/namei.h" | |
4989 | extern int __user_walk(const char *, unsigned, struct nameidata *); | |
4990 | extern int __user_walk_fd(int dfd, const char *, unsigned, struct nameidata *); | |
4991 | ||
4992 | ||
4993 | ||
4994 | ||
4995 | extern int path_lookup(const char *, unsigned, struct nameidata *); | |
4996 | extern int path_walk(const char *, struct nameidata *); | |
4997 | extern int link_path_walk(const char *, struct nameidata *); | |
4998 | extern void path_release(struct nameidata *); | |
4999 | extern void path_release_on_umount(struct nameidata *); | |
5000 | ||
5001 | extern int __user_path_lookup_open(const char *, unsigned lookup_flags, struct nameidata *nd, int open_flags); | |
5002 | extern int path_lookup_open(int dfd, const char *name, unsigned lookup_flags, struct nameidata *, int open_flags); | |
5003 | extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry, | |
5004 | int (*open)(struct inode *, struct file *)); | |
5005 | extern struct file *nameidata_to_filp(struct nameidata *nd, int flags); | |
5006 | extern void release_open_intent(struct nameidata *); | |
5007 | ||
5008 | extern struct dentry * lookup_one_len(const char *, struct dentry *, int); | |
5009 | extern struct dentry *lookup_one_len_kern(const char *, struct dentry *, int); | |
5010 | ||
5011 | extern int follow_down(struct vfsmount **, struct dentry **); | |
5012 | extern int follow_up(struct vfsmount **, struct dentry **); | |
5013 | ||
5014 | extern struct dentry *lock_rename(struct dentry *, struct dentry *); | |
5015 | extern void unlock_rename(struct dentry *, struct dentry *); | |
5016 | ||
5017 | static inline __attribute__((always_inline)) void nd_set_link(struct nameidata *nd, char *path) | |
5018 | { | |
5019 | nd->saved_names[nd->depth] = path; | |
5020 | } | |
5021 | ||
5022 | static inline __attribute__((always_inline)) char *nd_get_link(struct nameidata *nd) | |
5023 | { | |
5024 | return nd->saved_names[nd->depth]; | |
5025 | } | |
5026 | # 277 "include/linux/fs.h" 2 | |
5027 | # 1 "include/linux/stat.h" 1 | |
5028 | ||
5029 | ||
5030 | ||
5031 | ||
5032 | ||
5033 | # 1 "include/asm/stat.h" 1 | |
5034 | ||
5035 | ||
5036 | ||
5037 | struct stat { | |
5038 | unsigned short st_dev; | |
5039 | unsigned short __pad1; | |
5040 | unsigned long st_ino; | |
5041 | unsigned short st_mode; | |
5042 | unsigned short st_nlink; | |
5043 | unsigned short st_uid; | |
5044 | unsigned short st_gid; | |
5045 | unsigned short st_rdev; | |
5046 | unsigned short __pad2; | |
5047 | unsigned long st_size; | |
5048 | unsigned long st_blksize; | |
5049 | unsigned long st_blocks; | |
5050 | unsigned long st_atime; | |
5051 | unsigned long __unused1; | |
5052 | unsigned long st_mtime; | |
5053 | unsigned long __unused2; | |
5054 | unsigned long st_ctime; | |
5055 | unsigned long __unused3; | |
5056 | unsigned long __unused4; | |
5057 | unsigned long __unused5; | |
5058 | }; | |
5059 | ||
5060 | ||
5061 | ||
5062 | ||
5063 | struct stat64 { | |
5064 | unsigned long long st_dev; | |
5065 | unsigned char __pad1[4]; | |
5066 | ||
5067 | ||
5068 | unsigned long __st_ino; | |
5069 | ||
5070 | unsigned int st_mode; | |
5071 | unsigned int st_nlink; | |
5072 | ||
5073 | unsigned long st_uid; | |
5074 | unsigned long st_gid; | |
5075 | ||
5076 | unsigned long long st_rdev; | |
5077 | unsigned char __pad2[4]; | |
5078 | ||
5079 | long long st_size; | |
5080 | unsigned long st_blksize; | |
5081 | ||
5082 | long long st_blocks; | |
5083 | ||
5084 | unsigned long st_atime; | |
5085 | unsigned long st_atime_nsec; | |
5086 | ||
5087 | unsigned long st_mtime; | |
5088 | unsigned long st_mtime_nsec; | |
5089 | ||
5090 | unsigned long st_ctime; | |
5091 | unsigned long st_ctime_nsec; | |
5092 | ||
5093 | unsigned long long st_ino; | |
5094 | }; | |
5095 | # 7 "include/linux/stat.h" 2 | |
5096 | # 60 "include/linux/stat.h" | |
5097 | # 1 "include/linux/time.h" 1 | |
5098 | # 12 "include/linux/time.h" | |
5099 | struct timespec { | |
5100 | time_t tv_sec; | |
5101 | long tv_nsec; | |
5102 | }; | |
5103 | ||
5104 | ||
5105 | struct timeval { | |
5106 | time_t tv_sec; | |
5107 | suseconds_t tv_usec; | |
5108 | }; | |
5109 | ||
5110 | struct timezone { | |
5111 | int tz_minuteswest; | |
5112 | int tz_dsttime; | |
5113 | }; | |
5114 | # 39 "include/linux/time.h" | |
5115 | static inline __attribute__((always_inline)) int timespec_equal(struct timespec *a, struct timespec *b) | |
5116 | { | |
5117 | return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec); | |
5118 | } | |
5119 | ||
5120 | ||
5121 | ||
5122 | ||
5123 | ||
5124 | ||
5125 | static inline __attribute__((always_inline)) int timespec_compare(const struct timespec *lhs, const struct timespec *rhs) | |
5126 | { | |
5127 | if (lhs->tv_sec < rhs->tv_sec) | |
5128 | return -1; | |
5129 | if (lhs->tv_sec > rhs->tv_sec) | |
5130 | return 1; | |
5131 | return lhs->tv_nsec - rhs->tv_nsec; | |
5132 | } | |
5133 | ||
5134 | static inline __attribute__((always_inline)) int timeval_compare(const struct timeval *lhs, const struct timeval *rhs) | |
5135 | { | |
5136 | if (lhs->tv_sec < rhs->tv_sec) | |
5137 | return -1; | |
5138 | if (lhs->tv_sec > rhs->tv_sec) | |
5139 | return 1; | |
5140 | return lhs->tv_usec - rhs->tv_usec; | |
5141 | } | |
5142 | ||
5143 | extern unsigned long mktime(const unsigned int year, const unsigned int mon, | |
5144 | const unsigned int day, const unsigned int hour, | |
5145 | const unsigned int min, const unsigned int sec); | |
5146 | ||
5147 | extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec); | |
5148 | ||
5149 | ||
5150 | ||
5151 | ||
5152 | static inline __attribute__((always_inline)) struct timespec timespec_sub(struct timespec lhs, | |
5153 | struct timespec rhs) | |
5154 | { | |
5155 | struct timespec ts_delta; | |
5156 | set_normalized_timespec(&ts_delta, lhs.tv_sec - rhs.tv_sec, | |
5157 | lhs.tv_nsec - rhs.tv_nsec); | |
5158 | return ts_delta; | |
5159 | } | |
5160 | ||
5161 | ||
5162 | ||
5163 | ||
5164 | ||
5165 | ||
5166 | ||
5167 | extern struct timespec xtime; | |
5168 | extern struct timespec wall_to_monotonic; | |
5169 | extern seqlock_t xtime_lock __attribute__((weak)); | |
5170 | ||
5171 | extern unsigned long read_persistent_clock(void); | |
5172 | void timekeeping_init(void); | |
5173 | ||
5174 | static inline __attribute__((always_inline)) unsigned long get_seconds(void) | |
5175 | { | |
5176 | return xtime.tv_sec; | |
5177 | } | |
5178 | ||
5179 | struct timespec current_kernel_time(void); | |
5180 | ||
5181 | ||
5182 | ||
5183 | ||
5184 | extern void do_gettimeofday(struct timeval *tv); | |
5185 | extern int do_settimeofday(struct timespec *tv); | |
5186 | extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz); | |
5187 | ||
5188 | extern long do_utimes(int dfd, char *filename, struct timespec *times, int flags); | |
5189 | struct itimerval; | |
5190 | extern int do_setitimer(int which, struct itimerval *value, | |
5191 | struct itimerval *ovalue); | |
5192 | extern unsigned int alarm_setitimer(unsigned int seconds); | |
5193 | extern int do_getitimer(int which, struct itimerval *value); | |
5194 | extern void getnstimeofday(struct timespec *tv); | |
5195 | ||
5196 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); | |
5197 | extern int timekeeping_is_continuous(void); | |
5198 | extern void update_wall_time(void); | |
5199 | # 131 "include/linux/time.h" | |
5200 | static inline __attribute__((always_inline)) s64 timespec_to_ns(const struct timespec *ts) | |
5201 | { | |
5202 | return ((s64) ts->tv_sec * 1000000000L) + ts->tv_nsec; | |
5203 | } | |
5204 | # 143 "include/linux/time.h" | |
5205 | static inline __attribute__((always_inline)) s64 timeval_to_ns(const struct timeval *tv) | |
5206 | { | |
5207 | return ((s64) tv->tv_sec * 1000000000L) + | |
5208 | tv->tv_usec * 1000L; | |
5209 | } | |
5210 | ||
5211 | ||
5212 | ||
5213 | ||
5214 | ||
5215 | ||
5216 | ||
5217 | extern struct timespec ns_to_timespec(const s64 nsec); | |
5218 | ||
5219 | ||
5220 | ||
5221 | ||
5222 | ||
5223 | ||
5224 | ||
5225 | extern struct timeval ns_to_timeval(const s64 nsec); | |
5226 | ||
5227 | ||
5228 | ||
5229 | ||
5230 | ||
5231 | ||
5232 | static inline __attribute__((always_inline)) void timespec_add_ns(struct timespec *a, u64 ns) | |
5233 | { | |
5234 | ns += a->tv_nsec; | |
5235 | while(__builtin_expect(!!(ns >= 1000000000L), 0)) { | |
5236 | ns -= 1000000000L; | |
5237 | a->tv_sec++; | |
5238 | } | |
5239 | a->tv_nsec = ns; | |
5240 | } | |
5241 | # 197 "include/linux/time.h" | |
5242 | struct itimerspec { | |
5243 | struct timespec it_interval; | |
5244 | struct timespec it_value; | |
5245 | }; | |
5246 | ||
5247 | struct itimerval { | |
5248 | struct timeval it_interval; | |
5249 | struct timeval it_value; | |
5250 | }; | |
5251 | # 61 "include/linux/stat.h" 2 | |
5252 | ||
5253 | struct kstat { | |
5254 | u64 ino; | |
5255 | dev_t dev; | |
5256 | umode_t mode; | |
5257 | unsigned int nlink; | |
5258 | uid_t uid; | |
5259 | gid_t gid; | |
5260 | dev_t rdev; | |
5261 | loff_t size; | |
5262 | struct timespec atime; | |
5263 | struct timespec mtime; | |
5264 | struct timespec ctime; | |
5265 | unsigned long blksize; | |
5266 | unsigned long long blocks; | |
5267 | }; | |
5268 | # 278 "include/linux/fs.h" 2 | |
5269 | ||
5270 | # 1 "include/linux/kobject.h" 1 | |
5271 | # 22 "include/linux/kobject.h" | |
5272 | # 1 "include/linux/sysfs.h" 1 | |
5273 | # 18 "include/linux/sysfs.h" | |
5274 | struct kobject; | |
5275 | struct module; | |
5276 | struct nameidata; | |
5277 | struct dentry; | |
5278 | ||
5279 | struct attribute { | |
5280 | const char * name; | |
5281 | struct module * owner; | |
5282 | mode_t mode; | |
5283 | }; | |
5284 | ||
5285 | struct attribute_group { | |
5286 | const char * name; | |
5287 | struct attribute ** attrs; | |
5288 | }; | |
5289 | # 56 "include/linux/sysfs.h" | |
5290 | struct vm_area_struct; | |
5291 | ||
5292 | struct bin_attribute { | |
5293 | struct attribute attr; | |
5294 | size_t size; | |
5295 | void *private; | |
5296 | ssize_t (*read)(struct kobject *, char *, loff_t, size_t); | |
5297 | ssize_t (*write)(struct kobject *, char *, loff_t, size_t); | |
5298 | int (*mmap)(struct kobject *, struct bin_attribute *attr, | |
5299 | struct vm_area_struct *vma); | |
5300 | }; | |
5301 | ||
5302 | struct sysfs_ops { | |
5303 | ssize_t (*show)(struct kobject *, struct attribute *,char *); | |
5304 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); | |
5305 | }; | |
5306 | # 82 "include/linux/sysfs.h" | |
5307 | extern int sysfs_schedule_callback(struct kobject *kobj, | |
5308 | void (*func)(void *), void *data, struct module *owner); | |
5309 | ||
5310 | extern int __attribute__((warn_unused_result)) | |
5311 | sysfs_create_dir(struct kobject *, struct dentry *); | |
5312 | ||
5313 | extern void | |
5314 | sysfs_remove_dir(struct kobject *); | |
5315 | ||
5316 | extern int __attribute__((warn_unused_result)) | |
5317 | sysfs_rename_dir(struct kobject *, struct dentry *, const char *new_name); | |
5318 | ||
5319 | extern int __attribute__((warn_unused_result)) | |
5320 | sysfs_move_dir(struct kobject *, struct kobject *); | |
5321 | ||
5322 | extern int __attribute__((warn_unused_result)) | |
5323 | sysfs_create_file(struct kobject *, const struct attribute *); | |
5324 | ||
5325 | extern int __attribute__((warn_unused_result)) | |
5326 | sysfs_update_file(struct kobject *, const struct attribute *); | |
5327 | ||
5328 | extern int __attribute__((warn_unused_result)) | |
5329 | sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode); | |
5330 | ||
5331 | extern void | |
5332 | sysfs_remove_file(struct kobject *, const struct attribute *); | |
5333 | ||
5334 | extern int __attribute__((warn_unused_result)) | |
5335 | sysfs_create_link(struct kobject * kobj, struct kobject * target, const char * name); | |
5336 | ||
5337 | extern void | |
5338 | sysfs_remove_link(struct kobject *, const char * name); | |
5339 | ||
5340 | int __attribute__((warn_unused_result)) sysfs_create_bin_file(struct kobject *kobj, | |
5341 | struct bin_attribute *attr); | |
5342 | void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr); | |
5343 | ||
5344 | int __attribute__((warn_unused_result)) sysfs_create_group(struct kobject *, | |
5345 | const struct attribute_group *); | |
5346 | void sysfs_remove_group(struct kobject *, const struct attribute_group *); | |
5347 | int sysfs_add_file_to_group(struct kobject *kobj, | |
5348 | const struct attribute *attr, const char *group); | |
5349 | void sysfs_remove_file_from_group(struct kobject *kobj, | |
5350 | const struct attribute *attr, const char *group); | |
5351 | ||
5352 | void sysfs_notify(struct kobject * k, char *dir, char *attr); | |
5353 | ||
5354 | ||
5355 | extern int sysfs_make_shadowed_dir(struct kobject *kobj, | |
5356 | void * (*follow_link)(struct dentry *, struct nameidata *)); | |
5357 | extern struct dentry *sysfs_create_shadow_dir(struct kobject *kobj); | |
5358 | extern void sysfs_remove_shadow_dir(struct dentry *dir); | |
5359 | ||
5360 | extern int __attribute__((warn_unused_result)) sysfs_init(void); | |
5361 | # 23 "include/linux/kobject.h" 2 | |
5362 | ||
5363 | ||
5364 | # 1 "include/linux/kref.h" 1 | |
5365 | # 23 "include/linux/kref.h" | |
5366 | struct kref { | |
5367 | atomic_t refcount; | |
5368 | }; | |
5369 | ||
5370 | void kref_init(struct kref *kref); | |
5371 | void kref_get(struct kref *kref); | |
5372 | int kref_put(struct kref *kref, void (*release) (struct kref *kref)); | |
5373 | # 26 "include/linux/kobject.h" 2 | |
5374 | # 34 "include/linux/kobject.h" | |
5375 | extern char uevent_helper[]; | |
5376 | ||
5377 | ||
5378 | extern u64 uevent_seqnum; | |
5379 | ||
5380 | ||
5381 | typedef int kobject_action_t; | |
5382 | enum kobject_action { | |
5383 | KOBJ_ADD = ( kobject_action_t) 0x01, | |
5384 | KOBJ_REMOVE = ( kobject_action_t) 0x02, | |
5385 | KOBJ_CHANGE = ( kobject_action_t) 0x03, | |
5386 | KOBJ_OFFLINE = ( kobject_action_t) 0x04, | |
5387 | KOBJ_ONLINE = ( kobject_action_t) 0x05, | |
5388 | KOBJ_MOVE = ( kobject_action_t) 0x06, | |
5389 | }; | |
5390 | ||
5391 | struct kobject { | |
5392 | const char * k_name; | |
5393 | char name[20]; | |
5394 | struct kref kref; | |
5395 | struct list_head entry; | |
5396 | struct kobject * parent; | |
5397 | struct kset * kset; | |
5398 | struct kobj_type * ktype; | |
5399 | struct dentry * dentry; | |
5400 | wait_queue_head_t poll; | |
5401 | }; | |
5402 | ||
5403 | extern int kobject_set_name(struct kobject *, const char *, ...) | |
5404 | __attribute__((format(printf,2,3))); | |
5405 | ||
5406 | static inline __attribute__((always_inline)) const char * kobject_name(const struct kobject * kobj) | |
5407 | { | |
5408 | return kobj->k_name; | |
5409 | } | |
5410 | ||
5411 | extern void kobject_init(struct kobject *); | |
5412 | extern void kobject_cleanup(struct kobject *); | |
5413 | ||
5414 | extern int __attribute__((warn_unused_result)) kobject_add(struct kobject *); | |
5415 | extern int __attribute__((warn_unused_result)) kobject_shadow_add(struct kobject *, struct dentry *); | |
5416 | extern void kobject_del(struct kobject *); | |
5417 | ||
5418 | extern int __attribute__((warn_unused_result)) kobject_rename(struct kobject *, const char *new_name); | |
5419 | extern int __attribute__((warn_unused_result)) kobject_shadow_rename(struct kobject *kobj, | |
5420 | struct dentry *new_parent, | |
5421 | const char *new_name); | |
5422 | extern int __attribute__((warn_unused_result)) kobject_move(struct kobject *, struct kobject *); | |
5423 | ||
5424 | extern int __attribute__((warn_unused_result)) kobject_register(struct kobject *); | |
5425 | extern void kobject_unregister(struct kobject *); | |
5426 | ||
5427 | extern struct kobject * kobject_get(struct kobject *); | |
5428 | extern void kobject_put(struct kobject *); | |
5429 | ||
5430 | extern struct kobject *kobject_kset_add_dir(struct kset *kset, | |
5431 | struct kobject *, const char *); | |
5432 | extern struct kobject *kobject_add_dir(struct kobject *, const char *); | |
5433 | ||
5434 | extern char * kobject_get_path(struct kobject *, gfp_t); | |
5435 | ||
5436 | struct kobj_type { | |
5437 | void (*release)(struct kobject *); | |
5438 | struct sysfs_ops * sysfs_ops; | |
5439 | struct attribute ** default_attrs; | |
5440 | }; | |
5441 | # 119 "include/linux/kobject.h" | |
5442 | struct kset_uevent_ops { | |
5443 | int (*filter)(struct kset *kset, struct kobject *kobj); | |
5444 | const char *(*name)(struct kset *kset, struct kobject *kobj); | |
5445 | int (*uevent)(struct kset *kset, struct kobject *kobj, char **envp, | |
5446 | int num_envp, char *buffer, int buffer_size); | |
5447 | }; | |
5448 | ||
5449 | struct kset { | |
5450 | struct kobj_type * ktype; | |
5451 | struct list_head list; | |
5452 | spinlock_t list_lock; | |
5453 | struct kobject kobj; | |
5454 | struct kset_uevent_ops * uevent_ops; | |
5455 | }; | |
5456 | ||
5457 | ||
5458 | extern void kset_init(struct kset * k); | |
5459 | extern int __attribute__((warn_unused_result)) kset_add(struct kset * k); | |
5460 | extern int __attribute__((warn_unused_result)) kset_register(struct kset * k); | |
5461 | extern void kset_unregister(struct kset * k); | |
5462 | ||
5463 | static inline __attribute__((always_inline)) struct kset * to_kset(struct kobject * kobj) | |
5464 | { | |
5465 | return kobj ? ({ const typeof( ((struct kset *)0)->kobj ) *__mptr = (kobj); (struct kset *)( (char *)__mptr - __builtin_offsetof(struct kset,kobj) );}) : ((void *)0); | |
5466 | } | |
5467 | ||
5468 | static inline __attribute__((always_inline)) struct kset * kset_get(struct kset * k) | |
5469 | { | |
5470 | return k ? to_kset(kobject_get(&k->kobj)) : ((void *)0); | |
5471 | } | |
5472 | ||
5473 | static inline __attribute__((always_inline)) void kset_put(struct kset * k) | |
5474 | { | |
5475 | kobject_put(&k->kobj); | |
5476 | } | |
5477 | ||
5478 | static inline __attribute__((always_inline)) struct kobj_type * get_ktype(struct kobject * k) | |
5479 | { | |
5480 | if (k->kset && k->kset->ktype) | |
5481 | return k->kset->ktype; | |
5482 | else | |
5483 | return k->ktype; | |
5484 | } | |
5485 | ||
5486 | extern struct kobject * kset_find_obj(struct kset *, const char *); | |
5487 | # 187 "include/linux/kobject.h" | |
5488 | extern struct kset kernel_subsys; | |
5489 | ||
5490 | extern struct kset hypervisor_subsys; | |
5491 | # 236 "include/linux/kobject.h" | |
5492 | extern void subsystem_init(struct kset *); | |
5493 | extern int __attribute__((warn_unused_result)) subsystem_register(struct kset *); | |
5494 | extern void subsystem_unregister(struct kset *); | |
5495 | ||
5496 | static inline __attribute__((always_inline)) struct kset *subsys_get(struct kset *s) | |
5497 | { | |
5498 | if (s) | |
5499 | return kset_get(s); | |
5500 | return ((void *)0); | |
5501 | } | |
5502 | ||
5503 | static inline __attribute__((always_inline)) void subsys_put(struct kset *s) | |
5504 | { | |
5505 | kset_put(s); | |
5506 | } | |
5507 | ||
5508 | struct subsys_attribute { | |
5509 | struct attribute attr; | |
5510 | ssize_t (*show)(struct kset *, char *); | |
5511 | ssize_t (*store)(struct kset *, const char *, size_t); | |
5512 | }; | |
5513 | ||
5514 | extern int __attribute__((warn_unused_result)) subsys_create_file(struct kset *, | |
5515 | struct subsys_attribute *); | |
5516 | ||
5517 | ||
5518 | int kobject_uevent(struct kobject *kobj, enum kobject_action action); | |
5519 | int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, | |
5520 | char *envp[]); | |
5521 | ||
5522 | int add_uevent_var(char **envp, int num_envp, int *cur_index, | |
5523 | char *buffer, int buffer_size, int *cur_len, | |
5524 | const char *format, ...) | |
5525 | __attribute__((format (printf, 7, 8))); | |
5526 | # 280 "include/linux/fs.h" 2 | |
5527 | ||
5528 | # 1 "include/linux/radix-tree.h" 1 | |
5529 | # 38 "include/linux/radix-tree.h" | |
5530 | static inline __attribute__((always_inline)) void *radix_tree_ptr_to_direct(void *ptr) | |
5531 | { | |
5532 | return (void *)((unsigned long)ptr | 1); | |
5533 | } | |
5534 | ||
5535 | static inline __attribute__((always_inline)) void *radix_tree_direct_to_ptr(void *ptr) | |
5536 | { | |
5537 | return (void *)((unsigned long)ptr & ~1); | |
5538 | } | |
5539 | ||
5540 | static inline __attribute__((always_inline)) int radix_tree_is_direct_ptr(void *ptr) | |
5541 | { | |
5542 | return (int)((unsigned long)ptr & 1); | |
5543 | } | |
5544 | ||
5545 | ||
5546 | ||
5547 | ||
5548 | ||
5549 | ||
5550 | struct radix_tree_root { | |
5551 | unsigned int height; | |
5552 | gfp_t gfp_mask; | |
5553 | struct radix_tree_node *rnode; | |
5554 | }; | |
5555 | # 131 "include/linux/radix-tree.h" | |
5556 | static inline __attribute__((always_inline)) void *radix_tree_deref_slot(void **pslot) | |
5557 | { | |
5558 | return radix_tree_direct_to_ptr(*pslot); | |
5559 | } | |
5560 | # 143 "include/linux/radix-tree.h" | |
5561 | static inline __attribute__((always_inline)) void radix_tree_replace_slot(void **pslot, void *item) | |
5562 | { | |
5563 | do { if (__builtin_expect(!!((radix_tree_is_direct_ptr(item))!=0), 0)) do { printk("BUG: failure at %s:%d/%s()!\n", "include/linux/radix-tree.h", 145, (__func__)); panic("BUG!"); } while (0); } while(0); | |
5564 | ({ __asm__ __volatile__("": : :"memory"); (*pslot) = ((void *)((unsigned long)item | ((unsigned long)*pslot & 1))); }); | |
5565 | ||
5566 | ||
5567 | } | |
5568 | ||
5569 | int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); | |
5570 | void *radix_tree_lookup(struct radix_tree_root *, unsigned long); | |
5571 | void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long); | |
5572 | void *radix_tree_delete(struct radix_tree_root *, unsigned long); | |
5573 | unsigned int | |
5574 | radix_tree_gang_lookup(struct radix_tree_root *root, void **results, | |
5575 | unsigned long first_index, unsigned int max_items); | |
5576 | int radix_tree_preload(gfp_t gfp_mask); | |
5577 | void radix_tree_init(void); | |
5578 | void *radix_tree_tag_set(struct radix_tree_root *root, | |
5579 | unsigned long index, unsigned int tag); | |
5580 | void *radix_tree_tag_clear(struct radix_tree_root *root, | |
5581 | unsigned long index, unsigned int tag); | |
5582 | int radix_tree_tag_get(struct radix_tree_root *root, | |
5583 | unsigned long index, unsigned int tag); | |
5584 | unsigned int | |
5585 | radix_tree_gang_lookup_tag(struct radix_tree_root *root, void **results, | |
5586 | unsigned long first_index, unsigned int max_items, | |
5587 | unsigned int tag); | |
5588 | int radix_tree_tagged(struct radix_tree_root *root, unsigned int tag); | |
5589 | ||
5590 | static inline __attribute__((always_inline)) void radix_tree_preload_end(void) | |
5591 | { | |
5592 | do { } while (0); | |
5593 | } | |
5594 | # 282 "include/linux/fs.h" 2 | |
5595 | # 1 "include/linux/prio_tree.h" 1 | |
5596 | # 14 "include/linux/prio_tree.h" | |
5597 | struct raw_prio_tree_node { | |
5598 | struct prio_tree_node *left; | |
5599 | struct prio_tree_node *right; | |
5600 | struct prio_tree_node *parent; | |
5601 | }; | |
5602 | ||
5603 | struct prio_tree_node { | |
5604 | struct prio_tree_node *left; | |
5605 | struct prio_tree_node *right; | |
5606 | struct prio_tree_node *parent; | |
5607 | unsigned long start; | |
5608 | unsigned long last; | |
5609 | }; | |
5610 | ||
5611 | struct prio_tree_root { | |
5612 | struct prio_tree_node *prio_tree_node; | |
5613 | unsigned short index_bits; | |
5614 | unsigned short raw; | |
5615 | ||
5616 | ||
5617 | ||
5618 | ||
5619 | }; | |
5620 | ||
5621 | struct prio_tree_iter { | |
5622 | struct prio_tree_node *cur; | |
5623 | unsigned long mask; | |
5624 | unsigned long value; | |
5625 | int size_level; | |
5626 | ||
5627 | struct prio_tree_root *root; | |
5628 | unsigned long r_index; | |
5629 | unsigned long h_index; | |
5630 | }; | |
5631 | ||
5632 | static inline __attribute__((always_inline)) void prio_tree_iter_init(struct prio_tree_iter *iter, | |
5633 | struct prio_tree_root *root, unsigned long r_index, unsigned long h_index) | |
5634 | { | |
5635 | iter->root = root; | |
5636 | iter->r_index = r_index; | |
5637 | iter->h_index = h_index; | |
5638 | iter->cur = ((void *)0); | |
5639 | } | |
5640 | # 84 "include/linux/prio_tree.h" | |
5641 | static inline __attribute__((always_inline)) int prio_tree_empty(const struct prio_tree_root *root) | |
5642 | { | |
5643 | return root->prio_tree_node == ((void *)0); | |
5644 | } | |
5645 | ||
5646 | static inline __attribute__((always_inline)) int prio_tree_root(const struct prio_tree_node *node) | |
5647 | { | |
5648 | return node->parent == node; | |
5649 | } | |
5650 | ||
5651 | static inline __attribute__((always_inline)) int prio_tree_left_empty(const struct prio_tree_node *node) | |
5652 | { | |
5653 | return node->left == node; | |
5654 | } | |
5655 | ||
5656 | static inline __attribute__((always_inline)) int prio_tree_right_empty(const struct prio_tree_node *node) | |
5657 | { | |
5658 | return node->right == node; | |
5659 | } | |
5660 | ||
5661 | ||
5662 | struct prio_tree_node *prio_tree_replace(struct prio_tree_root *root, | |
5663 | struct prio_tree_node *old, struct prio_tree_node *node); | |
5664 | struct prio_tree_node *prio_tree_insert(struct prio_tree_root *root, | |
5665 | struct prio_tree_node *node); | |
5666 | void prio_tree_remove(struct prio_tree_root *root, struct prio_tree_node *node); | |
5667 | struct prio_tree_node *prio_tree_next(struct prio_tree_iter *iter); | |
5668 | # 283 "include/linux/fs.h" 2 | |
5669 | ||
5670 | # 1 "include/linux/pid.h" 1 | |
5671 | ||
5672 | ||
5673 | ||
5674 | ||
5675 | ||
5676 | enum pid_type | |
5677 | { | |
5678 | PIDTYPE_PID, | |
5679 | PIDTYPE_PGID, | |
5680 | PIDTYPE_SID, | |
5681 | PIDTYPE_MAX | |
5682 | }; | |
5683 | # 43 "include/linux/pid.h" | |
5684 | struct pid | |
5685 | { | |
5686 | atomic_t count; | |
5687 | ||
5688 | int nr; | |
5689 | struct hlist_node pid_chain; | |
5690 | ||
5691 | struct hlist_head tasks[PIDTYPE_MAX]; | |
5692 | struct rcu_head rcu; | |
5693 | }; | |
5694 | ||
5695 | extern struct pid init_struct_pid; | |
5696 | ||
5697 | struct pid_link | |
5698 | { | |
5699 | struct hlist_node node; | |
5700 | struct pid *pid; | |
5701 | }; | |
5702 | ||
5703 | static inline __attribute__((always_inline)) struct pid *get_pid(struct pid *pid) | |
5704 | { | |
5705 | if (pid) | |
5706 | atomic_inc(&pid->count); | |
5707 | return pid; | |
5708 | } | |
5709 | ||
5710 | extern void put_pid(struct pid *pid); | |
5711 | extern struct task_struct *pid_task(struct pid *pid, enum pid_type); | |
5712 | extern struct task_struct *get_pid_task(struct pid *pid, enum pid_type); | |
5713 | ||
5714 | ||
5715 | extern struct pid *get_task_pid(struct task_struct *task, enum pid_type type); | |
5716 | ||
5717 | ||
5718 | ||
5719 | ||
5720 | ||
5721 | extern int attach_pid(struct task_struct *task, enum pid_type type, struct pid *pid); | |
5722 | ||
5723 | extern void detach_pid(struct task_struct *task, enum pid_type); | |
5724 | extern void transfer_pid(struct task_struct *old, struct task_struct *new, enum pid_type); | |
5725 | ||
5726 | ||
5727 | ||
5728 | ||
5729 | ||
5730 | ||
5731 | extern struct pid *find_pid(int nr); | |
5732 | ||
5733 | ||
5734 | ||
5735 | ||
5736 | extern struct pid *find_get_pid(int nr); | |
5737 | extern struct pid *find_ge_pid(int nr); | |
5738 | ||
5739 | extern struct pid *alloc_pid(void); | |
5740 | extern void free_pid(struct pid *pid); | |
5741 | ||
5742 | static inline __attribute__((always_inline)) pid_t pid_nr(struct pid *pid) | |
5743 | { | |
5744 | pid_t nr = 0; | |
5745 | if (pid) | |
5746 | nr = pid->nr; | |
5747 | return nr; | |
5748 | } | |
5749 | # 285 "include/linux/fs.h" 2 | |
5750 | ||
5751 | ||
5752 | ||
5753 | # 1 "include/asm/semaphore.h" 1 | |
5754 | # 21 "include/asm/semaphore.h" | |
5755 | struct semaphore { | |
5756 | atomic_t count; | |
5757 | int sleepers; | |
5758 | wait_queue_head_t wait; | |
5759 | }; | |
5760 | # 40 "include/asm/semaphore.h" | |
5761 | static inline __attribute__((always_inline)) void sema_init(struct semaphore *sem, int val) | |
5762 | { | |
5763 | *sem = (struct semaphore){ .count = { (val) }, .sleepers = 0, .wait = { .lock = (spinlock_t) { .raw_lock = { }, }, .task_list = { &((*sem).wait).task_list, &((*sem).wait).task_list } } }; | |
5764 | } | |
5765 | ||
5766 | static inline __attribute__((always_inline)) void init_MUTEX(struct semaphore *sem) | |
5767 | { | |
5768 | sema_init(sem, 1); | |
5769 | } | |
5770 | ||
5771 | static inline __attribute__((always_inline)) void init_MUTEX_LOCKED(struct semaphore *sem) | |
5772 | { | |
5773 | sema_init(sem, 0); | |
5774 | } | |
5775 | ||
5776 | void __down(struct semaphore *sem); | |
5777 | int __down_interruptible(struct semaphore *sem); | |
5778 | int __down_trylock(struct semaphore *sem); | |
5779 | void __up(struct semaphore *sem); | |
5780 | ||
5781 | extern spinlock_t semaphore_wake_lock; | |
5782 | ||
5783 | ||
5784 | ||
5785 | ||
5786 | ||
5787 | ||
5788 | static inline __attribute__((always_inline)) void down(struct semaphore *sem) | |
5789 | { | |
5790 | do { cond_resched(); } while (0); | |
5791 | if (atomic_sub_return(1,(&sem->count)) < 0) | |
5792 | __down(sem); | |
5793 | } | |
5794 | ||
5795 | static inline __attribute__((always_inline)) int down_interruptible(struct semaphore *sem) | |
5796 | { | |
5797 | int ret = 0; | |
5798 | ||
5799 | do { cond_resched(); } while (0); | |
5800 | if (atomic_sub_return(1,(&sem->count)) < 0) | |
5801 | ret = __down_interruptible(sem); | |
5802 | return (ret); | |
5803 | } | |
5804 | ||
5805 | static inline __attribute__((always_inline)) int down_trylock(struct semaphore *sem) | |
5806 | { | |
5807 | int ret = 0; | |
5808 | ||
5809 | if (atomic_sub_return(1,(&sem->count)) < 0) | |
5810 | ret = __down_trylock(sem); | |
5811 | return ret; | |
5812 | } | |
5813 | ||
5814 | ||
5815 | ||
5816 | ||
5817 | ||
5818 | ||
5819 | ||
5820 | static inline __attribute__((always_inline)) void up(struct semaphore *sem) | |
5821 | { | |
5822 | if (atomic_add_return(1,(&sem->count)) <= 0) | |
5823 | __up(sem); | |
5824 | } | |
5825 | # 289 "include/linux/fs.h" 2 | |
5826 | ||
5827 | ||
5828 | struct hd_geometry; | |
5829 | struct iovec; | |
5830 | struct nameidata; | |
5831 | struct kiocb; | |
5832 | struct pipe_inode_info; | |
5833 | struct poll_table_struct; | |
5834 | struct kstatfs; | |
5835 | struct vm_area_struct; | |
5836 | struct vfsmount; | |
5837 | ||
5838 | extern void __attribute__ ((__section__ (".init.text"))) inode_init(unsigned long); | |
5839 | extern void __attribute__ ((__section__ (".init.text"))) inode_init_early(void); | |
5840 | extern void __attribute__ ((__section__ (".init.text"))) mnt_init(unsigned long); | |
5841 | extern void __attribute__ ((__section__ (".init.text"))) files_init(unsigned long); | |
5842 | ||
5843 | struct buffer_head; | |
5844 | typedef int (get_block_t)(struct inode *inode, sector_t iblock, | |
5845 | struct buffer_head *bh_result, int create); | |
5846 | typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, | |
5847 | ssize_t bytes, void *private); | |
5848 | # 340 "include/linux/fs.h" | |
5849 | struct iattr { | |
5850 | unsigned int ia_valid; | |
5851 | umode_t ia_mode; | |
5852 | uid_t ia_uid; | |
5853 | gid_t ia_gid; | |
5854 | loff_t ia_size; | |
5855 | struct timespec ia_atime; | |
5856 | struct timespec ia_mtime; | |
5857 | struct timespec ia_ctime; | |
5858 | ||
5859 | ||
5860 | ||
5861 | ||
5862 | ||
5863 | ||
5864 | struct file *ia_file; | |
5865 | }; | |
5866 | ||
5867 | ||
5868 | ||
5869 | ||
5870 | # 1 "include/linux/quota.h" 1 | |
5871 | # 44 "include/linux/quota.h" | |
5872 | typedef __kernel_uid32_t qid_t; | |
5873 | typedef __u64 qsize_t; | |
5874 | # 103 "include/linux/quota.h" | |
5875 | struct if_dqblk { | |
5876 | __u64 dqb_bhardlimit; | |
5877 | __u64 dqb_bsoftlimit; | |
5878 | __u64 dqb_curspace; | |
5879 | __u64 dqb_ihardlimit; | |
5880 | __u64 dqb_isoftlimit; | |
5881 | __u64 dqb_curinodes; | |
5882 | __u64 dqb_btime; | |
5883 | __u64 dqb_itime; | |
5884 | __u32 dqb_valid; | |
5885 | }; | |
5886 | # 124 "include/linux/quota.h" | |
5887 | struct if_dqinfo { | |
5888 | __u64 dqi_bgrace; | |
5889 | __u64 dqi_igrace; | |
5890 | __u32 dqi_flags; | |
5891 | __u32 dqi_valid; | |
5892 | }; | |
5893 | ||
5894 | ||
5895 | ||
5896 | ||
5897 | ||
5898 | ||
5899 | # 1 "include/linux/dqblk_xfs.h" 1 | |
5900 | # 50 "include/linux/dqblk_xfs.h" | |
5901 | typedef struct fs_disk_quota { | |
5902 | __s8 d_version; | |
5903 | __s8 d_flags; | |
5904 | __u16 d_fieldmask; | |
5905 | __u32 d_id; | |
5906 | __u64 d_blk_hardlimit; | |
5907 | __u64 d_blk_softlimit; | |
5908 | __u64 d_ino_hardlimit; | |
5909 | __u64 d_ino_softlimit; | |
5910 | __u64 d_bcount; | |
5911 | __u64 d_icount; | |
5912 | __s32 d_itimer; | |
5913 | ||
5914 | __s32 d_btimer; | |
5915 | __u16 d_iwarns; | |
5916 | __u16 d_bwarns; | |
5917 | __s32 d_padding2; | |
5918 | __u64 d_rtb_hardlimit; | |
5919 | __u64 d_rtb_softlimit; | |
5920 | __u64 d_rtbcount; | |
5921 | __s32 d_rtbtimer; | |
5922 | __u16 d_rtbwarns; | |
5923 | __s16 d_padding3; | |
5924 | char d_padding4[8]; | |
5925 | } fs_disk_quota_t; | |
5926 | # 137 "include/linux/dqblk_xfs.h" | |
5927 | typedef struct fs_qfilestat { | |
5928 | __u64 qfs_ino; | |
5929 | __u64 qfs_nblks; | |
5930 | __u32 qfs_nextents; | |
5931 | } fs_qfilestat_t; | |
5932 | ||
5933 | typedef struct fs_quota_stat { | |
5934 | __s8 qs_version; | |
5935 | __u16 qs_flags; | |
5936 | __s8 qs_pad; | |
5937 | fs_qfilestat_t qs_uquota; | |
5938 | fs_qfilestat_t qs_gquota; | |
5939 | __u32 qs_incoredqs; | |
5940 | __s32 qs_btimelimit; | |
5941 | __s32 qs_itimelimit; | |
5942 | __s32 qs_rtbtimelimit; | |
5943 | __u16 qs_bwarnlimit; | |
5944 | __u16 qs_iwarnlimit; | |
5945 | } fs_quota_stat_t; | |
5946 | # 137 "include/linux/quota.h" 2 | |
5947 | # 1 "include/linux/dqblk_v1.h" 1 | |
5948 | # 21 "include/linux/dqblk_v1.h" | |
5949 | struct v1_mem_dqinfo { | |
5950 | }; | |
5951 | # 138 "include/linux/quota.h" 2 | |
5952 | # 1 "include/linux/dqblk_v2.h" 1 | |
5953 | # 20 "include/linux/dqblk_v2.h" | |
5954 | struct v2_mem_dqinfo { | |
5955 | unsigned int dqi_blocks; | |
5956 | unsigned int dqi_free_blk; | |
5957 | unsigned int dqi_free_entry; | |
5958 | }; | |
5959 | # 139 "include/linux/quota.h" 2 | |
5960 | ||
5961 | extern spinlock_t dq_data_lock; | |
5962 | # 152 "include/linux/quota.h" | |
5963 | struct mem_dqblk { | |
5964 | __u32 dqb_bhardlimit; | |
5965 | __u32 dqb_bsoftlimit; | |
5966 | qsize_t dqb_curspace; | |
5967 | __u32 dqb_ihardlimit; | |
5968 | __u32 dqb_isoftlimit; | |
5969 | __u32 dqb_curinodes; | |
5970 | time_t dqb_btime; | |
5971 | time_t dqb_itime; | |
5972 | }; | |
5973 | ||
5974 | ||
5975 | ||
5976 | ||
5977 | struct quota_format_type; | |
5978 | ||
5979 | struct mem_dqinfo { | |
5980 | struct quota_format_type *dqi_format; | |
5981 | struct list_head dqi_dirty_list; | |
5982 | unsigned long dqi_flags; | |
5983 | unsigned int dqi_bgrace; | |
5984 | unsigned int dqi_igrace; | |
5985 | union { | |
5986 | struct v1_mem_dqinfo v1_i; | |
5987 | struct v2_mem_dqinfo v2_i; | |
5988 | } u; | |
5989 | }; | |
5990 | ||
5991 | struct super_block; | |
5992 | ||
5993 | ||
5994 | ||
5995 | ||
5996 | ||
5997 | extern void mark_info_dirty(struct super_block *sb, int type); | |
5998 | ||
5999 | ||
6000 | ||
6001 | ||
6002 | ||
6003 | ||
6004 | ||
6005 | struct dqstats { | |
6006 | int lookups; | |
6007 | int drops; | |
6008 | int reads; | |
6009 | int writes; | |
6010 | int cache_hits; | |
6011 | int allocated_dquots; | |
6012 | int free_dquots; | |
6013 | int syncs; | |
6014 | }; | |
6015 | ||
6016 | extern struct dqstats dqstats; | |
6017 | # 214 "include/linux/quota.h" | |
6018 | struct dquot { | |
6019 | struct hlist_node dq_hash; | |
6020 | struct list_head dq_inuse; | |
6021 | struct list_head dq_free; | |
6022 | struct list_head dq_dirty; | |
6023 | struct mutex dq_lock; | |
6024 | atomic_t dq_count; | |
6025 | wait_queue_head_t dq_wait_unused; | |
6026 | struct super_block *dq_sb; | |
6027 | unsigned int dq_id; | |
6028 | loff_t dq_off; | |
6029 | unsigned long dq_flags; | |
6030 | short dq_type; | |
6031 | struct mem_dqblk dq_dqb; | |
6032 | }; | |
6033 | ||
6034 | ||
6035 | ||
6036 | ||
6037 | ||
6038 | ||
6039 | ||
6040 | struct quota_format_ops { | |
6041 | int (*check_quota_file)(struct super_block *sb, int type); | |
6042 | int (*read_file_info)(struct super_block *sb, int type); | |
6043 | int (*write_file_info)(struct super_block *sb, int type); | |
6044 | int (*free_file_info)(struct super_block *sb, int type); | |
6045 | int (*read_dqblk)(struct dquot *dquot); | |
6046 | int (*commit_dqblk)(struct dquot *dquot); | |
6047 | int (*release_dqblk)(struct dquot *dquot); | |
6048 | }; | |
6049 | ||
6050 | ||
6051 | struct dquot_operations { | |
6052 | int (*initialize) (struct inode *, int); | |
6053 | int (*drop) (struct inode *); | |
6054 | int (*alloc_space) (struct inode *, qsize_t, int); | |
6055 | int (*alloc_inode) (const struct inode *, unsigned long); | |
6056 | int (*free_space) (struct inode *, qsize_t); | |
6057 | int (*free_inode) (const struct inode *, unsigned long); | |
6058 | int (*transfer) (struct inode *, struct iattr *); | |
6059 | int (*write_dquot) (struct dquot *); | |
6060 | int (*acquire_dquot) (struct dquot *); | |
6061 | int (*release_dquot) (struct dquot *); | |
6062 | int (*mark_dirty) (struct dquot *); | |
6063 | int (*write_info) (struct super_block *, int); | |
6064 | }; | |
6065 | ||
6066 | ||
6067 | struct quotactl_ops { | |
6068 | int (*quota_on)(struct super_block *, int, int, char *); | |
6069 | int (*quota_off)(struct super_block *, int); | |
6070 | int (*quota_sync)(struct super_block *, int); | |
6071 | int (*get_info)(struct super_block *, int, struct if_dqinfo *); | |
6072 | int (*set_info)(struct super_block *, int, struct if_dqinfo *); | |
6073 | int (*get_dqblk)(struct super_block *, int, qid_t, struct if_dqblk *); | |
6074 | int (*set_dqblk)(struct super_block *, int, qid_t, struct if_dqblk *); | |
6075 | int (*get_xstate)(struct super_block *, struct fs_quota_stat *); | |
6076 | int (*set_xstate)(struct super_block *, unsigned int, int); | |
6077 | int (*get_xquota)(struct super_block *, int, qid_t, struct fs_disk_quota *); | |
6078 | int (*set_xquota)(struct super_block *, int, qid_t, struct fs_disk_quota *); | |
6079 | }; | |
6080 | ||
6081 | struct quota_format_type { | |
6082 | int qf_fmt_id; | |
6083 | struct quota_format_ops *qf_ops; | |
6084 | struct module *qf_owner; | |
6085 | struct quota_format_type *qf_next; | |
6086 | }; | |
6087 | ||
6088 | ||
6089 | ||
6090 | ||
6091 | struct quota_info { | |
6092 | unsigned int flags; | |
6093 | struct mutex dqio_mutex; | |
6094 | struct mutex dqonoff_mutex; | |
6095 | struct rw_semaphore dqptr_sem; | |
6096 | struct inode *files[2]; | |
6097 | struct mem_dqinfo info[2]; | |
6098 | struct quota_format_ops *ops[2]; | |
6099 | }; | |
6100 | ||
6101 | ||
6102 | int mark_dquot_dirty(struct dquot *dquot); | |
6103 | # 308 "include/linux/quota.h" | |
6104 | int register_quota_format(struct quota_format_type *fmt); | |
6105 | void unregister_quota_format(struct quota_format_type *fmt); | |
6106 | ||
6107 | struct quota_module_name { | |
6108 | int qm_fmt_id; | |
6109 | char *qm_mod_name; | |
6110 | }; | |
6111 | # 362 "include/linux/fs.h" 2 | |
6112 | # 389 "include/linux/fs.h" | |
6113 | enum positive_aop_returns { | |
6114 | AOP_WRITEPAGE_ACTIVATE = 0x80000, | |
6115 | AOP_TRUNCATED_PAGE = 0x80001, | |
6116 | }; | |
6117 | ||
6118 | ||
6119 | ||
6120 | ||
6121 | struct page; | |
6122 | struct address_space; | |
6123 | struct writeback_control; | |
6124 | ||
6125 | struct address_space_operations { | |
6126 | int (*writepage)(struct page *page, struct writeback_control *wbc); | |
6127 | int (*readpage)(struct file *, struct page *); | |
6128 | void (*sync_page)(struct page *); | |
6129 | ||
6130 | ||
6131 | int (*writepages)(struct address_space *, struct writeback_control *); | |
6132 | ||
6133 | ||
6134 | int (*set_page_dirty)(struct page *page); | |
6135 | ||
6136 | int (*readpages)(struct file *filp, struct address_space *mapping, | |
6137 | struct list_head *pages, unsigned nr_pages); | |
6138 | ||
6139 | ||
6140 | ||
6141 | ||
6142 | ||
6143 | int (*prepare_write)(struct file *, struct page *, unsigned, unsigned); | |
6144 | int (*commit_write)(struct file *, struct page *, unsigned, unsigned); | |
6145 | ||
6146 | sector_t (*bmap)(struct address_space *, sector_t); | |
6147 | void (*invalidatepage) (struct page *, unsigned long); | |
6148 | int (*releasepage) (struct page *, gfp_t); | |
6149 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, | |
6150 | loff_t offset, unsigned long nr_segs); | |
6151 | struct page* (*get_xip_page)(struct address_space *, sector_t, | |
6152 | int); | |
6153 | ||
6154 | int (*migratepage) (struct address_space *, | |
6155 | struct page *, struct page *); | |
6156 | int (*launder_page) (struct page *); | |
6157 | }; | |
6158 | ||
6159 | struct backing_dev_info; | |
6160 | struct address_space { | |
6161 | struct inode *host; | |
6162 | struct radix_tree_root page_tree; | |
6163 | rwlock_t tree_lock; | |
6164 | unsigned int i_mmap_writable; | |
6165 | struct prio_tree_root i_mmap; | |
6166 | struct list_head i_mmap_nonlinear; | |
6167 | spinlock_t i_mmap_lock; | |
6168 | unsigned int truncate_count; | |
6169 | unsigned long nrpages; | |
6170 | unsigned long writeback_index; | |
6171 | const struct address_space_operations *a_ops; | |
6172 | unsigned long flags; | |
6173 | struct backing_dev_info *backing_dev_info; | |
6174 | spinlock_t private_lock; | |
6175 | struct list_head private_list; | |
6176 | struct address_space *assoc_mapping; | |
6177 | } __attribute__((aligned(sizeof(long)))); | |
6178 | ||
6179 | ||
6180 | ||
6181 | ||
6182 | ||
6183 | ||
6184 | struct block_device { | |
6185 | dev_t bd_dev; | |
6186 | struct inode * bd_inode; | |
6187 | int bd_openers; | |
6188 | struct mutex bd_mutex; | |
6189 | struct semaphore bd_mount_sem; | |
6190 | struct list_head bd_inodes; | |
6191 | void * bd_holder; | |
6192 | int bd_holders; | |
6193 | ||
6194 | struct list_head bd_holder_list; | |
6195 | ||
6196 | struct block_device * bd_contains; | |
6197 | unsigned bd_block_size; | |
6198 | struct hd_struct * bd_part; | |
6199 | ||
6200 | unsigned bd_part_count; | |
6201 | int bd_invalidated; | |
6202 | struct gendisk * bd_disk; | |
6203 | struct list_head bd_list; | |
6204 | struct backing_dev_info *bd_inode_backing_dev_info; | |
6205 | ||
6206 | ||
6207 | ||
6208 | ||
6209 | ||
6210 | ||
6211 | unsigned long bd_private; | |
6212 | }; | |
6213 | # 497 "include/linux/fs.h" | |
6214 | int mapping_tagged(struct address_space *mapping, int tag); | |
6215 | ||
6216 | ||
6217 | ||
6218 | ||
6219 | static inline __attribute__((always_inline)) int mapping_mapped(struct address_space *mapping) | |
6220 | { | |
6221 | return !prio_tree_empty(&mapping->i_mmap) || | |
6222 | !list_empty(&mapping->i_mmap_nonlinear); | |
6223 | } | |
6224 | ||
6225 | ||
6226 | ||
6227 | ||
6228 | ||
6229 | ||
6230 | ||
6231 | static inline __attribute__((always_inline)) int mapping_writably_mapped(struct address_space *mapping) | |
6232 | { | |
6233 | return mapping->i_mmap_writable != 0; | |
6234 | } | |
6235 | # 530 "include/linux/fs.h" | |
6236 | struct inode { | |
6237 | struct hlist_node i_hash; | |
6238 | struct list_head i_list; | |
6239 | struct list_head i_sb_list; | |
6240 | struct list_head i_dentry; | |
6241 | unsigned long i_ino; | |
6242 | atomic_t i_count; | |
6243 | unsigned int i_nlink; | |
6244 | uid_t i_uid; | |
6245 | gid_t i_gid; | |
6246 | dev_t i_rdev; | |
6247 | unsigned long i_version; | |
6248 | loff_t i_size; | |
6249 | ||
6250 | ||
6251 | ||
6252 | struct timespec i_atime; | |
6253 | struct timespec i_mtime; | |
6254 | struct timespec i_ctime; | |
6255 | unsigned int i_blkbits; | |
6256 | blkcnt_t i_blocks; | |
6257 | unsigned short i_bytes; | |
6258 | umode_t i_mode; | |
6259 | spinlock_t i_lock; | |
6260 | struct mutex i_mutex; | |
6261 | struct rw_semaphore i_alloc_sem; | |
6262 | const struct inode_operations *i_op; | |
6263 | const struct file_operations *i_fop; | |
6264 | struct super_block *i_sb; | |
6265 | struct file_lock *i_flock; | |
6266 | struct address_space *i_mapping; | |
6267 | struct address_space i_data; | |
6268 | ||
6269 | ||
6270 | ||
6271 | struct list_head i_devices; | |
6272 | union { | |
6273 | struct pipe_inode_info *i_pipe; | |
6274 | struct block_device *i_bdev; | |
6275 | struct cdev *i_cdev; | |
6276 | }; | |
6277 | int i_cindex; | |
6278 | ||
6279 | __u32 i_generation; | |
6280 | ||
6281 | ||
6282 | ||
6283 | ||
6284 | ||
6285 | ||
6286 | ||
6287 | struct list_head inotify_watches; | |
6288 | struct mutex inotify_mutex; | |
6289 | ||
6290 | ||
6291 | unsigned long i_state; | |
6292 | unsigned long dirtied_when; | |
6293 | ||
6294 | unsigned int i_flags; | |
6295 | ||
6296 | atomic_t i_writecount; | |
6297 | ||
6298 | void *i_security; | |
6299 | ||
6300 | void *i_private; | |
6301 | }; | |
6302 | # 608 "include/linux/fs.h" | |
6303 | enum inode_i_mutex_lock_class | |
6304 | { | |
6305 | I_MUTEX_NORMAL, | |
6306 | I_MUTEX_PARENT, | |
6307 | I_MUTEX_CHILD, | |
6308 | I_MUTEX_XATTR, | |
6309 | I_MUTEX_QUOTA | |
6310 | }; | |
6311 | ||
6312 | extern void inode_double_lock(struct inode *inode1, struct inode *inode2); | |
6313 | extern void inode_double_unlock(struct inode *inode1, struct inode *inode2); | |
6314 | # 630 "include/linux/fs.h" | |
6315 | static inline __attribute__((always_inline)) loff_t i_size_read(const struct inode *inode) | |
6316 | { | |
6317 | # 649 "include/linux/fs.h" | |
6318 | return inode->i_size; | |
6319 | ||
6320 | } | |
6321 | ||
6322 | ||
6323 | ||
6324 | ||
6325 | ||
6326 | ||
6327 | static inline __attribute__((always_inline)) void i_size_write(struct inode *inode, loff_t i_size) | |
6328 | { | |
6329 | # 669 "include/linux/fs.h" | |
6330 | inode->i_size = i_size; | |
6331 | ||
6332 | } | |
6333 | ||
6334 | static inline __attribute__((always_inline)) unsigned iminor(const struct inode *inode) | |
6335 | { | |
6336 | return ((unsigned int) ((inode->i_rdev) & ((1U << 20) - 1))); | |
6337 | } | |
6338 | ||
6339 | static inline __attribute__((always_inline)) unsigned imajor(const struct inode *inode) | |
6340 | { | |
6341 | return ((unsigned int) ((inode->i_rdev) >> 20)); | |
6342 | } | |
6343 | ||
6344 | extern struct block_device *I_BDEV(struct inode *inode); | |
6345 | ||
6346 | struct fown_struct { | |
6347 | rwlock_t lock; | |
6348 | struct pid *pid; | |
6349 | enum pid_type pid_type; | |
6350 | uid_t uid, euid; | |
6351 | int signum; | |
6352 | }; | |
6353 | ||
6354 | ||
6355 | ||
6356 | ||
6357 | struct file_ra_state { | |
6358 | unsigned long start; | |
6359 | unsigned long size; | |
6360 | unsigned long flags; | |
6361 | unsigned long cache_hit; | |
6362 | unsigned long prev_index; | |
6363 | unsigned long ahead_start; | |
6364 | unsigned long ahead_size; | |
6365 | unsigned long ra_pages; | |
6366 | unsigned long mmap_hit; | |
6367 | unsigned long mmap_miss; | |
6368 | unsigned int prev_offset; | |
6369 | }; | |
6370 | ||
6371 | ||
6372 | ||
6373 | struct file { | |
6374 | ||
6375 | ||
6376 | ||
6377 | ||
6378 | union { | |
6379 | struct list_head fu_list; | |
6380 | struct rcu_head fu_rcuhead; | |
6381 | } f_u; | |
6382 | struct path f_path; | |
6383 | ||
6384 | ||
6385 | const struct file_operations *f_op; | |
6386 | atomic_t f_count; | |
6387 | unsigned int f_flags; | |
6388 | mode_t f_mode; | |
6389 | loff_t f_pos; | |
6390 | struct fown_struct f_owner; | |
6391 | unsigned int f_uid, f_gid; | |
6392 | struct file_ra_state f_ra; | |
6393 | ||
6394 | unsigned long f_version; | |
6395 | ||
6396 | void *f_security; | |
6397 | ||
6398 | ||
6399 | void *private_data; | |
6400 | ||
6401 | ||
6402 | ||
6403 | struct list_head f_ep_links; | |
6404 | spinlock_t f_ep_lock; | |
6405 | ||
6406 | struct address_space *f_mapping; | |
6407 | }; | |
6408 | extern spinlock_t files_lock; | |
6409 | # 779 "include/linux/fs.h" | |
6410 | typedef struct files_struct *fl_owner_t; | |
6411 | ||
6412 | struct file_lock_operations { | |
6413 | void (*fl_insert)(struct file_lock *); | |
6414 | void (*fl_remove)(struct file_lock *); | |
6415 | void (*fl_copy_lock)(struct file_lock *, struct file_lock *); | |
6416 | void (*fl_release_private)(struct file_lock *); | |
6417 | }; | |
6418 | ||
6419 | struct lock_manager_operations { | |
6420 | int (*fl_compare_owner)(struct file_lock *, struct file_lock *); | |
6421 | void (*fl_notify)(struct file_lock *); | |
6422 | int (*fl_grant)(struct file_lock *, struct file_lock *, int); | |
6423 | void (*fl_copy_lock)(struct file_lock *, struct file_lock *); | |
6424 | void (*fl_release_private)(struct file_lock *); | |
6425 | void (*fl_break)(struct file_lock *); | |
6426 | int (*fl_mylease)(struct file_lock *, struct file_lock *); | |
6427 | int (*fl_change)(struct file_lock **, int); | |
6428 | }; | |
6429 | ||
6430 | ||
6431 | # 1 "include/linux/nfs_fs_i.h" 1 | |
6432 | ||
6433 | ||
6434 | ||
6435 | ||
6436 | ||
6437 | # 1 "include/linux/nfs.h" 1 | |
6438 | # 39 "include/linux/nfs.h" | |
6439 | enum nfs_stat { | |
6440 | NFS_OK = 0, | |
6441 | NFSERR_PERM = 1, | |
6442 | NFSERR_NOENT = 2, | |
6443 | NFSERR_IO = 5, | |
6444 | NFSERR_NXIO = 6, | |
6445 | NFSERR_EAGAIN = 11, | |
6446 | NFSERR_ACCES = 13, | |
6447 | NFSERR_EXIST = 17, | |
6448 | NFSERR_XDEV = 18, | |
6449 | NFSERR_NODEV = 19, | |
6450 | NFSERR_NOTDIR = 20, | |
6451 | NFSERR_ISDIR = 21, | |
6452 | NFSERR_INVAL = 22, | |
6453 | NFSERR_FBIG = 27, | |
6454 | NFSERR_NOSPC = 28, | |
6455 | NFSERR_ROFS = 30, | |
6456 | NFSERR_MLINK = 31, | |
6457 | NFSERR_OPNOTSUPP = 45, | |
6458 | NFSERR_NAMETOOLONG = 63, | |
6459 | NFSERR_NOTEMPTY = 66, | |
6460 | NFSERR_DQUOT = 69, | |
6461 | NFSERR_STALE = 70, | |
6462 | NFSERR_REMOTE = 71, | |
6463 | NFSERR_WFLUSH = 99, | |
6464 | NFSERR_BADHANDLE = 10001, | |
6465 | NFSERR_NOT_SYNC = 10002, | |
6466 | NFSERR_BAD_COOKIE = 10003, | |
6467 | NFSERR_NOTSUPP = 10004, | |
6468 | NFSERR_TOOSMALL = 10005, | |
6469 | NFSERR_SERVERFAULT = 10006, | |
6470 | NFSERR_BADTYPE = 10007, | |
6471 | NFSERR_JUKEBOX = 10008, | |
6472 | NFSERR_SAME = 10009, | |
6473 | NFSERR_DENIED = 10010, | |
6474 | NFSERR_EXPIRED = 10011, | |
6475 | NFSERR_LOCKED = 10012, | |
6476 | NFSERR_GRACE = 10013, | |
6477 | NFSERR_FHEXPIRED = 10014, | |
6478 | NFSERR_SHARE_DENIED = 10015, | |
6479 | NFSERR_WRONGSEC = 10016, | |
6480 | NFSERR_CLID_INUSE = 10017, | |
6481 | NFSERR_RESOURCE = 10018, | |
6482 | NFSERR_MOVED = 10019, | |
6483 | NFSERR_NOFILEHANDLE = 10020, | |
6484 | NFSERR_MINOR_VERS_MISMATCH = 10021, | |
6485 | NFSERR_STALE_CLIENTID = 10022, | |
6486 | NFSERR_STALE_STATEID = 10023, | |
6487 | NFSERR_OLD_STATEID = 10024, | |
6488 | NFSERR_BAD_STATEID = 10025, | |
6489 | NFSERR_BAD_SEQID = 10026, | |
6490 | NFSERR_NOT_SAME = 10027, | |
6491 | NFSERR_LOCK_RANGE = 10028, | |
6492 | NFSERR_SYMLINK = 10029, | |
6493 | NFSERR_RESTOREFH = 10030, | |
6494 | NFSERR_LEASE_MOVED = 10031, | |
6495 | NFSERR_ATTRNOTSUPP = 10032, | |
6496 | NFSERR_NO_GRACE = 10033, | |
6497 | NFSERR_RECLAIM_BAD = 10034, | |
6498 | NFSERR_RECLAIM_CONFLICT = 10035, | |
6499 | NFSERR_BAD_XDR = 10036, | |
6500 | NFSERR_LOCKS_HELD = 10037, | |
6501 | NFSERR_OPENMODE = 10038, | |
6502 | NFSERR_BADOWNER = 10039, | |
6503 | NFSERR_BADCHAR = 10040, | |
6504 | NFSERR_BADNAME = 10041, | |
6505 | NFSERR_BAD_RANGE = 10042, | |
6506 | NFSERR_LOCK_NOTSUPP = 10043, | |
6507 | NFSERR_OP_ILLEGAL = 10044, | |
6508 | NFSERR_DEADLOCK = 10045, | |
6509 | NFSERR_FILE_OPEN = 10046, | |
6510 | NFSERR_ADMIN_REVOKED = 10047, | |
6511 | NFSERR_CB_PATH_DOWN = 10048, | |
6512 | NFSERR_REPLAY_ME = 10049 | |
6513 | }; | |
6514 | ||
6515 | ||
6516 | ||
6517 | enum nfs_ftype { | |
6518 | NFNON = 0, | |
6519 | NFREG = 1, | |
6520 | NFDIR = 2, | |
6521 | NFBLK = 3, | |
6522 | NFCHR = 4, | |
6523 | NFLNK = 5, | |
6524 | NFSOCK = 6, | |
6525 | NFBAD = 7, | |
6526 | NFFIFO = 8 | |
6527 | }; | |
6528 | ||
6529 | ||
6530 | # 1 "include/linux/sunrpc/msg_prot.h" 1 | |
6531 | # 18 "include/linux/sunrpc/msg_prot.h" | |
6532 | typedef u32 rpc_authflavor_t; | |
6533 | ||
6534 | enum rpc_auth_flavors { | |
6535 | RPC_AUTH_NULL = 0, | |
6536 | RPC_AUTH_UNIX = 1, | |
6537 | RPC_AUTH_SHORT = 2, | |
6538 | RPC_AUTH_DES = 3, | |
6539 | RPC_AUTH_KRB = 4, | |
6540 | RPC_AUTH_GSS = 6, | |
6541 | RPC_AUTH_MAXFLAVOR = 8, | |
6542 | ||
6543 | RPC_AUTH_GSS_KRB5 = 390003, | |
6544 | RPC_AUTH_GSS_KRB5I = 390004, | |
6545 | RPC_AUTH_GSS_KRB5P = 390005, | |
6546 | RPC_AUTH_GSS_LKEY = 390006, | |
6547 | RPC_AUTH_GSS_LKEYI = 390007, | |
6548 | RPC_AUTH_GSS_LKEYP = 390008, | |
6549 | RPC_AUTH_GSS_SPKM = 390009, | |
6550 | RPC_AUTH_GSS_SPKMI = 390010, | |
6551 | RPC_AUTH_GSS_SPKMP = 390011, | |
6552 | }; | |
6553 | ||
6554 | ||
6555 | ||
6556 | ||
6557 | enum rpc_msg_type { | |
6558 | RPC_CALL = 0, | |
6559 | RPC_REPLY = 1 | |
6560 | }; | |
6561 | ||
6562 | enum rpc_reply_stat { | |
6563 | RPC_MSG_ACCEPTED = 0, | |
6564 | RPC_MSG_DENIED = 1 | |
6565 | }; | |
6566 | ||
6567 | enum rpc_accept_stat { | |
6568 | RPC_SUCCESS = 0, | |
6569 | RPC_PROG_UNAVAIL = 1, | |
6570 | RPC_PROG_MISMATCH = 2, | |
6571 | RPC_PROC_UNAVAIL = 3, | |
6572 | RPC_GARBAGE_ARGS = 4, | |
6573 | RPC_SYSTEM_ERR = 5, | |
6574 | ||
6575 | RPC_DROP_REPLY = 60000, | |
6576 | }; | |
6577 | ||
6578 | enum rpc_reject_stat { | |
6579 | RPC_MISMATCH = 0, | |
6580 | RPC_AUTH_ERROR = 1 | |
6581 | }; | |
6582 | ||
6583 | enum rpc_auth_stat { | |
6584 | RPC_AUTH_OK = 0, | |
6585 | RPC_AUTH_BADCRED = 1, | |
6586 | RPC_AUTH_REJECTEDCRED = 2, | |
6587 | RPC_AUTH_BADVERF = 3, | |
6588 | RPC_AUTH_REJECTEDVERF = 4, | |
6589 | RPC_AUTH_TOOWEAK = 5, | |
6590 | ||
6591 | RPCSEC_GSS_CREDPROBLEM = 13, | |
6592 | RPCSEC_GSS_CTXPROBLEM = 14 | |
6593 | }; | |
6594 | # 102 "include/linux/sunrpc/msg_prot.h" | |
6595 | typedef __be32 rpc_fraghdr; | |
6596 | # 131 "include/linux/nfs.h" 2 | |
6597 | ||
6598 | ||
6599 | ||
6600 | ||
6601 | ||
6602 | ||
6603 | struct nfs_fh { | |
6604 | unsigned short size; | |
6605 | unsigned char data[128]; | |
6606 | }; | |
6607 | ||
6608 | ||
6609 | ||
6610 | ||
6611 | ||
6612 | static inline __attribute__((always_inline)) int nfs_compare_fh(const struct nfs_fh *a, const struct nfs_fh *b) | |
6613 | { | |
6614 | return a->size != b->size || memcmp(a->data, b->data, a->size) != 0; | |
6615 | } | |
6616 | ||
6617 | static inline __attribute__((always_inline)) void nfs_copy_fh(struct nfs_fh *target, const struct nfs_fh *source) | |
6618 | { | |
6619 | target->size = source->size; | |
6620 | memcpy(target->data, source->data, source->size); | |
6621 | } | |
6622 | # 165 "include/linux/nfs.h" | |
6623 | enum nfs3_stable_how { | |
6624 | NFS_UNSTABLE = 0, | |
6625 | NFS_DATA_SYNC = 1, | |
6626 | NFS_FILE_SYNC = 2 | |
6627 | }; | |
6628 | # 7 "include/linux/nfs_fs_i.h" 2 | |
6629 | ||
6630 | struct nlm_lockowner; | |
6631 | ||
6632 | ||
6633 | ||
6634 | ||
6635 | struct nfs_lock_info { | |
6636 | u32 state; | |
6637 | struct nlm_lockowner *owner; | |
6638 | struct list_head list; | |
6639 | }; | |
6640 | ||
6641 | struct nfs4_lock_state; | |
6642 | struct nfs4_lock_info { | |
6643 | struct nfs4_lock_state *owner; | |
6644 | }; | |
6645 | # 801 "include/linux/fs.h" 2 | |
6646 | ||
6647 | struct file_lock { | |
6648 | struct file_lock *fl_next; | |
6649 | struct list_head fl_link; | |
6650 | struct list_head fl_block; | |
6651 | fl_owner_t fl_owner; | |
6652 | unsigned int fl_pid; | |
6653 | wait_queue_head_t fl_wait; | |
6654 | struct file *fl_file; | |
6655 | unsigned char fl_flags; | |
6656 | unsigned char fl_type; | |
6657 | loff_t fl_start; | |
6658 | loff_t fl_end; | |
6659 | ||
6660 | struct fasync_struct * fl_fasync; | |
6661 | unsigned long fl_break_time; | |
6662 | ||
6663 | struct file_lock_operations *fl_ops; | |
6664 | struct lock_manager_operations *fl_lmops; | |
6665 | union { | |
6666 | struct nfs_lock_info nfs_fl; | |
6667 | struct nfs4_lock_info nfs4_fl; | |
6668 | } fl_u; | |
6669 | }; | |
6670 | # 833 "include/linux/fs.h" | |
6671 | # 1 "include/linux/fcntl.h" 1 | |
6672 | ||
6673 | ||
6674 | ||
6675 | # 1 "include/asm/fcntl.h" 1 | |
6676 | # 11 "include/asm/fcntl.h" | |
6677 | # 1 "include/asm-generic/fcntl.h" 1 | |
6678 | # 114 "include/asm-generic/fcntl.h" | |
6679 | struct flock { | |
6680 | short l_type; | |
6681 | short l_whence; | |
6682 | off_t l_start; | |
6683 | off_t l_len; | |
6684 | pid_t l_pid; | |
6685 | ||
6686 | }; | |
6687 | # 137 "include/asm-generic/fcntl.h" | |
6688 | struct flock64 { | |
6689 | short l_type; | |
6690 | short l_whence; | |
6691 | loff_t l_start; | |
6692 | loff_t l_len; | |
6693 | pid_t l_pid; | |
6694 | ||
6695 | }; | |
6696 | # 12 "include/asm/fcntl.h" 2 | |
6697 | # 5 "include/linux/fcntl.h" 2 | |
6698 | # 834 "include/linux/fs.h" 2 | |
6699 | ||
6700 | extern int fcntl_getlk(struct file *, struct flock *); | |
6701 | extern int fcntl_setlk(unsigned int, struct file *, unsigned int, | |
6702 | struct flock *); | |
6703 | ||
6704 | ||
6705 | extern int fcntl_getlk64(struct file *, struct flock64 *); | |
6706 | extern int fcntl_setlk64(unsigned int, struct file *, unsigned int, | |
6707 | struct flock64 *); | |
6708 | ||
6709 | ||
6710 | extern void send_sigio(struct fown_struct *fown, int fd, int band); | |
6711 | extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); | |
6712 | extern int fcntl_getlease(struct file *filp); | |
6713 | ||
6714 | ||
6715 | extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset, | |
6716 | loff_t endbyte, unsigned int flags); | |
6717 | ||
6718 | ||
6719 | extern void locks_init_lock(struct file_lock *); | |
6720 | extern void locks_copy_lock(struct file_lock *, struct file_lock *); | |
6721 | extern void locks_remove_posix(struct file *, fl_owner_t); | |
6722 | extern void locks_remove_flock(struct file *); | |
6723 | extern int posix_test_lock(struct file *, struct file_lock *); | |
6724 | extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *); | |
6725 | extern int posix_lock_file_wait(struct file *, struct file_lock *); | |
6726 | extern int posix_unblock_lock(struct file *, struct file_lock *); | |
6727 | extern int vfs_test_lock(struct file *, struct file_lock *); | |
6728 | extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *); | |
6729 | extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl); | |
6730 | extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); | |
6731 | extern int __break_lease(struct inode *inode, unsigned int flags); | |
6732 | extern void lease_get_mtime(struct inode *, struct timespec *time); | |
6733 | extern int setlease(struct file *, long, struct file_lock **); | |
6734 | extern int lease_modify(struct file_lock **, int); | |
6735 | extern int lock_may_read(struct inode *, loff_t start, unsigned long count); | |
6736 | extern int lock_may_write(struct inode *, loff_t start, unsigned long count); | |
6737 | ||
6738 | struct fasync_struct { | |
6739 | int magic; | |
6740 | int fa_fd; | |
6741 | struct fasync_struct *fa_next; | |
6742 | struct file *fa_file; | |
6743 | }; | |
6744 | ||
6745 | ||
6746 | ||
6747 | ||
6748 | extern int fasync_helper(int, struct file *, int, struct fasync_struct **); | |
6749 | ||
6750 | extern void kill_fasync(struct fasync_struct **, int, int); | |
6751 | ||
6752 | extern void __kill_fasync(struct fasync_struct *, int, int); | |
6753 | ||
6754 | extern int __f_setown(struct file *filp, struct pid *, enum pid_type, int force); | |
6755 | extern int f_setown(struct file *filp, unsigned long arg, int force); | |
6756 | extern void f_delown(struct file *filp); | |
6757 | extern pid_t f_getown(struct file *filp); | |
6758 | extern int send_sigurg(struct fown_struct *fown); | |
6759 | # 903 "include/linux/fs.h" | |
6760 | extern struct list_head super_blocks; | |
6761 | extern spinlock_t sb_lock; | |
6762 | ||
6763 | ||
6764 | ||
6765 | struct super_block { | |
6766 | struct list_head s_list; | |
6767 | dev_t s_dev; | |
6768 | unsigned long s_blocksize; | |
6769 | unsigned char s_blocksize_bits; | |
6770 | unsigned char s_dirt; | |
6771 | unsigned long long s_maxbytes; | |
6772 | struct file_system_type *s_type; | |
6773 | const struct super_operations *s_op; | |
6774 | struct dquot_operations *dq_op; | |
6775 | struct quotactl_ops *s_qcop; | |
6776 | struct export_operations *s_export_op; | |
6777 | unsigned long s_flags; | |
6778 | unsigned long s_magic; | |
6779 | struct dentry *s_root; | |
6780 | struct rw_semaphore s_umount; | |
6781 | struct mutex s_lock; | |
6782 | int s_count; | |
6783 | int s_syncing; | |
6784 | int s_need_sync_fs; | |
6785 | atomic_t s_active; | |
6786 | ||
6787 | void *s_security; | |
6788 | ||
6789 | struct xattr_handler **s_xattr; | |
6790 | ||
6791 | struct list_head s_inodes; | |
6792 | struct list_head s_dirty; | |
6793 | struct list_head s_io; | |
6794 | struct hlist_head s_anon; | |
6795 | struct list_head s_files; | |
6796 | ||
6797 | struct block_device *s_bdev; | |
6798 | struct mtd_info *s_mtd; | |
6799 | struct list_head s_instances; | |
6800 | struct quota_info s_dquot; | |
6801 | ||
6802 | int s_frozen; | |
6803 | wait_queue_head_t s_wait_unfrozen; | |
6804 | ||
6805 | char s_id[32]; | |
6806 | ||
6807 | void *s_fs_info; | |
6808 | ||
6809 | ||
6810 | ||
6811 | ||
6812 | ||
6813 | struct mutex s_vfs_rename_mutex; | |
6814 | ||
6815 | ||
6816 | ||
6817 | u32 s_time_gran; | |
6818 | ||
6819 | ||
6820 | ||
6821 | ||
6822 | ||
6823 | char *s_subtype; | |
6824 | }; | |
6825 | ||
6826 | extern struct timespec current_fs_time(struct super_block *sb); | |
6827 | ||
6828 | ||
6829 | ||
6830 | ||
6831 | enum { | |
6832 | SB_UNFROZEN = 0, | |
6833 | SB_FREEZE_WRITE = 1, | |
6834 | SB_FREEZE_TRANS = 2, | |
6835 | }; | |
6836 | # 988 "include/linux/fs.h" | |
6837 | extern void lock_super(struct super_block *); | |
6838 | extern void unlock_super(struct super_block *); | |
6839 | ||
6840 | ||
6841 | ||
6842 | ||
6843 | extern int vfs_permission(struct nameidata *, int); | |
6844 | extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *); | |
6845 | extern int vfs_mkdir(struct inode *, struct dentry *, int); | |
6846 | extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t); | |
6847 | extern int vfs_symlink(struct inode *, struct dentry *, const char *, int); | |
6848 | extern int vfs_link(struct dentry *, struct inode *, struct dentry *); | |
6849 | extern int vfs_rmdir(struct inode *, struct dentry *); | |
6850 | extern int vfs_unlink(struct inode *, struct dentry *); | |
6851 | extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); | |
6852 | ||
6853 | ||
6854 | ||
6855 | ||
6856 | extern void dentry_unhash(struct dentry *dentry); | |
6857 | ||
6858 | ||
6859 | ||
6860 | ||
6861 | extern int file_permission(struct file *, int); | |
6862 | # 1033 "include/linux/fs.h" | |
6863 | int generic_osync_inode(struct inode *, struct address_space *, int); | |
6864 | ||
6865 | ||
6866 | ||
6867 | ||
6868 | ||
6869 | ||
6870 | ||
6871 | typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned); | |
6872 | ||
6873 | struct block_device_operations { | |
6874 | int (*open) (struct inode *, struct file *); | |
6875 | int (*release) (struct inode *, struct file *); | |
6876 | int (*ioctl) (struct inode *, struct file *, unsigned, unsigned long); | |
6877 | long (*unlocked_ioctl) (struct file *, unsigned, unsigned long); | |
6878 | long (*compat_ioctl) (struct file *, unsigned, unsigned long); | |
6879 | int (*direct_access) (struct block_device *, sector_t, unsigned long *); | |
6880 | int (*media_changed) (struct gendisk *); | |
6881 | int (*revalidate_disk) (struct gendisk *); | |
6882 | int (*getgeo)(struct block_device *, struct hd_geometry *); | |
6883 | struct module *owner; | |
6884 | }; | |
6885 | # 1065 "include/linux/fs.h" | |
6886 | typedef struct { | |
6887 | size_t written; | |
6888 | size_t count; | |
6889 | union { | |
6890 | char * buf; | |
6891 | void *data; | |
6892 | } arg; | |
6893 | int error; | |
6894 | } read_descriptor_t; | |
6895 | ||
6896 | typedef int (*read_actor_t)(read_descriptor_t *, struct page *, unsigned long, unsigned long); | |
6897 | # 1088 "include/linux/fs.h" | |
6898 | struct file_operations { | |
6899 | struct module *owner; | |
6900 | loff_t (*llseek) (struct file *, loff_t, int); | |
6901 | ssize_t (*read) (struct file *, char *, size_t, loff_t *); | |
6902 | ssize_t (*write) (struct file *, const char *, size_t, loff_t *); | |
6903 | ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t); | |
6904 | ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t); | |
6905 | int (*readdir) (struct file *, void *, filldir_t); | |
6906 | unsigned int (*poll) (struct file *, struct poll_table_struct *); | |
6907 | int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long); | |
6908 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); | |
6909 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); | |
6910 | int (*mmap) (struct file *, struct vm_area_struct *); | |
6911 | int (*open) (struct inode *, struct file *); | |
6912 | int (*flush) (struct file *, fl_owner_t id); | |
6913 | int (*release) (struct inode *, struct file *); | |
6914 | int (*fsync) (struct file *, struct dentry *, int datasync); | |
6915 | int (*aio_fsync) (struct kiocb *, int datasync); | |
6916 | int (*fasync) (int, struct file *, int); | |
6917 | int (*lock) (struct file *, int, struct file_lock *); | |
6918 | ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *); | |
6919 | ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); | |
6920 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); | |
6921 | int (*check_flags)(int); | |
6922 | int (*dir_notify)(struct file *filp, unsigned long arg); | |
6923 | int (*flock) (struct file *, int, struct file_lock *); | |
6924 | ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); | |
6925 | ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); | |
6926 | }; | |
6927 | ||
6928 | struct inode_operations { | |
6929 | int (*create) (struct inode *,struct dentry *,int, struct nameidata *); | |
6930 | struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); | |
6931 | int (*link) (struct dentry *,struct inode *,struct dentry *); | |
6932 | int (*unlink) (struct inode *,struct dentry *); | |
6933 | int (*symlink) (struct inode *,struct dentry *,const char *); | |
6934 | int (*mkdir) (struct inode *,struct dentry *,int); | |
6935 | int (*rmdir) (struct inode *,struct dentry *); | |
6936 | int (*mknod) (struct inode *,struct dentry *,int,dev_t); | |
6937 | int (*rename) (struct inode *, struct dentry *, | |
6938 | struct inode *, struct dentry *); | |
6939 | int (*readlink) (struct dentry *, char *,int); | |
6940 | void * (*follow_link) (struct dentry *, struct nameidata *); | |
6941 | void (*put_link) (struct dentry *, struct nameidata *, void *); | |
6942 | void (*truncate) (struct inode *); | |
6943 | int (*permission) (struct inode *, int, struct nameidata *); | |
6944 | int (*setattr) (struct dentry *, struct iattr *); | |
6945 | int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); | |
6946 | int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); | |
6947 | ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t); | |
6948 | ssize_t (*listxattr) (struct dentry *, char *, size_t); | |
6949 | int (*removexattr) (struct dentry *, const char *); | |
6950 | void (*truncate_range)(struct inode *, loff_t, loff_t); | |
6951 | }; | |
6952 | ||
6953 | struct seq_file; | |
6954 | ||
6955 | ssize_t rw_copy_check_uvector(int type, const struct iovec * uvector, | |
6956 | unsigned long nr_segs, unsigned long fast_segs, | |
6957 | struct iovec *fast_pointer, | |
6958 | struct iovec **ret_pointer); | |
6959 | ||
6960 | extern ssize_t vfs_read(struct file *, char *, size_t, loff_t *); | |
6961 | extern ssize_t vfs_write(struct file *, const char *, size_t, loff_t *); | |
6962 | extern ssize_t vfs_readv(struct file *, const struct iovec *, | |
6963 | unsigned long, loff_t *); | |
6964 | extern ssize_t vfs_writev(struct file *, const struct iovec *, | |
6965 | unsigned long, loff_t *); | |
6966 | ||
6967 | ||
6968 | ||
6969 | ||
6970 | ||
6971 | struct super_operations { | |
6972 | struct inode *(*alloc_inode)(struct super_block *sb); | |
6973 | void (*destroy_inode)(struct inode *); | |
6974 | ||
6975 | void (*read_inode) (struct inode *); | |
6976 | ||
6977 | void (*dirty_inode) (struct inode *); | |
6978 | int (*write_inode) (struct inode *, int); | |
6979 | void (*put_inode) (struct inode *); | |
6980 | void (*drop_inode) (struct inode *); | |
6981 | void (*delete_inode) (struct inode *); | |
6982 | void (*put_super) (struct super_block *); | |
6983 | void (*write_super) (struct super_block *); | |
6984 | int (*sync_fs)(struct super_block *sb, int wait); | |
6985 | void (*write_super_lockfs) (struct super_block *); | |
6986 | void (*unlockfs) (struct super_block *); | |
6987 | int (*statfs) (struct dentry *, struct kstatfs *); | |
6988 | int (*remount_fs) (struct super_block *, int *, char *); | |
6989 | void (*clear_inode) (struct inode *); | |
6990 | void (*umount_begin) (struct vfsmount *, int); | |
6991 | ||
6992 | int (*show_options)(struct seq_file *, struct vfsmount *); | |
6993 | int (*show_stats)(struct seq_file *, struct vfsmount *); | |
6994 | ||
6995 | ||
6996 | ||
6997 | ||
6998 | }; | |
6999 | # 1203 "include/linux/fs.h" | |
7000 | extern void __mark_inode_dirty(struct inode *, int); | |
7001 | static inline __attribute__((always_inline)) void mark_inode_dirty(struct inode *inode) | |
7002 | { | |
7003 | __mark_inode_dirty(inode, (1 | 2 | 4)); | |
7004 | } | |
7005 | ||
7006 | static inline __attribute__((always_inline)) void mark_inode_dirty_sync(struct inode *inode) | |
7007 | { | |
7008 | __mark_inode_dirty(inode, 1); | |
7009 | } | |
7010 | # 1222 "include/linux/fs.h" | |
7011 | static inline __attribute__((always_inline)) void inc_nlink(struct inode *inode) | |
7012 | { | |
7013 | inode->i_nlink++; | |
7014 | } | |
7015 | ||
7016 | static inline __attribute__((always_inline)) void inode_inc_link_count(struct inode *inode) | |
7017 | { | |
7018 | inc_nlink(inode); | |
7019 | mark_inode_dirty(inode); | |
7020 | } | |
7021 | # 1244 "include/linux/fs.h" | |
7022 | static inline __attribute__((always_inline)) void drop_nlink(struct inode *inode) | |
7023 | { | |
7024 | inode->i_nlink--; | |
7025 | } | |
7026 | # 1257 "include/linux/fs.h" | |
7027 | static inline __attribute__((always_inline)) void clear_nlink(struct inode *inode) | |
7028 | { | |
7029 | inode->i_nlink = 0; | |
7030 | } | |
7031 | ||
7032 | static inline __attribute__((always_inline)) void inode_dec_link_count(struct inode *inode) | |
7033 | { | |
7034 | drop_nlink(inode); | |
7035 | mark_inode_dirty(inode); | |
7036 | } | |
7037 | ||
7038 | extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry); | |
7039 | static inline __attribute__((always_inline)) void file_accessed(struct file *file) | |
7040 | { | |
7041 | if (!(file->f_flags & 01000000)) | |
7042 | touch_atime(file->f_path.mnt, file->f_path.dentry); | |
7043 | } | |
7044 | ||
7045 | int sync_inode(struct inode *inode, struct writeback_control *wbc); | |
7046 | # 1363 "include/linux/fs.h" | |
7047 | struct export_operations { | |
7048 | struct dentry *(*decode_fh)(struct super_block *sb, __u32 *fh, int fh_len, int fh_type, | |
7049 | int (*acceptable)(void *context, struct dentry *de), | |
7050 | void *context); | |
7051 | int (*encode_fh)(struct dentry *de, __u32 *fh, int *max_len, | |
7052 | int connectable); | |
7053 | ||
7054 | ||
7055 | int (*get_name)(struct dentry *parent, char *name, | |
7056 | struct dentry *child); | |
7057 | struct dentry * (*get_parent)(struct dentry *child); | |
7058 | struct dentry * (*get_dentry)(struct super_block *sb, void *inump); | |
7059 | ||
7060 | ||
7061 | struct dentry * (*find_exported_dentry)( | |
7062 | struct super_block *sb, void *obj, void *parent, | |
7063 | int (*acceptable)(void *context, struct dentry *de), | |
7064 | void *context); | |
7065 | ||
7066 | ||
7067 | }; | |
7068 | ||
7069 | extern struct dentry * | |
7070 | find_exported_dentry(struct super_block *sb, void *obj, void *parent, | |
7071 | int (*acceptable)(void *context, struct dentry *de), | |
7072 | void *context); | |
7073 | ||
7074 | struct file_system_type { | |
7075 | const char *name; | |
7076 | int fs_flags; | |
7077 | int (*get_sb) (struct file_system_type *, int, | |
7078 | const char *, void *, struct vfsmount *); | |
7079 | void (*kill_sb) (struct super_block *); | |
7080 | struct module *owner; | |
7081 | struct file_system_type * next; | |
7082 | struct list_head fs_supers; | |
7083 | struct lock_class_key s_lock_key; | |
7084 | struct lock_class_key s_umount_key; | |
7085 | }; | |
7086 | ||
7087 | extern int get_sb_bdev(struct file_system_type *fs_type, | |
7088 | int flags, const char *dev_name, void *data, | |
7089 | int (*fill_super)(struct super_block *, void *, int), | |
7090 | struct vfsmount *mnt); | |
7091 | extern int get_sb_single(struct file_system_type *fs_type, | |
7092 | int flags, void *data, | |
7093 | int (*fill_super)(struct super_block *, void *, int), | |
7094 | struct vfsmount *mnt); | |
7095 | extern int get_sb_nodev(struct file_system_type *fs_type, | |
7096 | int flags, void *data, | |
7097 | int (*fill_super)(struct super_block *, void *, int), | |
7098 | struct vfsmount *mnt); | |
7099 | void generic_shutdown_super(struct super_block *sb); | |
7100 | void kill_block_super(struct super_block *sb); | |
7101 | void kill_anon_super(struct super_block *sb); | |
7102 | void kill_litter_super(struct super_block *sb); | |
7103 | void deactivate_super(struct super_block *sb); | |
7104 | int set_anon_super(struct super_block *s, void *data); | |
7105 | struct super_block *sget(struct file_system_type *type, | |
7106 | int (*test)(struct super_block *,void *), | |
7107 | int (*set)(struct super_block *,void *), | |
7108 | void *data); | |
7109 | extern int get_sb_pseudo(struct file_system_type *, char *, | |
7110 | const struct super_operations *ops, unsigned long, | |
7111 | struct vfsmount *mnt); | |
7112 | extern int simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); | |
7113 | int __put_super(struct super_block *sb); | |
7114 | int __put_super_and_need_restart(struct super_block *sb); | |
7115 | void unnamed_dev_init(void); | |
7116 | ||
7117 | ||
7118 | ||
7119 | ||
7120 | ||
7121 | ||
7122 | ||
7123 | extern int register_filesystem(struct file_system_type *); | |
7124 | extern int unregister_filesystem(struct file_system_type *); | |
7125 | extern struct vfsmount *kern_mount(struct file_system_type *); | |
7126 | extern int may_umount_tree(struct vfsmount *); | |
7127 | extern int may_umount(struct vfsmount *); | |
7128 | extern void umount_tree(struct vfsmount *, int, struct list_head *); | |
7129 | extern void release_mounts(struct list_head *); | |
7130 | extern long do_mount(char *, char *, char *, unsigned long, void *); | |
7131 | extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int); | |
7132 | extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *, | |
7133 | struct vfsmount *); | |
7134 | ||
7135 | extern int vfs_statfs(struct dentry *, struct kstatfs *); | |
7136 | ||
7137 | ||
7138 | extern struct kset fs_subsys; | |
7139 | ||
7140 | ||
7141 | ||
7142 | ||
7143 | extern int locks_mandatory_locked(struct inode *); | |
7144 | extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size_t); | |
7145 | # 1469 "include/linux/fs.h" | |
7146 | static inline __attribute__((always_inline)) int locks_verify_locked(struct inode *inode) | |
7147 | { | |
7148 | if ((((inode)->i_sb->s_flags & (64)) && ((inode)->i_mode & (0002000 | 00010)) == 0002000)) | |
7149 | return locks_mandatory_locked(inode); | |
7150 | return 0; | |
7151 | } | |
7152 | ||
7153 | extern int rw_verify_area(int, struct file *, loff_t *, size_t); | |
7154 | ||
7155 | static inline __attribute__((always_inline)) int locks_verify_truncate(struct inode *inode, | |
7156 | struct file *filp, | |
7157 | loff_t size) | |
7158 | { | |
7159 | if (inode->i_flock && (((inode)->i_sb->s_flags & (64)) && ((inode)->i_mode & (0002000 | 00010)) == 0002000)) | |
7160 | return locks_mandatory_area( | |
7161 | 2, inode, filp, | |
7162 | size < inode->i_size ? size : inode->i_size, | |
7163 | (size < inode->i_size ? inode->i_size - size | |
7164 | : size - inode->i_size) | |
7165 | ); | |
7166 | return 0; | |
7167 | } | |
7168 | ||
7169 | static inline __attribute__((always_inline)) int break_lease(struct inode *inode, unsigned int mode) | |
7170 | { | |
7171 | if (inode->i_flock) | |
7172 | return __break_lease(inode, mode); | |
7173 | return 0; | |
7174 | } | |
7175 | ||
7176 | ||
7177 | ||
7178 | extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs, | |
7179 | struct file *filp); | |
7180 | extern long do_sys_open(int fdf, const char *filename, int flags, | |
7181 | int mode); | |
7182 | extern struct file *filp_open(const char *, int, int); | |
7183 | extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); | |
7184 | extern int filp_close(struct file *, fl_owner_t id); | |
7185 | extern char * getname(const char *); | |
7186 | ||
7187 | ||
7188 | extern void __attribute__ ((__section__ (".init.text"))) vfs_caches_init_early(void); | |
7189 | extern void __attribute__ ((__section__ (".init.text"))) vfs_caches_init(unsigned long); | |
7190 | ||
7191 | extern struct kmem_cache *names_cachep; | |
7192 | # 1525 "include/linux/fs.h" | |
7193 | extern int register_blkdev(unsigned int, const char *); | |
7194 | extern int unregister_blkdev(unsigned int, const char *); | |
7195 | extern struct block_device *bdget(dev_t); | |
7196 | extern void bd_set_size(struct block_device *, loff_t size); | |
7197 | extern void bd_forget(struct inode *inode); | |
7198 | extern void bdput(struct block_device *); | |
7199 | extern struct block_device *open_by_devnum(dev_t, unsigned); | |
7200 | extern const struct address_space_operations def_blk_aops; | |
7201 | ||
7202 | ||
7203 | ||
7204 | extern const struct file_operations def_blk_fops; | |
7205 | extern const struct file_operations def_chr_fops; | |
7206 | extern const struct file_operations bad_sock_fops; | |
7207 | extern const struct file_operations def_fifo_fops; | |
7208 | ||
7209 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); | |
7210 | extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); | |
7211 | extern int blkdev_driver_ioctl(struct inode *inode, struct file *file, | |
7212 | struct gendisk *disk, unsigned cmd, | |
7213 | unsigned long arg); | |
7214 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); | |
7215 | extern int blkdev_get(struct block_device *, mode_t, unsigned); | |
7216 | extern int blkdev_put(struct block_device *); | |
7217 | extern int bd_claim(struct block_device *, void *); | |
7218 | extern void bd_release(struct block_device *); | |
7219 | ||
7220 | extern int bd_claim_by_disk(struct block_device *, void *, struct gendisk *); | |
7221 | extern void bd_release_from_disk(struct block_device *, struct gendisk *); | |
7222 | # 1562 "include/linux/fs.h" | |
7223 | extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); | |
7224 | extern int register_chrdev_region(dev_t, unsigned, const char *); | |
7225 | extern int register_chrdev(unsigned int, const char *, | |
7226 | const struct file_operations *); | |
7227 | extern int unregister_chrdev(unsigned int, const char *); | |
7228 | extern void unregister_chrdev_region(dev_t, unsigned); | |
7229 | extern int chrdev_open(struct inode *, struct file *); | |
7230 | extern void chrdev_show(struct seq_file *,off_t); | |
7231 | ||
7232 | ||
7233 | ||
7234 | ||
7235 | ||
7236 | ||
7237 | extern const char *__bdevname(dev_t, char *buffer); | |
7238 | extern const char *bdevname(struct block_device *bdev, char *buffer); | |
7239 | extern struct block_device *lookup_bdev(const char *); | |
7240 | extern struct block_device *open_bdev_excl(const char *, int, void *); | |
7241 | extern void close_bdev_excl(struct block_device *); | |
7242 | extern void blkdev_show(struct seq_file *,off_t); | |
7243 | ||
7244 | ||
7245 | ||
7246 | ||
7247 | extern void init_special_inode(struct inode *, umode_t, dev_t); | |
7248 | ||
7249 | ||
7250 | extern void make_bad_inode(struct inode *); | |
7251 | extern int is_bad_inode(struct inode *); | |
7252 | ||
7253 | extern const struct file_operations read_fifo_fops; | |
7254 | extern const struct file_operations write_fifo_fops; | |
7255 | extern const struct file_operations rdwr_fifo_fops; | |
7256 | ||
7257 | extern int fs_may_remount_ro(struct super_block *); | |
7258 | # 1609 "include/linux/fs.h" | |
7259 | extern int check_disk_change(struct block_device *); | |
7260 | extern int __invalidate_device(struct block_device *); | |
7261 | extern int invalidate_partition(struct gendisk *, int); | |
7262 | ||
7263 | extern int invalidate_inodes(struct super_block *); | |
7264 | unsigned long invalidate_mapping_pages(struct address_space *mapping, | |
7265 | unsigned long start, unsigned long end); | |
7266 | ||
7267 | static inline __attribute__((always_inline)) unsigned long __attribute__((deprecated)) | |
7268 | invalidate_inode_pages(struct address_space *mapping) | |
7269 | { | |
7270 | return invalidate_mapping_pages(mapping, 0, ~0UL); | |
7271 | } | |
7272 | ||
7273 | static inline __attribute__((always_inline)) void invalidate_remote_inode(struct inode *inode) | |
7274 | { | |
7275 | if ((((inode->i_mode) & 00170000) == 0100000) || (((inode->i_mode) & 00170000) == 0040000) || | |
7276 | (((inode->i_mode) & 00170000) == 0120000)) | |
7277 | invalidate_mapping_pages(inode->i_mapping, 0, -1); | |
7278 | } | |
7279 | extern int invalidate_inode_pages2(struct address_space *mapping); | |
7280 | extern int invalidate_inode_pages2_range(struct address_space *mapping, | |
7281 | unsigned long start, unsigned long end); | |
7282 | extern int write_inode_now(struct inode *, int); | |
7283 | extern int filemap_fdatawrite(struct address_space *); | |
7284 | extern int filemap_flush(struct address_space *); | |
7285 | extern int filemap_fdatawait(struct address_space *); | |
7286 | extern int filemap_write_and_wait(struct address_space *mapping); | |
7287 | extern int filemap_write_and_wait_range(struct address_space *mapping, | |
7288 | loff_t lstart, loff_t lend); | |
7289 | extern int wait_on_page_writeback_range(struct address_space *mapping, | |
7290 | unsigned long start, unsigned long end); | |
7291 | extern int __filemap_fdatawrite_range(struct address_space *mapping, | |
7292 | loff_t start, loff_t end, int sync_mode); | |
7293 | ||
7294 | extern long do_fsync(struct file *file, int datasync); | |
7295 | extern void sync_supers(void); | |
7296 | extern void sync_filesystems(int wait); | |
7297 | extern void __fsync_super(struct super_block *sb); | |
7298 | extern void emergency_sync(void); | |
7299 | extern void emergency_remount(void); | |
7300 | extern int do_remount_sb(struct super_block *sb, int flags, | |
7301 | void *data, int force); | |
7302 | ||
7303 | extern sector_t bmap(struct inode *, sector_t); | |
7304 | ||
7305 | extern int notify_change(struct dentry *, struct iattr *); | |
7306 | extern int permission(struct inode *, int, struct nameidata *); | |
7307 | extern int generic_permission(struct inode *, int, | |
7308 | int (*check_acl)(struct inode *, int)); | |
7309 | ||
7310 | extern int get_write_access(struct inode *); | |
7311 | extern int deny_write_access(struct file *); | |
7312 | static inline __attribute__((always_inline)) void put_write_access(struct inode * inode) | |
7313 | { | |
7314 | atomic_dec(&inode->i_writecount); | |
7315 | } | |
7316 | static inline __attribute__((always_inline)) void allow_write_access(struct file *file) | |
7317 | { | |
7318 | if (file) | |
7319 | atomic_inc(&file->f_path.dentry->d_inode->i_writecount); | |
7320 | } | |
7321 | extern int do_pipe(int *); | |
7322 | extern struct file *create_read_pipe(struct file *f); | |
7323 | extern struct file *create_write_pipe(void); | |
7324 | extern void free_write_pipe(struct file *); | |
7325 | ||
7326 | extern int open_namei(int dfd, const char *, int, int, struct nameidata *); | |
7327 | extern int may_open(struct nameidata *, int, int); | |
7328 | ||
7329 | extern int kernel_read(struct file *, unsigned long, char *, unsigned long); | |
7330 | extern struct file * open_exec(const char *); | |
7331 | ||
7332 | ||
7333 | extern int is_subdir(struct dentry *, struct dentry *); | |
7334 | extern ino_t find_inode_number(struct dentry *, struct qstr *); | |
7335 | ||
7336 | # 1 "include/linux/err.h" 1 | |
7337 | # 22 "include/linux/err.h" | |
7338 | static inline __attribute__((always_inline)) void *ERR_PTR(long error) | |
7339 | { | |
7340 | return (void *) error; | |
7341 | } | |
7342 | ||
7343 | static inline __attribute__((always_inline)) long PTR_ERR(const void *ptr) | |
7344 | { | |
7345 | return (long) ptr; | |
7346 | } | |
7347 | ||
7348 | static inline __attribute__((always_inline)) long IS_ERR(const void *ptr) | |
7349 | { | |
7350 | return __builtin_expect(!!(((unsigned long)ptr) >= (unsigned long)-4095), 0); | |
7351 | } | |
7352 | # 1687 "include/linux/fs.h" 2 | |
7353 | ||
7354 | ||
7355 | extern loff_t default_llseek(struct file *file, loff_t offset, int origin); | |
7356 | ||
7357 | extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin); | |
7358 | ||
7359 | extern void inode_init_once(struct inode *); | |
7360 | extern void iput(struct inode *); | |
7361 | extern struct inode * igrab(struct inode *); | |
7362 | extern ino_t iunique(struct super_block *, ino_t); | |
7363 | extern int inode_needs_sync(struct inode *inode); | |
7364 | extern void generic_delete_inode(struct inode *inode); | |
7365 | extern void generic_drop_inode(struct inode *inode); | |
7366 | ||
7367 | extern struct inode *ilookup5_nowait(struct super_block *sb, | |
7368 | unsigned long hashval, int (*test)(struct inode *, void *), | |
7369 | void *data); | |
7370 | extern struct inode *ilookup5(struct super_block *sb, unsigned long hashval, | |
7371 | int (*test)(struct inode *, void *), void *data); | |
7372 | extern struct inode *ilookup(struct super_block *sb, unsigned long ino); | |
7373 | ||
7374 | extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*test)(struct inode *, void *), int (*set)(struct inode *, void *), void *); | |
7375 | extern struct inode * iget_locked(struct super_block *, unsigned long); | |
7376 | extern void unlock_new_inode(struct inode *); | |
7377 | ||
7378 | static inline __attribute__((always_inline)) struct inode *iget(struct super_block *sb, unsigned long ino) | |
7379 | { | |
7380 | struct inode *inode = iget_locked(sb, ino); | |
7381 | ||
7382 | if (inode && (inode->i_state & 64)) { | |
7383 | sb->s_op->read_inode(inode); | |
7384 | unlock_new_inode(inode); | |
7385 | } | |
7386 | ||
7387 | return inode; | |
7388 | } | |
7389 | ||
7390 | extern void __iget(struct inode * inode); | |
7391 | extern void clear_inode(struct inode *); | |
7392 | extern void destroy_inode(struct inode *); | |
7393 | extern struct inode *new_inode(struct super_block *); | |
7394 | extern int __remove_suid(struct dentry *, int); | |
7395 | extern int should_remove_suid(struct dentry *); | |
7396 | extern int remove_suid(struct dentry *); | |
7397 | ||
7398 | extern void __insert_inode_hash(struct inode *, unsigned long hashval); | |
7399 | extern void remove_inode_hash(struct inode *); | |
7400 | static inline __attribute__((always_inline)) void insert_inode_hash(struct inode *inode) { | |
7401 | __insert_inode_hash(inode, inode->i_ino); | |
7402 | } | |
7403 | ||
7404 | extern struct file * get_empty_filp(void); | |
7405 | extern void file_move(struct file *f, struct list_head *list); | |
7406 | extern void file_kill(struct file *f); | |
7407 | ||
7408 | struct bio; | |
7409 | extern void submit_bio(int, struct bio *); | |
7410 | extern int bdev_read_only(struct block_device *); | |
7411 | ||
7412 | extern int set_blocksize(struct block_device *, int); | |
7413 | extern int sb_set_blocksize(struct super_block *, int); | |
7414 | extern int sb_min_blocksize(struct super_block *, int); | |
7415 | ||
7416 | extern int generic_file_mmap(struct file *, struct vm_area_struct *); | |
7417 | extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); | |
7418 | extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); | |
7419 | extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); | |
7420 | int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); | |
7421 | extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t); | |
7422 | extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t); | |
7423 | extern ssize_t generic_file_aio_write_nolock(struct kiocb *, const struct iovec *, | |
7424 | unsigned long, loff_t); | |
7425 | extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *, | |
7426 | unsigned long *, loff_t, loff_t *, size_t, size_t); | |
7427 | extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *, | |
7428 | unsigned long, loff_t, loff_t *, size_t, ssize_t); | |
7429 | extern ssize_t do_sync_read(struct file *filp, char *buf, size_t len, loff_t *ppos); | |
7430 | extern ssize_t do_sync_write(struct file *filp, const char *buf, size_t len, loff_t *ppos); | |
7431 | extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *); | |
7432 | extern void do_generic_mapping_read(struct address_space *mapping, | |
7433 | struct file_ra_state *, struct file *, | |
7434 | loff_t *, read_descriptor_t *, read_actor_t); | |
7435 | extern int generic_segment_checks(const struct iovec *iov, | |
7436 | unsigned long *nr_segs, size_t *count, int access_flags); | |
7437 | ||
7438 | ||
7439 | extern ssize_t generic_file_splice_read(struct file *, loff_t *, | |
7440 | struct pipe_inode_info *, size_t, unsigned int); | |
7441 | extern ssize_t generic_file_splice_write(struct pipe_inode_info *, | |
7442 | struct file *, loff_t *, size_t, unsigned int); | |
7443 | extern ssize_t generic_file_splice_write_nolock(struct pipe_inode_info *, | |
7444 | struct file *, loff_t *, size_t, unsigned int); | |
7445 | extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, | |
7446 | struct file *out, loff_t *, size_t len, unsigned int flags); | |
7447 | extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out, | |
7448 | size_t len, unsigned int flags); | |
7449 | ||
7450 | extern void | |
7451 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); | |
7452 | extern loff_t no_llseek(struct file *file, loff_t offset, int origin); | |
7453 | extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); | |
7454 | extern loff_t remote_llseek(struct file *file, loff_t offset, int origin); | |
7455 | extern int generic_file_open(struct inode * inode, struct file * filp); | |
7456 | extern int nonseekable_open(struct inode * inode, struct file * filp); | |
7457 | # 1803 "include/linux/fs.h" | |
7458 | static inline __attribute__((always_inline)) int xip_truncate_page(struct address_space *mapping, loff_t from) | |
7459 | { | |
7460 | return 0; | |
7461 | } | |
7462 | ||
7463 | ||
7464 | static inline __attribute__((always_inline)) void do_generic_file_read(struct file * filp, loff_t *ppos, | |
7465 | read_descriptor_t * desc, | |
7466 | read_actor_t actor) | |
7467 | { | |
7468 | do_generic_mapping_read(filp->f_mapping, | |
7469 | &filp->f_ra, | |
7470 | filp, | |
7471 | ppos, | |
7472 | desc, | |
7473 | actor); | |
7474 | } | |
7475 | ||
7476 | ||
7477 | ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, | |
7478 | struct block_device *bdev, const struct iovec *iov, loff_t offset, | |
7479 | unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, | |
7480 | int lock_type); | |
7481 | ||
7482 | enum { | |
7483 | DIO_LOCKING = 1, | |
7484 | DIO_NO_LOCKING, | |
7485 | DIO_OWN_LOCKING, | |
7486 | }; | |
7487 | ||
7488 | static inline __attribute__((always_inline)) ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, | |
7489 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, | |
7490 | loff_t offset, unsigned long nr_segs, get_block_t get_block, | |
7491 | dio_iodone_t end_io) | |
7492 | { | |
7493 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, | |
7494 | nr_segs, get_block, end_io, DIO_LOCKING); | |
7495 | } | |
7496 | ||
7497 | static inline __attribute__((always_inline)) ssize_t blockdev_direct_IO_no_locking(int rw, struct kiocb *iocb, | |
7498 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, | |
7499 | loff_t offset, unsigned long nr_segs, get_block_t get_block, | |
7500 | dio_iodone_t end_io) | |
7501 | { | |
7502 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, | |
7503 | nr_segs, get_block, end_io, DIO_NO_LOCKING); | |
7504 | } | |
7505 | ||
7506 | static inline __attribute__((always_inline)) ssize_t blockdev_direct_IO_own_locking(int rw, struct kiocb *iocb, | |
7507 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, | |
7508 | loff_t offset, unsigned long nr_segs, get_block_t get_block, | |
7509 | dio_iodone_t end_io) | |
7510 | { | |
7511 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, | |
7512 | nr_segs, get_block, end_io, DIO_OWN_LOCKING); | |
7513 | } | |
7514 | ||
7515 | ||
7516 | extern const struct file_operations generic_ro_fops; | |
7517 | ||
7518 | ||
7519 | ||
7520 | extern int vfs_readlink(struct dentry *, char *, int, const char *); | |
7521 | extern int vfs_follow_link(struct nameidata *, const char *); | |
7522 | extern int page_readlink(struct dentry *, char *, int); | |
7523 | extern void *page_follow_link_light(struct dentry *, struct nameidata *); | |
7524 | extern void page_put_link(struct dentry *, struct nameidata *, void *); | |
7525 | extern int __page_symlink(struct inode *inode, const char *symname, int len, | |
7526 | gfp_t gfp_mask); | |
7527 | extern int page_symlink(struct inode *inode, const char *symname, int len); | |
7528 | extern const struct inode_operations page_symlink_inode_operations; | |
7529 | extern int generic_readlink(struct dentry *, char *, int); | |
7530 | extern void generic_fillattr(struct inode *, struct kstat *); | |
7531 | extern int vfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); | |
7532 | void inode_add_bytes(struct inode *inode, loff_t bytes); | |
7533 | void inode_sub_bytes(struct inode *inode, loff_t bytes); | |
7534 | loff_t inode_get_bytes(struct inode *inode); | |
7535 | void inode_set_bytes(struct inode *inode, loff_t bytes); | |
7536 | ||
7537 | extern int vfs_readdir(struct file *, filldir_t, void *); | |
7538 | ||
7539 | extern int vfs_stat(char *, struct kstat *); | |
7540 | extern int vfs_lstat(char *, struct kstat *); | |
7541 | extern int vfs_stat_fd(int dfd, char *, struct kstat *); | |
7542 | extern int vfs_lstat_fd(int dfd, char *, struct kstat *); | |
7543 | extern int vfs_fstat(unsigned int, struct kstat *); | |
7544 | ||
7545 | extern int vfs_ioctl(struct file *, unsigned int, unsigned int, unsigned long); | |
7546 | ||
7547 | extern struct file_system_type *get_fs_type(const char *name); | |
7548 | extern struct super_block *get_super(struct block_device *); | |
7549 | extern struct super_block *user_get_super(dev_t); | |
7550 | extern void drop_super(struct super_block *sb); | |
7551 | ||
7552 | extern int dcache_dir_open(struct inode *, struct file *); | |
7553 | extern int dcache_dir_close(struct inode *, struct file *); | |
7554 | extern loff_t dcache_dir_lseek(struct file *, loff_t, int); | |
7555 | extern int dcache_readdir(struct file *, void *, filldir_t); | |
7556 | extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *); | |
7557 | extern int simple_statfs(struct dentry *, struct kstatfs *); | |
7558 | extern int simple_link(struct dentry *, struct inode *, struct dentry *); | |
7559 | extern int simple_unlink(struct inode *, struct dentry *); | |
7560 | extern int simple_rmdir(struct inode *, struct dentry *); | |
7561 | extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); | |
7562 | extern int simple_sync_file(struct file *, struct dentry *, int); | |
7563 | extern int simple_empty(struct dentry *); | |
7564 | extern int simple_readpage(struct file *file, struct page *page); | |
7565 | extern int simple_prepare_write(struct file *file, struct page *page, | |
7566 | unsigned offset, unsigned to); | |
7567 | extern int simple_commit_write(struct file *file, struct page *page, | |
7568 | unsigned offset, unsigned to); | |
7569 | ||
7570 | extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *); | |
7571 | extern ssize_t generic_read_dir(struct file *, char *, size_t, loff_t *); | |
7572 | extern const struct file_operations simple_dir_operations; | |
7573 | extern const struct inode_operations simple_dir_inode_operations; | |
7574 | struct tree_descr { char *name; const struct file_operations *ops; int mode; }; | |
7575 | struct dentry *d_alloc_name(struct dentry *, const char *); | |
7576 | extern int simple_fill_super(struct super_block *, int, struct tree_descr *); | |
7577 | extern int simple_pin_fs(struct file_system_type *, struct vfsmount **mount, int *count); | |
7578 | extern void simple_release_fs(struct vfsmount **mount, int *count); | |
7579 | ||
7580 | extern ssize_t simple_read_from_buffer(void *, size_t, loff_t *, const void *, size_t); | |
7581 | # 1934 "include/linux/fs.h" | |
7582 | extern int inode_change_ok(struct inode *, struct iattr *); | |
7583 | extern int __attribute__((warn_unused_result)) inode_setattr(struct inode *, struct iattr *); | |
7584 | ||
7585 | extern void file_update_time(struct file *file); | |
7586 | ||
7587 | static inline __attribute__((always_inline)) ino_t parent_ino(struct dentry *dentry) | |
7588 | { | |
7589 | ino_t res; | |
7590 | ||
7591 | do { do { } while (0); (void)0; (void)(&dentry->d_lock); } while (0); | |
7592 | res = dentry->d_parent->d_inode->i_ino; | |
7593 | do { do { } while (0); (void)0; (void)(&dentry->d_lock); } while (0); | |
7594 | return res; | |
7595 | } | |
7596 | ||
7597 | ||
7598 | extern int unshare_files(void); | |
7599 | ||
7600 | ||
7601 | ||
7602 | ||
7603 | ||
7604 | ||
7605 | ||
7606 | struct simple_transaction_argresp { | |
7607 | ssize_t size; | |
7608 | char data[0]; | |
7609 | }; | |
7610 | ||
7611 | ||
7612 | ||
7613 | char *simple_transaction_get(struct file *file, const char *buf, | |
7614 | size_t size); | |
7615 | ssize_t simple_transaction_read(struct file *file, char *buf, | |
7616 | size_t size, loff_t *pos); | |
7617 | int simple_transaction_release(struct inode *inode, struct file *file); | |
7618 | ||
7619 | static inline __attribute__((always_inline)) void simple_transaction_set(struct file *file, size_t n) | |
7620 | { | |
7621 | struct simple_transaction_argresp *ar = file->private_data; | |
7622 | ||
7623 | do { if (__builtin_expect(!!((n > ((1UL << 12) - sizeof(struct simple_transaction_argresp)))!=0), 0)) do { printk("BUG: failure at %s:%d/%s()!\n", "include/linux/fs.h", 1975, (__func__)); panic("BUG!"); } while (0); } while(0); | |
7624 | ||
7625 | ||
7626 | ||
7627 | ||
7628 | ||
7629 | __asm__ __volatile__("": : :"memory"); | |
7630 | ar->size = n; | |
7631 | } | |
7632 | # 2015 "include/linux/fs.h" | |
7633 | static inline __attribute__((always_inline)) void __attribute__((format(printf, 1, 2))) | |
7634 | __simple_attr_check_format(const char *fmt, ...) | |
7635 | { | |
7636 | ||
7637 | } | |
7638 | ||
7639 | int simple_attr_open(struct inode *inode, struct file *file, | |
7640 | u64 (*get)(void *), void (*set)(void *, u64), | |
7641 | const char *fmt); | |
7642 | int simple_attr_close(struct inode *inode, struct file *file); | |
7643 | ssize_t simple_attr_read(struct file *file, char *buf, | |
7644 | size_t len, loff_t *ppos); | |
7645 | ssize_t simple_attr_write(struct file *file, const char *buf, | |
7646 | size_t len, loff_t *ppos); | |
7647 | ||
7648 | ||
7649 | ||
7650 | static inline __attribute__((always_inline)) char *alloc_secdata(void) | |
7651 | { | |
7652 | return (char *)get_zeroed_page(((( gfp_t)0x10u) | (( gfp_t)0x40u) | (( gfp_t)0x80u))); | |
7653 | } | |
7654 | ||
7655 | static inline __attribute__((always_inline)) void free_secdata(void *secdata) | |
7656 | { | |
7657 | free_pages(((unsigned long)secdata),0); | |
7658 | } | |
7659 | # 3 "init/initramfs.c" 2 | |
7660 | ||
7661 | ||
7662 | ||
7663 | # 1 "include/linux/delay.h" 1 | |
7664 | # 10 "include/linux/delay.h" | |
7665 | extern unsigned long loops_per_jiffy; | |
7666 | ||
7667 | # 1 "include/asm/delay.h" 1 | |
7668 | # 14 "include/asm/delay.h" | |
7669 | static inline __attribute__((always_inline)) void __delay(unsigned long loops) | |
7670 | { | |
7671 | if ((1)) { | |
7672 | ||
7673 | unsigned long tmp; | |
7674 | __asm__ __volatile__( | |
7675 | "[--SP] = LC0;" | |
7676 | "[--SP] = LT0;" | |
7677 | "[--SP] = LB0;" | |
7678 | "LSETUP (1f,1f) LC0 = %1;" | |
7679 | "1: NOP;" | |
7680 | ||
7681 | ||
7682 | ||
7683 | ||
7684 | "CLI %0;" | |
7685 | "LB0 = [SP++];" | |
7686 | "LT0 = [SP++];" | |
7687 | "LC0 = [SP++];" | |
7688 | "STI %0;" | |
7689 | : "=d" (tmp) | |
7690 | : "a" (loops) | |
7691 | ); | |
7692 | } else | |
7693 | __asm__ __volatile__ ( | |
7694 | "LSETUP(1f, 1f) LC0 = %0;" | |
7695 | "1: NOP;" | |
7696 | : | |
7697 | : "a" (loops) | |
7698 | : "LT0", "LB0", "LC0" | |
7699 | ); | |
7700 | } | |
7701 | ||
7702 | # 1 "include/linux/param.h" 1 | |
7703 | ||
7704 | ||
7705 | ||
7706 | # 1 "include/asm/param.h" 1 | |
7707 | # 5 "include/linux/param.h" 2 | |
7708 | # 48 "include/asm/delay.h" 2 | |
7709 | # 56 "include/asm/delay.h" | |
7710 | static inline __attribute__((always_inline)) void udelay(unsigned long usecs) | |
7711 | { | |
7712 | extern unsigned long loops_per_jiffy; | |
7713 | __delay(usecs * loops_per_jiffy / (1000000 / 250)); | |
7714 | } | |
7715 | # 13 "include/linux/delay.h" 2 | |
7716 | # 38 "include/linux/delay.h" | |
7717 | void calibrate_delay(void); | |
7718 | void msleep(unsigned int msecs); | |
7719 | unsigned long msleep_interruptible(unsigned int msecs); | |
7720 | ||
7721 | static inline __attribute__((always_inline)) void ssleep(unsigned int seconds) | |
7722 | { | |
7723 | msleep(seconds * 1000); | |
7724 | } | |
7725 | # 7 "init/initramfs.c" 2 | |
7726 | ||
7727 | # 1 "include/linux/syscalls.h" 1 | |
7728 | # 14 "include/linux/syscalls.h" | |
7729 | struct epoll_event; | |
7730 | struct iattr; | |
7731 | struct inode; | |
7732 | struct iocb; | |
7733 | struct io_event; | |
7734 | struct iovec; | |
7735 | struct itimerspec; | |
7736 | struct itimerval; | |
7737 | struct kexec_segment; | |
7738 | struct linux_dirent; | |
7739 | struct linux_dirent64; | |
7740 | struct list_head; | |
7741 | struct msgbuf; | |
7742 | struct msghdr; | |
7743 | struct msqid_ds; | |
7744 | struct new_utsname; | |
7745 | struct nfsctl_arg; | |
7746 | struct __old_kernel_stat; | |
7747 | struct pollfd; | |
7748 | struct rlimit; | |
7749 | struct rusage; | |
7750 | struct sched_param; | |
7751 | struct semaphore; | |
7752 | struct sembuf; | |
7753 | struct shmid_ds; | |
7754 | struct sockaddr; | |
7755 | struct stat; | |
7756 | struct stat64; | |
7757 | struct statfs; | |
7758 | struct statfs64; | |
7759 | struct __sysctl_args; | |
7760 | struct sysinfo; | |
7761 | struct timespec; | |
7762 | struct timeval; | |
7763 | struct timex; | |
7764 | struct timezone; | |
7765 | struct tms; | |
7766 | struct utimbuf; | |
7767 | struct mq_attr; | |
7768 | struct compat_stat; | |
7769 | struct compat_timeval; | |
7770 | struct robust_list_head; | |
7771 | struct getcpu_cache; | |
7772 | ||
7773 | ||
7774 | # 1 "include/linux/aio_abi.h" 1 | |
7775 | # 32 "include/linux/aio_abi.h" | |
7776 | typedef unsigned long aio_context_t; | |
7777 | ||
7778 | enum { | |
7779 | IOCB_CMD_PREAD = 0, | |
7780 | IOCB_CMD_PWRITE = 1, | |
7781 | IOCB_CMD_FSYNC = 2, | |
7782 | IOCB_CMD_FDSYNC = 3, | |
7783 | ||
7784 | ||
7785 | ||
7786 | ||
7787 | IOCB_CMD_NOOP = 6, | |
7788 | IOCB_CMD_PREADV = 7, | |
7789 | IOCB_CMD_PWRITEV = 8, | |
7790 | }; | |
7791 | # 57 "include/linux/aio_abi.h" | |
7792 | struct io_event { | |
7793 | __u64 data; | |
7794 | __u64 obj; | |
7795 | __s64 res; | |
7796 | __s64 res2; | |
7797 | }; | |
7798 | # 78 "include/linux/aio_abi.h" | |
7799 | struct iocb { | |
7800 | ||
7801 | __u64 aio_data; | |
7802 | __u32 aio_key, aio_reserved1; | |
7803 | ||
7804 | ||
7805 | ||
7806 | __u16 aio_lio_opcode; | |
7807 | __s16 aio_reqprio; | |
7808 | __u32 aio_fildes; | |
7809 | ||
7810 | __u64 aio_buf; | |
7811 | __u64 aio_nbytes; | |
7812 | __s64 aio_offset; | |
7813 | ||
7814 | ||
7815 | __u64 aio_reserved2; | |
7816 | ||
7817 | ||
7818 | __u32 aio_flags; | |
7819 | ||
7820 | ||
7821 | ||
7822 | ||
7823 | ||
7824 | __u32 aio_resfd; | |
7825 | }; | |
7826 | # 60 "include/linux/syscalls.h" 2 | |
7827 | # 1 "include/linux/capability.h" 1 | |
7828 | # 19 "include/linux/capability.h" | |
7829 | struct task_struct; | |
7830 | # 34 "include/linux/capability.h" | |
7831 | typedef struct __user_cap_header_struct { | |
7832 | __u32 version; | |
7833 | int pid; | |
7834 | } *cap_user_header_t; | |
7835 | ||
7836 | typedef struct __user_cap_data_struct { | |
7837 | __u32 effective; | |
7838 | __u32 permitted; | |
7839 | __u32 inheritable; | |
7840 | } *cap_user_data_t; | |
7841 | # 60 "include/linux/capability.h" | |
7842 | typedef __u32 kernel_cap_t; | |
7843 | # 297 "include/linux/capability.h" | |
7844 | extern kernel_cap_t cap_bset; | |
7845 | # 325 "include/linux/capability.h" | |
7846 | static inline __attribute__((always_inline)) kernel_cap_t cap_combine(kernel_cap_t a, kernel_cap_t b) | |
7847 | { | |
7848 | kernel_cap_t dest; | |
7849 | (dest) = (a) | (b); | |
7850 | return dest; | |
7851 | } | |
7852 | ||
7853 | static inline __attribute__((always_inline)) kernel_cap_t cap_intersect(kernel_cap_t a, kernel_cap_t b) | |
7854 | { | |
7855 | kernel_cap_t dest; | |
7856 | (dest) = (a) & (b); | |
7857 | return dest; | |
7858 | } | |
7859 | ||
7860 | static inline __attribute__((always_inline)) kernel_cap_t cap_drop(kernel_cap_t a, kernel_cap_t drop) | |
7861 | { | |
7862 | kernel_cap_t dest; | |
7863 | (dest) = (a) & ~(drop); | |
7864 | return dest; | |
7865 | } | |
7866 | ||
7867 | static inline __attribute__((always_inline)) kernel_cap_t cap_invert(kernel_cap_t c) | |
7868 | { | |
7869 | kernel_cap_t dest; | |
7870 | (dest) = ~(c); | |
7871 | return dest; | |
7872 | } | |
7873 | # 362 "include/linux/capability.h" | |
7874 | int capable(int cap); | |
7875 | int __capable(struct task_struct *t, int cap); | |
7876 | # 61 "include/linux/syscalls.h" 2 | |
7877 | ||
7878 | # 1 "include/linux/sem.h" 1 | |
7879 | ||
7880 | ||
7881 | ||
7882 | # 1 "include/linux/ipc.h" 1 | |
7883 | # 9 "include/linux/ipc.h" | |
7884 | struct ipc_perm | |
7885 | { | |
7886 | __kernel_key_t key; | |
7887 | __kernel_uid_t uid; | |
7888 | __kernel_gid_t gid; | |
7889 | __kernel_uid_t cuid; | |
7890 | __kernel_gid_t cgid; | |
7891 | __kernel_mode_t mode; | |
7892 | unsigned short seq; | |
7893 | }; | |
7894 | ||
7895 | ||
7896 | # 1 "include/asm/ipcbuf.h" 1 | |
7897 | # 16 "include/asm/ipcbuf.h" | |
7898 | struct ipc64_perm { | |
7899 | __kernel_key_t key; | |
7900 | __kernel_uid32_t uid; | |
7901 | __kernel_gid32_t gid; | |
7902 | __kernel_uid32_t cuid; | |
7903 | __kernel_gid32_t cgid; | |
7904 | __kernel_mode_t mode; | |
7905 | unsigned short __pad1; | |
7906 | unsigned short seq; | |
7907 | unsigned short __pad2; | |
7908 | unsigned long __unused1; | |
7909 | unsigned long __unused2; | |
7910 | }; | |
7911 | # 22 "include/linux/ipc.h" 2 | |
7912 | # 59 "include/linux/ipc.h" | |
7913 | struct kern_ipc_perm | |
7914 | { | |
7915 | spinlock_t lock; | |
7916 | int deleted; | |
7917 | key_t key; | |
7918 | uid_t uid; | |
7919 | gid_t gid; | |
7920 | uid_t cuid; | |
7921 | gid_t cgid; | |
7922 | mode_t mode; | |
7923 | unsigned long seq; | |
7924 | void *security; | |
7925 | }; | |
7926 | ||
7927 | struct ipc_ids; | |
7928 | struct ipc_namespace { | |
7929 | struct kref kref; | |
7930 | struct ipc_ids *ids[3]; | |
7931 | ||
7932 | int sem_ctls[4]; | |
7933 | int used_sems; | |
7934 | ||
7935 | int msg_ctlmax; | |
7936 | int msg_ctlmnb; | |
7937 | int msg_ctlmni; | |
7938 | ||
7939 | size_t shm_ctlmax; | |
7940 | size_t shm_ctlall; | |
7941 | int shm_ctlmni; | |
7942 | int shm_tot; | |
7943 | }; | |
7944 | ||
7945 | extern struct ipc_namespace init_ipc_ns; | |
7946 | ||
7947 | ||
7948 | ||
7949 | extern struct ipc_namespace *copy_ipcs(unsigned long flags, | |
7950 | struct ipc_namespace *ns); | |
7951 | # 110 "include/linux/ipc.h" | |
7952 | static inline __attribute__((always_inline)) struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) | |
7953 | { | |
7954 | ||
7955 | ||
7956 | ||
7957 | ||
7958 | return ns; | |
7959 | } | |
7960 | ||
7961 | static inline __attribute__((always_inline)) void put_ipc_ns(struct ipc_namespace *ns) | |
7962 | { | |
7963 | ||
7964 | ||
7965 | ||
7966 | } | |
7967 | # 5 "include/linux/sem.h" 2 | |
7968 | # 23 "include/linux/sem.h" | |
7969 | struct semid_ds { | |
7970 | struct ipc_perm sem_perm; | |
7971 | __kernel_time_t sem_otime; | |
7972 | __kernel_time_t sem_ctime; | |
7973 | struct sem *sem_base; | |
7974 | struct sem_queue *sem_pending; | |
7975 | struct sem_queue **sem_pending_last; | |
7976 | struct sem_undo *undo; | |
7977 | unsigned short sem_nsems; | |
7978 | }; | |
7979 | ||
7980 | ||
7981 | # 1 "include/asm/sembuf.h" 1 | |
7982 | # 14 "include/asm/sembuf.h" | |
7983 | struct semid64_ds { | |
7984 | struct ipc64_perm sem_perm; | |
7985 | __kernel_time_t sem_otime; | |
7986 | unsigned long __unused1; | |
7987 | __kernel_time_t sem_ctime; | |
7988 | unsigned long __unused2; | |
7989 | unsigned long sem_nsems; | |
7990 | unsigned long __unused3; | |
7991 | unsigned long __unused4; | |
7992 | }; | |
7993 | # 36 "include/linux/sem.h" 2 | |
7994 | ||
7995 | ||
7996 | struct sembuf { | |
7997 | unsigned short sem_num; | |
7998 | short sem_op; | |
7999 | short sem_flg; | |
8000 | }; | |
8001 | ||
8002 | ||
8003 | union semun { | |
8004 | int val; | |
8005 | struct semid_ds *buf; | |
8006 | unsigned short *array; | |
8007 | struct seminfo *__buf; | |
8008 | void *__pad; | |
8009 | }; | |
8010 | ||
8011 | struct seminfo { | |
8012 | int semmap; | |
8013 | int semmni; | |
8014 | int semmns; | |
8015 | int semmnu; | |
8016 | int semmsl; | |
8017 | int semopm; | |
8018 | int semume; | |
8019 | int semusz; | |
8020 | int semvmx; | |
8021 | int semaem; | |
8022 | }; | |
8023 | # 82 "include/linux/sem.h" | |
8024 | struct task_struct; | |
8025 | ||
8026 | ||
8027 | struct sem { | |
8028 | int semval; | |
8029 | int sempid; | |
8030 | }; | |
8031 | ||
8032 | ||
8033 | struct sem_array { | |
8034 | struct kern_ipc_perm sem_perm; | |
8035 | int sem_id; | |
8036 | time_t sem_otime; | |
8037 | time_t sem_ctime; | |
8038 | struct sem *sem_base; | |
8039 | struct sem_queue *sem_pending; | |
8040 | struct sem_queue **sem_pending_last; | |
8041 | struct sem_undo *undo; | |
8042 | unsigned long sem_nsems; | |
8043 | }; | |
8044 | ||
8045 | ||
8046 | struct sem_queue { | |
8047 | struct sem_queue * next; | |
8048 | struct sem_queue ** prev; | |
8049 | struct task_struct* sleeper; | |
8050 | struct sem_undo * undo; | |
8051 | int pid; | |
8052 | int status; | |
8053 | struct sem_array * sma; | |
8054 | int id; | |
8055 | struct sembuf * sops; | |
8056 | int nsops; | |
8057 | int alter; | |
8058 | }; | |
8059 | ||
8060 | ||
8061 | ||
8062 | ||
8063 | struct sem_undo { | |
8064 | struct sem_undo * proc_next; | |
8065 | struct sem_undo * id_next; | |
8066 | int semid; | |
8067 | short * semadj; | |
8068 | }; | |
8069 | ||
8070 | ||
8071 | ||
8072 | ||
8073 | struct sem_undo_list { | |
8074 | atomic_t refcnt; | |
8075 | spinlock_t lock; | |
8076 | struct sem_undo *proc_list; | |
8077 | }; | |
8078 | ||
8079 | struct sysv_sem { | |
8080 | struct sem_undo_list *undo_list; | |
8081 | }; | |
8082 | ||
8083 | ||
8084 | ||
8085 | extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk); | |
8086 | extern void exit_sem(struct task_struct *tsk); | |
8087 | # 63 "include/linux/syscalls.h" 2 | |
8088 | ||
8089 | # 1 "include/asm/siginfo.h" 1 | |
8090 | ||
8091 | ||
8092 | ||
8093 | ||
8094 | # 1 "include/asm-generic/siginfo.h" 1 | |
8095 | ||
8096 | ||
8097 | ||
8098 | ||
8099 | ||
8100 | ||
8101 | typedef union sigval { | |
8102 | int sival_int; | |
8103 | void *sival_ptr; | |
8104 | } sigval_t; | |
8105 | # 40 "include/asm-generic/siginfo.h" | |
8106 | typedef struct siginfo { | |
8107 | int si_signo; | |
8108 | int si_errno; | |
8109 | int si_code; | |
8110 | ||
8111 | union { | |
8112 | int _pad[((128 - (3 * sizeof(int))) / sizeof(int))]; | |
8113 | ||
8114 | ||
8115 | struct { | |
8116 | pid_t _pid; | |
8117 | uid_t _uid; | |
8118 | } _kill; | |
8119 | ||
8120 | ||
8121 | struct { | |
8122 | timer_t _tid; | |
8123 | int _overrun; | |
8124 | char _pad[sizeof( uid_t) - sizeof(int)]; | |
8125 | sigval_t _sigval; | |
8126 | int _sys_private; | |
8127 | } _timer; | |
8128 | ||
8129 | ||
8130 | struct { | |
8131 | pid_t _pid; | |
8132 | uid_t _uid; | |
8133 | sigval_t _sigval; | |
8134 | } _rt; | |
8135 | ||
8136 | ||
8137 | struct { | |
8138 | pid_t _pid; | |
8139 | uid_t _uid; | |
8140 | int _status; | |
8141 | clock_t _utime; | |
8142 | clock_t _stime; | |
8143 | } _sigchld; | |
8144 | ||
8145 | ||
8146 | struct { | |
8147 | void *_addr; | |
8148 | ||
8149 | ||
8150 | ||
8151 | } _sigfault; | |
8152 | ||
8153 | ||
8154 | struct { | |
8155 | long _band; | |
8156 | int _fd; | |
8157 | } _sigpoll; | |
8158 | } _sifields; | |
8159 | } siginfo_t; | |
8160 | # 251 "include/asm-generic/siginfo.h" | |
8161 | typedef struct sigevent { | |
8162 | sigval_t sigev_value; | |
8163 | int sigev_signo; | |
8164 | int sigev_notify; | |
8165 | union { | |
8166 | int _pad[((64 - (sizeof(int) * 2 + sizeof(sigval_t))) / sizeof(int))]; | |
8167 | int _tid; | |
8168 | ||
8169 | struct { | |
8170 | void (*_function)(sigval_t); | |
8171 | void *_attribute; | |
8172 | } _sigev_thread; | |
8173 | } _sigev_un; | |
8174 | } sigevent_t; | |
8175 | ||
8176 | ||
8177 | ||
8178 | ||
8179 | ||
8180 | ||
8181 | ||
8182 | struct siginfo; | |
8183 | void do_schedule_next_timer(struct siginfo *info); | |
8184 | ||
8185 | ||
8186 | ||
8187 | ||
8188 | ||
8189 | static inline __attribute__((always_inline)) void copy_siginfo(struct siginfo *to, struct siginfo *from) | |
8190 | { | |
8191 | if (from->si_code < 0) | |
8192 | memcpy(to, from, sizeof(*to)); | |
8193 | else | |
8194 | ||
8195 | memcpy(to, from, (3 * sizeof(int)) + sizeof(from->_sifields._sigchld)); | |
8196 | } | |
8197 | ||
8198 | ||
8199 | ||
8200 | extern int copy_siginfo_to_user(struct siginfo *to, struct siginfo *from); | |
8201 | # 6 "include/asm/siginfo.h" 2 | |
8202 | # 65 "include/linux/syscalls.h" 2 | |
8203 | # 1 "include/asm/signal.h" 1 | |
8204 | ||
8205 | ||
8206 | ||
8207 | ||
8208 | ||
8209 | ||
8210 | struct siginfo; | |
8211 | # 17 "include/asm/signal.h" | |
8212 | typedef unsigned long old_sigset_t; | |
8213 | ||
8214 | typedef struct { | |
8215 | unsigned long sig[(64 / 32)]; | |
8216 | } sigset_t; | |
8217 | # 107 "include/asm/signal.h" | |
8218 | # 1 "include/asm-generic/signal.h" 1 | |
8219 | # 17 "include/asm-generic/signal.h" | |
8220 | typedef void __signalfn_t(int); | |
8221 | typedef __signalfn_t *__sighandler_t; | |
8222 | ||
8223 | typedef void __restorefn_t(void); | |
8224 | typedef __restorefn_t *__sigrestore_t; | |
8225 | # 108 "include/asm/signal.h" 2 | |
8226 | ||
8227 | ||
8228 | struct old_sigaction { | |
8229 | __sighandler_t sa_handler; | |
8230 | old_sigset_t sa_mask; | |
8231 | unsigned long sa_flags; | |
8232 | void (*sa_restorer) (void); | |
8233 | }; | |
8234 | ||
8235 | struct sigaction { | |
8236 | __sighandler_t sa_handler; | |
8237 | unsigned long sa_flags; | |
8238 | void (*sa_restorer) (void); | |
8239 | sigset_t sa_mask; | |
8240 | }; | |
8241 | ||
8242 | struct k_sigaction { | |
8243 | struct sigaction sa; | |
8244 | }; | |
8245 | # 145 "include/asm/signal.h" | |
8246 | typedef struct sigaltstack { | |
8247 | void *ss_sp; | |
8248 | int ss_flags; | |
8249 | size_t ss_size; | |
8250 | } stack_t; | |
8251 | ||
8252 | ||
8253 | ||
8254 | # 1 "include/asm/sigcontext.h" 1 | |
8255 | ||
8256 | ||
8257 | ||
8258 | ||
8259 | struct sigcontext { | |
8260 | unsigned long sc_r0; | |
8261 | unsigned long sc_r1; | |
8262 | unsigned long sc_r2; | |
8263 | unsigned long sc_r3; | |
8264 | unsigned long sc_r4; | |
8265 | unsigned long sc_r5; | |
8266 | unsigned long sc_r6; | |
8267 | unsigned long sc_r7; | |
8268 | unsigned long sc_p0; | |
8269 | unsigned long sc_p1; | |
8270 | unsigned long sc_p2; | |
8271 | unsigned long sc_p3; | |
8272 | unsigned long sc_p4; | |
8273 | unsigned long sc_p5; | |
8274 | unsigned long sc_usp; | |
8275 | unsigned long sc_a0w; | |
8276 | unsigned long sc_a1w; | |
8277 | unsigned long sc_a0x; | |
8278 | unsigned long sc_a1x; | |
8279 | unsigned long sc_astat; | |
8280 | unsigned long sc_rets; | |
8281 | unsigned long sc_pc; | |
8282 | unsigned long sc_retx; | |
8283 | unsigned long sc_fp; | |
8284 | unsigned long sc_i0; | |
8285 | unsigned long sc_i1; | |
8286 | unsigned long sc_i2; | |
8287 | unsigned long sc_i3; | |
8288 | unsigned long sc_m0; | |
8289 | unsigned long sc_m1; | |
8290 | unsigned long sc_m2; | |
8291 | unsigned long sc_m3; | |
8292 | unsigned long sc_l0; | |
8293 | unsigned long sc_l1; | |
8294 | unsigned long sc_l2; | |
8295 | unsigned long sc_l3; | |
8296 | unsigned long sc_b0; | |
8297 | unsigned long sc_b1; | |
8298 | unsigned long sc_b2; | |
8299 | unsigned long sc_b3; | |
8300 | unsigned long sc_lc0; | |
8301 | unsigned long sc_lc1; | |
8302 | unsigned long sc_lt0; | |
8303 | unsigned long sc_lt1; | |
8304 | unsigned long sc_lb0; | |
8305 | unsigned long sc_lb1; | |
8306 | unsigned long sc_seqstat; | |
8307 | }; | |
8308 | # 154 "include/asm/signal.h" 2 | |
8309 | # 66 "include/linux/syscalls.h" 2 | |
8310 | ||
8311 | # 1 "include/linux/key.h" 1 | |
8312 | # 20 "include/linux/key.h" | |
8313 | # 1 "include/linux/rbtree.h" 1 | |
8314 | # 100 "include/linux/rbtree.h" | |
8315 | struct rb_node | |
8316 | { | |
8317 | unsigned long rb_parent_color; | |
8318 | ||
8319 | ||
8320 | struct rb_node *rb_right; | |
8321 | struct rb_node *rb_left; | |
8322 | } __attribute__((aligned(sizeof(long)))); | |
8323 | ||
8324 | ||
8325 | struct rb_root | |
8326 | { | |
8327 | struct rb_node *rb_node; | |
8328 | }; | |
8329 | # 123 "include/linux/rbtree.h" | |
8330 | static inline __attribute__((always_inline)) void rb_set_parent(struct rb_node *rb, struct rb_node *p) | |
8331 | { | |
8332 | rb->rb_parent_color = (rb->rb_parent_color & 3) | (unsigned long)p; | |
8333 | } | |
8334 | static inline __attribute__((always_inline)) void rb_set_color(struct rb_node *rb, int color) | |
8335 | { | |
8336 | rb->rb_parent_color = (rb->rb_parent_color & ~1) | color; | |
8337 | } | |
8338 | # 139 "include/linux/rbtree.h" | |
8339 | extern void rb_insert_color(struct rb_node *, struct rb_root *); | |
8340 | extern void rb_erase(struct rb_node *, struct rb_root *); | |
8341 | ||
8342 | ||
8343 | extern struct rb_node *rb_next(struct rb_node *); | |
8344 | extern struct rb_node *rb_prev(struct rb_node *); | |
8345 | extern struct rb_node *rb_first(struct rb_root *); | |
8346 | extern struct rb_node *rb_last(struct rb_root *); | |
8347 | ||
8348 | ||
8349 | extern void rb_replace_node(struct rb_node *victim, struct rb_node *new, | |
8350 | struct rb_root *root); | |
8351 | ||
8352 | static inline __attribute__((always_inline)) void rb_link_node(struct rb_node * node, struct rb_node * parent, | |
8353 | struct rb_node ** rb_link) | |
8354 | { | |
8355 | node->rb_parent_color = (unsigned long )parent; | |
8356 | node->rb_left = node->rb_right = ((void *)0); | |
8357 | ||
8358 | *rb_link = node; | |
8359 | } | |
8360 | # 21 "include/linux/key.h" 2 | |
8361 | ||
8362 | ||
8363 | ||
8364 | ||
8365 | ||
8366 | ||
8367 | typedef int32_t key_serial_t; | |
8368 | ||
8369 | ||
8370 | typedef uint32_t key_perm_t; | |
8371 | ||
8372 | struct key; | |
8373 | # 383 "include/linux/key.h" | |
8374 | extern struct key root_user_keyring; | |
8375 | extern struct key root_session_keyring; | |
8376 | # 68 "include/linux/syscalls.h" 2 | |
8377 | ||
8378 | long sys_time(time_t *tloc); | |
8379 | long sys_stime(time_t *tptr); | |
8380 | long sys_gettimeofday(struct timeval *tv, | |
8381 | struct timezone *tz); | |
8382 | long sys_settimeofday(struct timeval *tv, | |
8383 | struct timezone *tz); | |
8384 | long sys_adjtimex(struct timex *txc_p); | |
8385 | ||
8386 | long sys_times(struct tms *tbuf); | |
8387 | ||
8388 | long sys_gettid(void); | |
8389 | long sys_nanosleep(struct timespec *rqtp, struct timespec *rmtp); | |
8390 | unsigned long sys_alarm(unsigned int seconds); | |
8391 | long sys_getpid(void); | |
8392 | long sys_getppid(void); | |
8393 | long sys_getuid(void); | |
8394 | long sys_geteuid(void); | |
8395 | long sys_getgid(void); | |
8396 | long sys_getegid(void); | |
8397 | long sys_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); | |
8398 | long sys_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); | |
8399 | long sys_getpgid(pid_t pid); | |
8400 | long sys_getpgrp(void); | |
8401 | long sys_getsid(pid_t pid); | |
8402 | long sys_getgroups(int gidsetsize, gid_t *grouplist); | |
8403 | ||
8404 | long sys_setregid(gid_t rgid, gid_t egid); | |
8405 | long sys_setgid(gid_t gid); | |
8406 | long sys_setreuid(uid_t ruid, uid_t euid); | |
8407 | long sys_setuid(uid_t uid); | |
8408 | long sys_setresuid(uid_t ruid, uid_t euid, uid_t suid); | |
8409 | long sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid); | |
8410 | long sys_setfsuid(uid_t uid); | |
8411 | long sys_setfsgid(gid_t gid); | |
8412 | long sys_setpgid(pid_t pid, pid_t pgid); | |
8413 | long sys_setsid(void); | |
8414 | long sys_setgroups(int gidsetsize, gid_t *grouplist); | |
8415 | ||
8416 | long sys_acct(const char *name); | |
8417 | long sys_capget(cap_user_header_t header, | |
8418 | cap_user_data_t dataptr); | |
8419 | long sys_capset(cap_user_header_t header, | |
8420 | const cap_user_data_t data); | |
8421 | long sys_personality(u_long personality); | |
8422 | ||
8423 | long sys_sigpending(old_sigset_t *set); | |
8424 | long sys_sigprocmask(int how, old_sigset_t *set, | |
8425 | old_sigset_t *oset); | |
8426 | long sys_getitimer(int which, struct itimerval *value); | |
8427 | long sys_setitimer(int which, | |
8428 | struct itimerval *value, | |
8429 | struct itimerval *ovalue); | |
8430 | long sys_timer_create(clockid_t which_clock, | |
8431 | struct sigevent *timer_event_spec, | |
8432 | timer_t * created_timer_id); | |
8433 | long sys_timer_gettime(timer_t timer_id, | |
8434 | struct itimerspec *setting); | |
8435 | long sys_timer_getoverrun(timer_t timer_id); | |
8436 | long sys_timer_settime(timer_t timer_id, int flags, | |
8437 | const struct itimerspec *new_setting, | |
8438 | struct itimerspec *old_setting); | |
8439 | long sys_timer_delete(timer_t timer_id); | |
8440 | long sys_clock_settime(clockid_t which_clock, | |
8441 | const struct timespec *tp); | |
8442 | long sys_clock_gettime(clockid_t which_clock, | |
8443 | struct timespec *tp); | |
8444 | long sys_clock_getres(clockid_t which_clock, | |
8445 | struct timespec *tp); | |
8446 | long sys_clock_nanosleep(clockid_t which_clock, int flags, | |
8447 | const struct timespec *rqtp, | |
8448 | struct timespec *rmtp); | |
8449 | ||
8450 | long sys_nice(int increment); | |
8451 | long sys_sched_setscheduler(pid_t pid, int policy, | |
8452 | struct sched_param *param); | |
8453 | long sys_sched_setparam(pid_t pid, | |
8454 | struct sched_param *param); | |
8455 | long sys_sched_getscheduler(pid_t pid); | |
8456 | long sys_sched_getparam(pid_t pid, | |
8457 | struct sched_param *param); | |
8458 | long sys_sched_setaffinity(pid_t pid, unsigned int len, | |
8459 | unsigned long *user_mask_ptr); | |
8460 | long sys_sched_getaffinity(pid_t pid, unsigned int len, | |
8461 | unsigned long *user_mask_ptr); | |
8462 | long sys_sched_yield(void); | |
8463 | long sys_sched_get_priority_max(int policy); | |
8464 | long sys_sched_get_priority_min(int policy); | |
8465 | long sys_sched_rr_get_interval(pid_t pid, | |
8466 | struct timespec *interval); | |
8467 | long sys_setpriority(int which, int who, int niceval); | |
8468 | long sys_getpriority(int which, int who); | |
8469 | ||
8470 | long sys_shutdown(int, int); | |
8471 | long sys_reboot(int magic1, int magic2, unsigned int cmd, | |
8472 | void *arg); | |
8473 | long sys_restart_syscall(void); | |
8474 | long sys_kexec_load(unsigned long entry, unsigned long nr_segments, | |
8475 | struct kexec_segment *segments, | |
8476 | unsigned long flags); | |
8477 | ||
8478 | long sys_exit(int error_code); | |
8479 | void sys_exit_group(int error_code); | |
8480 | long sys_wait4(pid_t pid, int *stat_addr, | |
8481 | int options, struct rusage *ru); | |
8482 | long sys_waitid(int which, pid_t pid, | |
8483 | struct siginfo *infop, | |
8484 | int options, struct rusage *ru); | |
8485 | long sys_waitpid(pid_t pid, int *stat_addr, int options); | |
8486 | long sys_set_tid_address(int *tidptr); | |
8487 | long sys_futex(u32 *uaddr, int op, u32 val, | |
8488 | struct timespec *utime, u32 *uaddr2, | |
8489 | u32 val3); | |
8490 | ||
8491 | long sys_init_module(void *umod, unsigned long len, | |
8492 | const char *uargs); | |
8493 | long sys_delete_module(const char *name_user, | |
8494 | unsigned int flags); | |
8495 | ||
8496 | long sys_rt_sigprocmask(int how, sigset_t *set, | |
8497 | sigset_t *oset, size_t sigsetsize); | |
8498 | long sys_rt_sigpending(sigset_t *set, size_t sigsetsize); | |
8499 | long sys_rt_sigtimedwait(const sigset_t *uthese, | |
8500 | siginfo_t *uinfo, | |
8501 | const struct timespec *uts, | |
8502 | size_t sigsetsize); | |
8503 | long sys_kill(int pid, int sig); | |
8504 | long sys_tgkill(int tgid, int pid, int sig); | |
8505 | long sys_tkill(int pid, int sig); | |
8506 | long sys_rt_sigqueueinfo(int pid, int sig, siginfo_t *uinfo); | |
8507 | long sys_sgetmask(void); | |
8508 | long sys_ssetmask(int newmask); | |
8509 | unsigned long sys_signal(int sig, __sighandler_t handler); | |
8510 | long sys_pause(void); | |
8511 | ||
8512 | long sys_sync(void); | |
8513 | long sys_fsync(unsigned int fd); | |
8514 | long sys_fdatasync(unsigned int fd); | |
8515 | long sys_bdflush(int func, long data); | |
8516 | long sys_mount(char *dev_name, char *dir_name, | |
8517 | char *type, unsigned long flags, | |
8518 | void *data); | |
8519 | long sys_umount(char *name, int flags); | |
8520 | long sys_oldumount(char *name); | |
8521 | long sys_truncate(const char *path, | |
8522 | unsigned long length); | |
8523 | long sys_ftruncate(unsigned int fd, unsigned long length); | |
8524 | long sys_stat(char *filename, | |
8525 | struct __old_kernel_stat *statbuf); | |
8526 | long sys_statfs(const char * path, | |
8527 | struct statfs *buf); | |
8528 | long sys_statfs64(const char *path, size_t sz, | |
8529 | struct statfs64 *buf); | |
8530 | long sys_fstatfs(unsigned int fd, struct statfs *buf); | |
8531 | long sys_fstatfs64(unsigned int fd, size_t sz, | |
8532 | struct statfs64 *buf); | |
8533 | long sys_lstat(char *filename, | |
8534 | struct __old_kernel_stat *statbuf); | |
8535 | long sys_fstat(unsigned int fd, | |
8536 | struct __old_kernel_stat *statbuf); | |
8537 | long sys_newstat(char *filename, | |
8538 | struct stat *statbuf); | |
8539 | long sys_newlstat(char *filename, | |
8540 | struct stat *statbuf); | |
8541 | long sys_newfstat(unsigned int fd, struct stat *statbuf); | |
8542 | long sys_ustat(unsigned dev, struct ustat *ubuf); | |
8543 | ||
8544 | long sys_stat64(char *filename, | |
8545 | struct stat64 *statbuf); | |
8546 | long sys_fstat64(unsigned long fd, struct stat64 *statbuf); | |
8547 | long sys_lstat64(char *filename, | |
8548 | struct stat64 *statbuf); | |
8549 | long sys_truncate64(const char *path, loff_t length); | |
8550 | long sys_ftruncate64(unsigned int fd, loff_t length); | |
8551 | ||
8552 | ||
8553 | long sys_setxattr(char *path, char *name, | |
8554 | void *value, size_t size, int flags); | |
8555 | long sys_lsetxattr(char *path, char *name, | |
8556 | void *value, size_t size, int flags); | |
8557 | long sys_fsetxattr(int fd, char *name, void *value, | |
8558 | size_t size, int flags); | |
8559 | ssize_t sys_getxattr(char *path, char *name, | |
8560 | void *value, size_t size); | |
8561 | ssize_t sys_lgetxattr(char *path, char *name, | |
8562 | void *value, size_t size); | |
8563 | ssize_t sys_fgetxattr(int fd, char *name, | |
8564 | void *value, size_t size); | |
8565 | ssize_t sys_listxattr(char *path, char *list, | |
8566 | size_t size); | |
8567 | ssize_t sys_llistxattr(char *path, char *list, | |
8568 | size_t size); | |
8569 | ssize_t sys_flistxattr(int fd, char *list, size_t size); | |
8570 | long sys_removexattr(char *path, char *name); | |
8571 | long sys_lremovexattr(char *path, char *name); | |
8572 | long sys_fremovexattr(int fd, char *name); | |
8573 | ||
8574 | unsigned long sys_brk(unsigned long brk); | |
8575 | long sys_mprotect(unsigned long start, size_t len, | |
8576 | unsigned long prot); | |
8577 | unsigned long sys_mremap(unsigned long addr, | |
8578 | unsigned long old_len, unsigned long new_len, | |
8579 | unsigned long flags, unsigned long new_addr); | |
8580 | long sys_remap_file_pages(unsigned long start, unsigned long size, | |
8581 | unsigned long prot, unsigned long pgoff, | |
8582 | unsigned long flags); | |
8583 | long sys_msync(unsigned long start, size_t len, int flags); | |
8584 | long sys_fadvise64(int fd, loff_t offset, size_t len, int advice); | |
8585 | long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice); | |
8586 | long sys_munmap(unsigned long addr, size_t len); | |
8587 | long sys_mlock(unsigned long start, size_t len); | |
8588 | long sys_munlock(unsigned long start, size_t len); | |
8589 | long sys_mlockall(int flags); | |
8590 | long sys_munlockall(void); | |
8591 | long sys_madvise(unsigned long start, size_t len, int behavior); | |
8592 | long sys_mincore(unsigned long start, size_t len, | |
8593 | unsigned char * vec); | |
8594 | ||
8595 | long sys_pivot_root(const char *new_root, | |
8596 | const char *put_old); | |
8597 | long sys_chroot(const char *filename); | |
8598 | long sys_mknod(const char *filename, int mode, | |
8599 | unsigned dev); | |
8600 | long sys_link(const char *oldname, | |
8601 | const char *newname); | |
8602 | long sys_symlink(const char *old, const char *new); | |
8603 | long sys_unlink(const char *pathname); | |
8604 | long sys_rename(const char *oldname, | |
8605 | const char *newname); | |
8606 | long sys_chmod(const char *filename, mode_t mode); | |
8607 | long sys_fchmod(unsigned int fd, mode_t mode); | |
8608 | ||
8609 | long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg); | |
8610 | ||
8611 | long sys_fcntl64(unsigned int fd, | |
8612 | unsigned int cmd, unsigned long arg); | |
8613 | ||
8614 | long sys_dup(unsigned int fildes); | |
8615 | long sys_dup2(unsigned int oldfd, unsigned int newfd); | |
8616 | long sys_ioperm(unsigned long from, unsigned long num, int on); | |
8617 | long sys_ioctl(unsigned int fd, unsigned int cmd, | |
8618 | unsigned long arg); | |
8619 | long sys_flock(unsigned int fd, unsigned int cmd); | |
8620 | long sys_io_setup(unsigned nr_reqs, aio_context_t *ctx); | |
8621 | long sys_io_destroy(aio_context_t ctx); | |
8622 | long sys_io_getevents(aio_context_t ctx_id, | |
8623 | long min_nr, | |
8624 | long nr, | |
8625 | struct io_event *events, | |
8626 | struct timespec *timeout); | |
8627 | long sys_io_submit(aio_context_t, long, | |
8628 | struct iocb * *); | |
8629 | long sys_io_cancel(aio_context_t ctx_id, struct iocb *iocb, | |
8630 | struct io_event *result); | |
8631 | ssize_t sys_sendfile(int out_fd, int in_fd, | |
8632 | off_t *offset, size_t count); | |
8633 | ssize_t sys_sendfile64(int out_fd, int in_fd, | |
8634 | loff_t *offset, size_t count); | |
8635 | long sys_readlink(const char *path, | |
8636 | char *buf, int bufsiz); | |
8637 | long sys_creat(const char *pathname, int mode); | |
8638 | long sys_open(const char *filename, | |
8639 | int flags, int mode); | |
8640 | long sys_close(unsigned int fd); | |
8641 | long sys_access(const char *filename, int mode); | |
8642 | long sys_vhangup(void); | |
8643 | long sys_chown(const char *filename, | |
8644 | uid_t user, gid_t group); | |
8645 | long sys_lchown(const char *filename, | |
8646 | uid_t user, gid_t group); | |
8647 | long sys_fchown(unsigned int fd, uid_t user, gid_t group); | |
8648 | ||
8649 | long sys_chown16(const char *filename, | |
8650 | old_uid_t user, old_gid_t group); | |
8651 | long sys_lchown16(const char *filename, | |
8652 | old_uid_t user, old_gid_t group); | |
8653 | long sys_fchown16(unsigned int fd, old_uid_t user, old_gid_t group); | |
8654 | long sys_setregid16(old_gid_t rgid, old_gid_t egid); | |
8655 | long sys_setgid16(old_gid_t gid); | |
8656 | long sys_setreuid16(old_uid_t ruid, old_uid_t euid); | |
8657 | long sys_setuid16(old_uid_t uid); | |
8658 | long sys_setresuid16(old_uid_t ruid, old_uid_t euid, old_uid_t suid); | |
8659 | long sys_getresuid16(old_uid_t *ruid, | |
8660 | old_uid_t *euid, old_uid_t *suid); | |
8661 | long sys_setresgid16(old_gid_t rgid, old_gid_t egid, old_gid_t sgid); | |
8662 | long sys_getresgid16(old_gid_t *rgid, | |
8663 | old_gid_t *egid, old_gid_t *sgid); | |
8664 | long sys_setfsuid16(old_uid_t uid); | |
8665 | long sys_setfsgid16(old_gid_t gid); | |
8666 | long sys_getgroups16(int gidsetsize, old_gid_t *grouplist); | |
8667 | long sys_setgroups16(int gidsetsize, old_gid_t *grouplist); | |
8668 | long sys_getuid16(void); | |
8669 | long sys_geteuid16(void); | |
8670 | long sys_getgid16(void); | |
8671 | long sys_getegid16(void); | |
8672 | ||
8673 | ||
8674 | long sys_utime(char *filename, | |
8675 | struct utimbuf *times); | |
8676 | long sys_utimes(char *filename, | |
8677 | struct timeval *utimes); | |
8678 | off_t sys_lseek(unsigned int fd, off_t offset, | |
8679 | unsigned int origin); | |
8680 | long sys_llseek(unsigned int fd, unsigned long offset_high, | |
8681 | unsigned long offset_low, loff_t *result, | |
8682 | unsigned int origin); | |
8683 | ssize_t sys_read(unsigned int fd, char *buf, | |
8684 | size_t count); | |
8685 | ssize_t sys_readahead(int fd, loff_t offset, size_t count); | |
8686 | ssize_t sys_readv(unsigned long fd, | |
8687 | const struct iovec *vec, | |
8688 | unsigned long vlen); | |
8689 | ssize_t sys_write(unsigned int fd, const char *buf, | |
8690 | size_t count); | |
8691 | ssize_t sys_writev(unsigned long fd, | |
8692 | const struct iovec *vec, | |
8693 | unsigned long vlen); | |
8694 | ssize_t sys_pread64(unsigned int fd, char *buf, | |
8695 | size_t count, loff_t pos); | |
8696 | ssize_t sys_pwrite64(unsigned int fd, const char *buf, | |
8697 | size_t count, loff_t pos); | |
8698 | long sys_getcwd(char *buf, unsigned long size); | |
8699 | long sys_mkdir(const char *pathname, int mode); | |
8700 | long sys_chdir(const char *filename); | |
8701 | long sys_fchdir(unsigned int fd); | |
8702 | long sys_rmdir(const char *pathname); | |
8703 | long sys_lookup_dcookie(u64 cookie64, char *buf, size_t len); | |
8704 | long sys_quotactl(unsigned int cmd, const char *special, | |
8705 | qid_t id, void *addr); | |
8706 | long sys_getdents(unsigned int fd, | |
8707 | struct linux_dirent *dirent, | |
8708 | unsigned int count); | |
8709 | long sys_getdents64(unsigned int fd, | |
8710 | struct linux_dirent64 *dirent, | |
8711 | unsigned int count); | |
8712 | ||
8713 | long sys_setsockopt(int fd, int level, int optname, | |
8714 | char *optval, int optlen); | |
8715 | long sys_getsockopt(int fd, int level, int optname, | |
8716 | char *optval, int *optlen); | |
8717 | long sys_bind(int, struct sockaddr *, int); | |
8718 | long sys_connect(int, struct sockaddr *, int); | |
8719 | long sys_accept(int, struct sockaddr *, int *); | |
8720 | long sys_getsockname(int, struct sockaddr *, int *); | |
8721 | long sys_getpeername(int, struct sockaddr *, int *); | |
8722 | long sys_send(int, void *, size_t, unsigned); | |
8723 | long sys_sendto(int, void *, size_t, unsigned, | |
8724 | struct sockaddr *, int); | |
8725 | long sys_sendmsg(int fd, struct msghdr *msg, unsigned flags); | |
8726 | long sys_recv(int, void *, size_t, unsigned); | |
8727 | long sys_recvfrom(int, void *, size_t, unsigned, | |
8728 | struct sockaddr *, int *); | |
8729 | long sys_recvmsg(int fd, struct msghdr *msg, unsigned flags); | |
8730 | long sys_socket(int, int, int); | |
8731 | long sys_socketpair(int, int, int, int *); | |
8732 | long sys_socketcall(int call, unsigned long *args); | |
8733 | long sys_listen(int, int); | |
8734 | long sys_poll(struct pollfd *ufds, unsigned int nfds, | |
8735 | long timeout); | |
8736 | long sys_select(int n, fd_set *inp, fd_set *outp, | |
8737 | fd_set *exp, struct timeval *tvp); | |
8738 | long sys_epoll_create(int size); | |
8739 | long sys_epoll_ctl(int epfd, int op, int fd, | |
8740 | struct epoll_event *event); | |
8741 | long sys_epoll_wait(int epfd, struct epoll_event *events, | |
8742 | int maxevents, int timeout); | |
8743 | long sys_epoll_pwait(int epfd, struct epoll_event *events, | |
8744 | int maxevents, int timeout, | |
8745 | const sigset_t *sigmask, | |
8746 | size_t sigsetsize); | |
8747 | long sys_gethostname(char *name, int len); | |
8748 | long sys_sethostname(char *name, int len); | |
8749 | long sys_setdomainname(char *name, int len); | |
8750 | long sys_newuname(struct new_utsname *name); | |
8751 | ||
8752 | long sys_getrlimit(unsigned int resource, | |
8753 | struct rlimit *rlim); | |
8754 | ||
8755 | long sys_old_getrlimit(unsigned int resource, struct rlimit *rlim); | |
8756 | ||
8757 | long sys_setrlimit(unsigned int resource, | |
8758 | struct rlimit *rlim); | |
8759 | long sys_getrusage(int who, struct rusage *ru); | |
8760 | long sys_umask(int mask); | |
8761 | ||
8762 | long sys_msgget(key_t key, int msgflg); | |
8763 | long sys_msgsnd(int msqid, struct msgbuf *msgp, | |
8764 | size_t msgsz, int msgflg); | |
8765 | long sys_msgrcv(int msqid, struct msgbuf *msgp, | |
8766 | size_t msgsz, long msgtyp, int msgflg); | |
8767 | long sys_msgctl(int msqid, int cmd, struct msqid_ds *buf); | |
8768 | ||
8769 | long sys_semget(key_t key, int nsems, int semflg); | |
8770 | long sys_semop(int semid, struct sembuf *sops, | |
8771 | unsigned nsops); | |
8772 | long sys_semctl(int semid, int semnum, int cmd, union semun arg); | |
8773 | long sys_semtimedop(int semid, struct sembuf *sops, | |
8774 | unsigned nsops, | |
8775 | const struct timespec *timeout); | |
8776 | long sys_shmat(int shmid, char *shmaddr, int shmflg); | |
8777 | long sys_shmget(key_t key, size_t size, int flag); | |
8778 | long sys_shmdt(char *shmaddr); | |
8779 | long sys_shmctl(int shmid, int cmd, struct shmid_ds *buf); | |
8780 | ||
8781 | long sys_mq_open(const char *name, int oflag, mode_t mode, struct mq_attr *attr); | |
8782 | long sys_mq_unlink(const char *name); | |
8783 | long sys_mq_timedsend(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned int msg_prio, const struct timespec *abs_timeout); | |
8784 | ssize_t sys_mq_timedreceive(mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned int *msg_prio, const struct timespec *abs_timeout); | |
8785 | long sys_mq_notify(mqd_t mqdes, const struct sigevent *notification); | |
8786 | long sys_mq_getsetattr(mqd_t mqdes, const struct mq_attr *mqstat, struct mq_attr *omqstat); | |
8787 | ||
8788 | long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn); | |
8789 | long sys_pciconfig_read(unsigned long bus, unsigned long dfn, | |
8790 | unsigned long off, unsigned long len, | |
8791 | void *buf); | |
8792 | long sys_pciconfig_write(unsigned long bus, unsigned long dfn, | |
8793 | unsigned long off, unsigned long len, | |
8794 | void *buf); | |
8795 | ||
8796 | long sys_prctl(int option, unsigned long arg2, unsigned long arg3, | |
8797 | unsigned long arg4, unsigned long arg5); | |
8798 | long sys_swapon(const char *specialfile, int swap_flags); | |
8799 | long sys_swapoff(const char *specialfile); | |
8800 | long sys_sysctl(struct __sysctl_args *args); | |
8801 | long sys_sysinfo(struct sysinfo *info); | |
8802 | long sys_sysfs(int option, | |
8803 | unsigned long arg1, unsigned long arg2); | |
8804 | long sys_nfsservctl(int cmd, | |
8805 | struct nfsctl_arg *arg, | |
8806 | void *res); | |
8807 | long sys_syslog(int type, char *buf, int len); | |
8808 | long sys_uselib(const char *library); | |
8809 | long sys_ni_syscall(void); | |
8810 | long sys_ptrace(long request, long pid, long addr, long data); | |
8811 | ||
8812 | long sys_add_key(const char *_type, | |
8813 | const char *_description, | |
8814 | const void *_payload, | |
8815 | size_t plen, | |
8816 | key_serial_t destringid); | |
8817 | ||
8818 | long sys_request_key(const char *_type, | |
8819 | const char *_description, | |
8820 | const char *_callout_info, | |
8821 | key_serial_t destringid); | |
8822 | ||
8823 | long sys_keyctl(int cmd, unsigned long arg2, unsigned long arg3, | |
8824 | unsigned long arg4, unsigned long arg5); | |
8825 | ||
8826 | long sys_ioprio_set(int which, int who, int ioprio); | |
8827 | long sys_ioprio_get(int which, int who); | |
8828 | long sys_set_mempolicy(int mode, unsigned long *nmask, | |
8829 | unsigned long maxnode); | |
8830 | long sys_migrate_pages(pid_t pid, unsigned long maxnode, | |
8831 | const unsigned long *from, | |
8832 | const unsigned long *to); | |
8833 | long sys_move_pages(pid_t pid, unsigned long nr_pages, | |
8834 | const void * *pages, | |
8835 | const int *nodes, | |
8836 | int *status, | |
8837 | int flags); | |
8838 | long compat_sys_move_pages(pid_t pid, unsigned long nr_page, | |
8839 | __u32 *pages, | |
8840 | const int *nodes, | |
8841 | int *status, | |
8842 | int flags); | |
8843 | long sys_mbind(unsigned long start, unsigned long len, | |
8844 | unsigned long mode, | |
8845 | unsigned long *nmask, | |
8846 | unsigned long maxnode, | |
8847 | unsigned flags); | |
8848 | long sys_get_mempolicy(int *policy, | |
8849 | unsigned long *nmask, | |
8850 | unsigned long maxnode, | |
8851 | unsigned long addr, unsigned long flags); | |
8852 | ||
8853 | long sys_inotify_init(void); | |
8854 | long sys_inotify_add_watch(int fd, const char *path, | |
8855 | u32 mask); | |
8856 | long sys_inotify_rm_watch(int fd, u32 wd); | |
8857 | ||
8858 | long sys_spu_run(int fd, __u32 *unpc, | |
8859 | __u32 *ustatus); | |
8860 | long sys_spu_create(const char *name, | |
8861 | unsigned int flags, mode_t mode); | |
8862 | ||
8863 | long sys_mknodat(int dfd, const char * filename, int mode, | |
8864 | unsigned dev); | |
8865 | long sys_mkdirat(int dfd, const char * pathname, int mode); | |
8866 | long sys_unlinkat(int dfd, const char * pathname, int flag); | |
8867 | long sys_symlinkat(const char * oldname, | |
8868 | int newdfd, const char * newname); | |
8869 | long sys_linkat(int olddfd, const char *oldname, | |
8870 | int newdfd, const char *newname, int flags); | |
8871 | long sys_renameat(int olddfd, const char * oldname, | |
8872 | int newdfd, const char * newname); | |
8873 | long sys_futimesat(int dfd, char *filename, | |
8874 | struct timeval *utimes); | |
8875 | long sys_faccessat(int dfd, const char *filename, int mode); | |
8876 | long sys_fchmodat(int dfd, const char * filename, | |
8877 | mode_t mode); | |
8878 | long sys_fchownat(int dfd, const char *filename, uid_t user, | |
8879 | gid_t group, int flag); | |
8880 | long sys_openat(int dfd, const char *filename, int flags, | |
8881 | int mode); | |
8882 | long sys_newfstatat(int dfd, char *filename, | |
8883 | struct stat *statbuf, int flag); | |
8884 | long sys_fstatat64(int dfd, char *filename, | |
8885 | struct stat64 *statbuf, int flag); | |
8886 | long sys_readlinkat(int dfd, const char *path, char *buf, | |
8887 | int bufsiz); | |
8888 | long sys_utimensat(int dfd, char *filename, | |
8889 | struct timespec *utimes, int flags); | |
8890 | long compat_sys_futimesat(unsigned int dfd, char *filename, | |
8891 | struct compat_timeval *t); | |
8892 | long compat_sys_newfstatat(unsigned int dfd, char * filename, | |
8893 | struct compat_stat *statbuf, | |
8894 | int flag); | |
8895 | long compat_sys_openat(unsigned int dfd, const char *filename, | |
8896 | int flags, int mode); | |
8897 | long sys_unshare(unsigned long unshare_flags); | |
8898 | ||
8899 | long sys_splice(int fd_in, loff_t *off_in, | |
8900 | int fd_out, loff_t *off_out, | |
8901 | size_t len, unsigned int flags); | |
8902 | ||
8903 | long sys_vmsplice(int fd, const struct iovec *iov, | |
8904 | unsigned long nr_segs, unsigned int flags); | |
8905 | ||
8906 | long sys_tee(int fdin, int fdout, size_t len, unsigned int flags); | |
8907 | ||
8908 | long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, | |
8909 | unsigned int flags); | |
8910 | long sys_sync_file_range2(int fd, unsigned int flags, | |
8911 | loff_t offset, loff_t nbytes); | |
8912 | long sys_get_robust_list(int pid, | |
8913 | struct robust_list_head * *head_ptr, | |
8914 | size_t *len_ptr); | |
8915 | long sys_set_robust_list(struct robust_list_head *head, | |
8916 | size_t len); | |
8917 | long sys_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *cache); | |
8918 | long sys_signalfd(int ufd, sigset_t *user_mask, size_t sizemask); | |
8919 | long sys_timerfd(int ufd, int clockid, int flags, | |
8920 | const struct itimerspec *utmr); | |
8921 | long sys_eventfd(unsigned int count); | |
8922 | ||
8923 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]); | |
8924 | # 9 "init/initramfs.c" 2 | |
8925 | ||
8926 | static __attribute__ ((__section__ (".init.data"))) char *message; | |
8927 | static void __attribute__ ((__section__ (".init.text"))) error(char *x) | |
8928 | { | |
8929 | if (!message) | |
8930 | message = x; | |
8931 | } | |
8932 | ||
8933 | static void __attribute__ ((__section__ (".init.text"))) *malloc(size_t size) | |
8934 | { | |
8935 | return kmalloc(size, ((( gfp_t)0x10u) | (( gfp_t)0x40u) | (( gfp_t)0x80u))); | |
8936 | } | |
8937 | ||
8938 | static void __attribute__ ((__section__ (".init.text"))) free(void *where) | |
8939 | { | |
8940 | kfree(where); | |
8941 | } | |
8942 | ||
8943 | ||
8944 | ||
8945 | ||
8946 | ||
8947 | static __attribute__ ((__section__ (".init.data"))) struct hash { | |
8948 | int ino, minor, major; | |
8949 | mode_t mode; | |
8950 | struct hash *next; | |
8951 | char name[((((4096) + 1) & ~3) + 2)]; | |
8952 | } *head[32]; | |
8953 | ||
8954 | static inline __attribute__((always_inline)) int hash(int major, int minor, int ino) | |
8955 | { | |
8956 | unsigned long tmp = ino + minor + (major << 3); | |
8957 | tmp += tmp >> 5; | |
8958 | return tmp & 31; | |
8959 | } | |
8960 | ||
8961 | static char __attribute__ ((__section__ (".init.text"))) *find_link(int major, int minor, int ino, | |
8962 | mode_t mode, char *name) | |
8963 | { | |
8964 | struct hash **p, *q; | |
8965 | for (p = head + hash(major, minor, ino); *p; p = &(*p)->next) { | |
8966 | if ((*p)->ino != ino) | |
8967 | continue; | |
8968 | if ((*p)->minor != minor) | |
8969 | continue; | |
8970 | if ((*p)->major != major) | |
8971 | continue; | |
8972 | if (((*p)->mode ^ mode) & 00170000) | |
8973 | continue; | |
8974 | return (*p)->name; | |
8975 | } | |
8976 | q = (struct hash *)malloc(sizeof(struct hash)); | |
8977 | if (!q) | |
8978 | panic("can't allocate link hash entry"); | |
8979 | q->major = major; | |
8980 | q->minor = minor; | |
8981 | q->ino = ino; | |
8982 | q->mode = mode; | |
8983 | strcpy(q->name, name); | |
8984 | q->next = ((void *)0); | |
8985 | *p = q; | |
8986 | return ((void *)0); | |
8987 | } | |
8988 | ||
8989 | static void __attribute__ ((__section__ (".init.text"))) free_hash(void) | |
8990 | { | |
8991 | struct hash **p, *q; | |
8992 | for (p = head; p < head + 32; p++) { | |
8993 | while (*p) { | |
8994 | q = *p; | |
8995 | *p = q->next; | |
8996 | free(q); | |
8997 | } | |
8998 | } | |
8999 | } | |
9000 | ||
9001 | ||
9002 | ||
9003 | static __attribute__ ((__section__ (".init.data"))) unsigned long ino, major, minor, nlink; | |
9004 | static __attribute__ ((__section__ (".init.data"))) mode_t mode; | |
9005 | static __attribute__ ((__section__ (".init.data"))) unsigned long body_len, name_len; | |
9006 | static __attribute__ ((__section__ (".init.data"))) uid_t uid; | |
9007 | static __attribute__ ((__section__ (".init.data"))) gid_t gid; | |
9008 | static __attribute__ ((__section__ (".init.data"))) unsigned rdev; | |
9009 | ||
9010 | static void __attribute__ ((__section__ (".init.text"))) parse_header(char *s) | |
9011 | { | |
9012 | unsigned long parsed[12]; | |
9013 | char buf[9]; | |
9014 | int i; | |
9015 | ||
9016 | buf[8] = '\0'; | |
9017 | for (i = 0, s += 6; i < 12; i++, s += 8) { | |
9018 | memcpy(buf, s, 8); | |
9019 | parsed[i] = simple_strtoul(buf, ((void *)0), 16); | |
9020 | } | |
9021 | ino = parsed[0]; | |
9022 | mode = parsed[1]; | |
9023 | uid = parsed[2]; | |
9024 | gid = parsed[3]; | |
9025 | nlink = parsed[4]; | |
9026 | body_len = parsed[6]; | |
9027 | major = parsed[7]; | |
9028 | minor = parsed[8]; | |
9029 | rdev = new_encode_dev((((parsed[9]) << 20) | (parsed[10]))); | |
9030 | name_len = parsed[11]; | |
9031 | } | |
9032 | ||
9033 | ||
9034 | ||
9035 | static __attribute__ ((__section__ (".init.data"))) enum state { | |
9036 | Start, | |
9037 | Collect, | |
9038 | GotHeader, | |
9039 | SkipIt, | |
9040 | GotName, | |
9041 | CopyFile, | |
9042 | GotSymlink, | |
9043 | Reset | |
9044 | } state, next_state; | |
9045 | ||
9046 | static __attribute__ ((__section__ (".init.data"))) char *victim; | |
9047 | static __attribute__ ((__section__ (".init.data"))) unsigned count; | |
9048 | static __attribute__ ((__section__ (".init.data"))) loff_t this_header, next_header; | |
9049 | ||
9050 | static __attribute__ ((__section__ (".init.data"))) int dry_run; | |
9051 | ||
9052 | static inline __attribute__((always_inline)) void eat(unsigned n) | |
9053 | { | |
9054 | victim += n; | |
9055 | this_header += n; | |
9056 | count -= n; | |
9057 | } | |
9058 | ||
9059 | static __attribute__ ((__section__ (".init.data"))) char *collected; | |
9060 | static __attribute__ ((__section__ (".init.data"))) int remains; | |
9061 | static __attribute__ ((__section__ (".init.data"))) char *collect; | |
9062 | ||
9063 | static void __attribute__ ((__section__ (".init.text"))) read_into(char *buf, unsigned size, enum state next) | |
9064 | { | |
9065 | if (count >= size) { | |
9066 | collected = victim; | |
9067 | eat(size); | |
9068 | state = next; | |
9069 | } else { | |
9070 | collect = collected = buf; | |
9071 | remains = size; | |
9072 | next_state = next; | |
9073 | state = Collect; | |
9074 | } | |
9075 | } | |
9076 | ||
9077 | static __attribute__ ((__section__ (".init.data"))) char *header_buf, *symlink_buf, *name_buf; | |
9078 | ||
9079 | static int __attribute__ ((__section__ (".init.text"))) do_start(void) | |
9080 | { | |
9081 | read_into(header_buf, 110, GotHeader); | |
9082 | return 0; | |
9083 | } | |
9084 | ||
9085 | static int __attribute__ ((__section__ (".init.text"))) do_collect(void) | |
9086 | { | |
9087 | unsigned n = remains; | |
9088 | if (count < n) | |
9089 | n = count; | |
9090 | memcpy(collect, victim, n); | |
9091 | eat(n); | |
9092 | collect += n; | |
9093 | if ((remains -= n) != 0) | |
9094 | return 1; | |
9095 | state = next_state; | |
9096 | return 0; | |
9097 | } | |
9098 | ||
9099 | static int __attribute__ ((__section__ (".init.text"))) do_header(void) | |
9100 | { | |
9101 | if (memcmp(collected, "070707", 6)==0) { | |
9102 | error("incorrect cpio method used: use -H newc option"); | |
9103 | return 1; | |
9104 | } | |
9105 | if (memcmp(collected, "070701", 6)) { | |
9106 | error("no cpio magic"); | |
9107 | return 1; | |
9108 | } | |
9109 | parse_header(collected); | |
9110 | next_header = this_header + ((((name_len) + 1) & ~3) + 2) + body_len; | |
9111 | next_header = (next_header + 3) & ~3; | |
9112 | if (dry_run) { | |
9113 | read_into(name_buf, ((((name_len) + 1) & ~3) + 2), GotName); | |
9114 | return 0; | |
9115 | } | |
9116 | state = SkipIt; | |
9117 | if (name_len <= 0 || name_len > 4096) | |
9118 | return 0; | |
9119 | if ((((mode) & 00170000) == 0120000)) { | |
9120 | if (body_len > 4096) | |
9121 | return 0; | |
9122 | collect = collected = symlink_buf; | |
9123 | remains = ((((name_len) + 1) & ~3) + 2) + body_len; | |
9124 | next_state = GotSymlink; | |
9125 | state = Collect; | |
9126 | return 0; | |
9127 | } | |
9128 | if ((((mode) & 00170000) == 0100000) || !body_len) | |
9129 | read_into(name_buf, ((((name_len) + 1) & ~3) + 2), GotName); | |
9130 | return 0; | |
9131 | } | |
9132 | ||
9133 | static int __attribute__ ((__section__ (".init.text"))) do_skip(void) | |
9134 | { | |
9135 | if (this_header + count < next_header) { | |
9136 | eat(count); | |
9137 | return 1; | |
9138 | } else { | |
9139 | eat(next_header - this_header); | |
9140 | state = next_state; | |
9141 | return 0; | |
9142 | } | |
9143 | } | |
9144 | ||
9145 | static int __attribute__ ((__section__ (".init.text"))) do_reset(void) | |
9146 | { | |
9147 | while(count && *victim == '\0') | |
9148 | eat(1); | |
9149 | if (count && (this_header & 3)) | |
9150 | error("broken padding"); | |
9151 | return 1; | |
9152 | } | |
9153 | ||
9154 | static int __attribute__ ((__section__ (".init.text"))) maybe_link(void) | |
9155 | { | |
9156 | if (nlink >= 2) { | |
9157 | char *old = find_link(major, minor, ino, mode, collected); | |
9158 | if (old) | |
9159 | return (sys_link(old, collected) < 0) ? -1 : 1; | |
9160 | } | |
9161 | return 0; | |
9162 | } | |
9163 | ||
9164 | static void __attribute__ ((__section__ (".init.text"))) clean_path(char *path, mode_t mode) | |
9165 | { | |
9166 | struct stat st; | |
9167 | ||
9168 | if (!sys_newlstat(path, &st) && (st.st_mode^mode) & 00170000) { | |
9169 | if ((((st.st_mode) & 00170000) == 0040000)) | |
9170 | sys_rmdir(path); | |
9171 | else | |
9172 | sys_unlink(path); | |
9173 | } | |
9174 | } | |
9175 | ||
9176 | static __attribute__ ((__section__ (".init.data"))) int wfd; | |
9177 | ||
9178 | static int __attribute__ ((__section__ (".init.text"))) do_name(void) | |
9179 | { | |
9180 | state = SkipIt; | |
9181 | next_state = Reset; | |
9182 | if (strcmp(collected, "TRAILER!!!") == 0) { | |
9183 | free_hash(); | |
9184 | return 0; | |
9185 | } | |
9186 | if (dry_run) | |
9187 | return 0; | |
9188 | clean_path(collected, mode); | |
9189 | if ((((mode) & 00170000) == 0100000)) { | |
9190 | int ml = maybe_link(); | |
9191 | if (ml >= 0) { | |
9192 | int openflags = 00000001|00000100; | |
9193 | if (ml != 1) | |
9194 | openflags |= 00001000; | |
9195 | wfd = sys_open(collected, openflags, mode); | |
9196 | ||
9197 | if (wfd >= 0) { | |
9198 | sys_fchown(wfd, uid, gid); | |
9199 | sys_fchmod(wfd, mode); | |
9200 | state = CopyFile; | |
9201 | } | |
9202 | } | |
9203 | } else if ((((mode) & 00170000) == 0040000)) { | |
9204 | sys_mkdir(collected, mode); | |
9205 | sys_chown(collected, uid, gid); | |
9206 | sys_chmod(collected, mode); | |
9207 | } else if ((((mode) & 00170000) == 0060000) || (((mode) & 00170000) == 0020000) || | |
9208 | (((mode) & 00170000) == 0010000) || (((mode) & 00170000) == 0140000)) { | |
9209 | if (maybe_link() == 0) { | |
9210 | sys_mknod(collected, mode, rdev); | |
9211 | sys_chown(collected, uid, gid); | |
9212 | sys_chmod(collected, mode); | |
9213 | } | |
9214 | } | |
9215 | return 0; | |
9216 | } | |
9217 | ||
9218 | static int __attribute__ ((__section__ (".init.text"))) do_copy(void) | |
9219 | { | |
9220 | if (count >= body_len) { | |
9221 | sys_write(wfd, victim, body_len); | |
9222 | sys_close(wfd); | |
9223 | eat(body_len); | |
9224 | state = SkipIt; | |
9225 | return 0; | |
9226 | } else { | |
9227 | sys_write(wfd, victim, count); | |
9228 | body_len -= count; | |
9229 | eat(count); | |
9230 | return 1; | |
9231 | } | |
9232 | } | |
9233 | ||
9234 | static int __attribute__ ((__section__ (".init.text"))) do_symlink(void) | |
9235 | { | |
9236 | collected[((((name_len) + 1) & ~3) + 2) + body_len] = '\0'; | |
9237 | clean_path(collected, 0); | |
9238 | sys_symlink(collected + ((((name_len) + 1) & ~3) + 2), collected); | |
9239 | sys_lchown(collected, uid, gid); | |
9240 | state = SkipIt; | |
9241 | next_state = Reset; | |
9242 | return 0; | |
9243 | } | |
9244 | ||
9245 | static __attribute__ ((__section__ (".init.data"))) int (*actions[])(void) = { | |
9246 | [Start] = do_start, | |
9247 | [Collect] = do_collect, | |
9248 | [GotHeader] = do_header, | |
9249 | [SkipIt] = do_skip, | |
9250 | [GotName] = do_name, | |
9251 | [CopyFile] = do_copy, | |
9252 | [GotSymlink] = do_symlink, | |
9253 | [Reset] = do_reset, | |
9254 | }; | |
9255 | ||
9256 | static int __attribute__ ((__section__ (".init.text"))) write_buffer(char *buf, unsigned len) | |
9257 | { | |
9258 | count = len; | |
9259 | victim = buf; | |
9260 | ||
9261 | while (!actions[state]()) | |
9262 | ; | |
9263 | return len - count; | |
9264 | } | |
9265 | ||
9266 | static void __attribute__ ((__section__ (".init.text"))) flush_buffer(char *buf, unsigned len) | |
9267 | { | |
9268 | int written; | |
9269 | if (message) | |
9270 | return; | |
9271 | while ((written = write_buffer(buf, len)) < len && !message) { | |
9272 | char c = buf[written]; | |
9273 | if (c == '0') { | |
9274 | buf += written; | |
9275 | len -= written; | |
9276 | state = Start; | |
9277 | } else if (c == 0) { | |
9278 | buf += written; | |
9279 | len -= written; | |
9280 | state = Reset; | |
9281 | } else | |
9282 | error("junk in compressed archive"); | |
9283 | } | |
9284 | } | |
9285 | # 380 "init/initramfs.c" | |
9286 | typedef unsigned char uch; | |
9287 | typedef unsigned short ush; | |
9288 | typedef unsigned long ulg; | |
9289 | ||
9290 | ||
9291 | ||
9292 | ||
9293 | static uch *inbuf; | |
9294 | static uch *window; | |
9295 | ||
9296 | static unsigned insize; | |
9297 | static unsigned inptr; | |
9298 | static unsigned outcnt; | |
9299 | static long bytes_out; | |
9300 | # 408 "init/initramfs.c" | |
9301 | static void __attribute__ ((__section__ (".init.text"))) flush_window(void); | |
9302 | static void __attribute__ ((__section__ (".init.text"))) error(char *m); | |
9303 | static void __attribute__ ((__section__ (".init.text"))) gzip_mark(void **); | |
9304 | static void __attribute__ ((__section__ (".init.text"))) gzip_release(void **); | |
9305 | ||
9306 | # 1 "init/../lib/inflate.c" 1 | |
9307 | # 135 "init/../lib/inflate.c" | |
9308 | struct huft { | |
9309 | uch e; | |
9310 | uch b; | |
9311 | union { | |
9312 | ush n; | |
9313 | struct huft *t; | |
9314 | } v; | |
9315 | }; | |
9316 | ||
9317 | ||
9318 | ||
9319 | static int __attribute__ ((__section__ (".init.text"))) huft_build (unsigned *, unsigned, unsigned, const ush *, const ush *, struct huft **, int *); | |
9320 | ||
9321 | static int __attribute__ ((__section__ (".init.text"))) huft_free (struct huft *); | |
9322 | static int __attribute__ ((__section__ (".init.text"))) inflate_codes (struct huft *, struct huft *, int, int); | |
9323 | static int __attribute__ ((__section__ (".init.text"))) inflate_stored (void); | |
9324 | static int __attribute__ ((__section__ (".init.text"))) inflate_fixed (void); | |
9325 | static int __attribute__ ((__section__ (".init.text"))) inflate_dynamic (void); | |
9326 | static int __attribute__ ((__section__ (".init.text"))) inflate_block (int *); | |
9327 | static int __attribute__ ((__section__ (".init.text"))) inflate (void); | |
9328 | # 170 "init/../lib/inflate.c" | |
9329 | static const unsigned border[] = { | |
9330 | 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; | |
9331 | static const ush cplens[] = { | |
9332 | 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, | |
9333 | 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; | |
9334 | ||
9335 | static const ush cplext[] = { | |
9336 | 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, | |
9337 | 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99}; | |
9338 | static const ush cpdist[] = { | |
9339 | 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, | |
9340 | 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, | |
9341 | 8193, 12289, 16385, 24577}; | |
9342 | static const ush cpdext[] = { | |
9343 | 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, | |
9344 | 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, | |
9345 | 12, 12, 13, 13}; | |
9346 | # 220 "init/../lib/inflate.c" | |
9347 | static ulg bb; | |
9348 | static unsigned bk; | |
9349 | ||
9350 | static const ush mask_bits[] = { | |
9351 | 0x0000, | |
9352 | 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, | |
9353 | 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff | |
9354 | }; | |
9355 | # 267 "init/../lib/inflate.c" | |
9356 | static const int lbits = 9; | |
9357 | static const int dbits = 6; | |
9358 | ||
9359 | ||
9360 | ||
9361 | ||
9362 | ||
9363 | ||
9364 | ||
9365 | static unsigned hufts; | |
9366 | ||
9367 | ||
9368 | static int __attribute__ ((__section__ (".init.text"))) huft_build( | |
9369 | unsigned *b, | |
9370 | unsigned n, | |
9371 | unsigned s, | |
9372 | const ush *d, | |
9373 | const ush *e, | |
9374 | struct huft **t, | |
9375 | int *m | |
9376 | ) | |
9377 | ||
9378 | ||
9379 | ||
9380 | ||
9381 | ||
9382 | { | |
9383 | unsigned a; | |
9384 | unsigned f; | |
9385 | int g; | |
9386 | int h; | |
9387 | register unsigned i; | |
9388 | register unsigned j; | |
9389 | register int k; | |
9390 | int l; | |
9391 | register unsigned *p; | |
9392 | register struct huft *q; | |
9393 | struct huft r; | |
9394 | register int w; | |
9395 | unsigned *xp; | |
9396 | int y; | |
9397 | unsigned z; | |
9398 | struct { | |
9399 | unsigned c[16 +1]; | |
9400 | struct huft *u[16]; | |
9401 | unsigned v[288]; | |
9402 | unsigned x[16 +1]; | |
9403 | } *stk; | |
9404 | unsigned *c, *v, *x; | |
9405 | struct huft **u; | |
9406 | int ret; | |
9407 | ||
9408 | ; | |
9409 | ||
9410 | stk = malloc(sizeof(*stk)); | |
9411 | if (stk == ((void *)0)) | |
9412 | return 3; | |
9413 | ||
9414 | c = stk->c; | |
9415 | v = stk->v; | |
9416 | x = stk->x; | |
9417 | u = stk->u; | |
9418 | ||
9419 | ||
9420 | memset ((stk->c), 0, (sizeof(stk->c))); | |
9421 | p = b; i = n; | |
9422 | do { | |
9423 | ; | |
9424 | ||
9425 | c[*p]++; | |
9426 | p++; | |
9427 | } while (--i); | |
9428 | if (c[0] == n) | |
9429 | { | |
9430 | *t = (struct huft *)((void *)0); | |
9431 | *m = 0; | |
9432 | ret = 2; | |
9433 | goto out; | |
9434 | } | |
9435 | ||
9436 | ; | |
9437 | ||
9438 | ||
9439 | l = *m; | |
9440 | for (j = 1; j <= 16; j++) | |
9441 | if (c[j]) | |
9442 | break; | |
9443 | k = j; | |
9444 | if ((unsigned)l < j) | |
9445 | l = j; | |
9446 | for (i = 16; i; i--) | |
9447 | if (c[i]) | |
9448 | break; | |
9449 | g = i; | |
9450 | if ((unsigned)l > i) | |
9451 | l = i; | |
9452 | *m = l; | |
9453 | ||
9454 | ; | |
9455 | ||
9456 | ||
9457 | for (y = 1 << j; j < i; j++, y <<= 1) | |
9458 | if ((y -= c[j]) < 0) { | |
9459 | ret = 2; | |
9460 | goto out; | |
9461 | } | |
9462 | if ((y -= c[i]) < 0) { | |
9463 | ret = 2; | |
9464 | goto out; | |
9465 | } | |
9466 | c[i] += y; | |
9467 | ||
9468 | ; | |
9469 | ||
9470 | ||
9471 | x[1] = j = 0; | |
9472 | p = c + 1; xp = x + 2; | |
9473 | while (--i) { | |
9474 | *xp++ = (j += *p++); | |
9475 | } | |
9476 | ||
9477 | ; | |
9478 | ||
9479 | ||
9480 | p = b; i = 0; | |
9481 | do { | |
9482 | if ((j = *p++) != 0) | |
9483 | v[x[j]++] = i; | |
9484 | } while (++i < n); | |
9485 | n = x[g]; | |
9486 | ||
9487 | ; | |
9488 | ||
9489 | ||
9490 | x[0] = i = 0; | |
9491 | p = v; | |
9492 | h = -1; | |
9493 | w = -l; | |
9494 | u[0] = (struct huft *)((void *)0); | |
9495 | q = (struct huft *)((void *)0); | |
9496 | z = 0; | |
9497 | ; | |
9498 | ||
9499 | ||
9500 | for (; k <= g; k++) | |
9501 | { | |
9502 | ; | |
9503 | a = c[k]; | |
9504 | while (a--) | |
9505 | { | |
9506 | ; | |
9507 | ||
9508 | ||
9509 | while (k > w + l) | |
9510 | { | |
9511 | ; | |
9512 | h++; | |
9513 | w += l; | |
9514 | ||
9515 | ||
9516 | z = (z = g - w) > (unsigned)l ? l : z; | |
9517 | if ((f = 1 << (j = k - w)) > a + 1) | |
9518 | { | |
9519 | ; | |
9520 | f -= a + 1; | |
9521 | xp = c + k; | |
9522 | if (j < z) | |
9523 | while (++j < z) | |
9524 | { | |
9525 | if ((f <<= 1) <= *++xp) | |
9526 | break; | |
9527 | f -= *xp; | |
9528 | } | |
9529 | } | |
9530 | ; | |
9531 | z = 1 << j; | |
9532 | ||
9533 | ||
9534 | if ((q = (struct huft *)malloc((z + 1)*sizeof(struct huft))) == | |
9535 | (struct huft *)((void *)0)) | |
9536 | { | |
9537 | if (h) | |
9538 | huft_free(u[0]); | |
9539 | ret = 3; | |
9540 | goto out; | |
9541 | } | |
9542 | ; | |
9543 | hufts += z + 1; | |
9544 | *t = q + 1; | |
9545 | *(t = &(q->v.t)) = (struct huft *)((void *)0); | |
9546 | u[h] = ++q; | |
9547 | ||
9548 | ; | |
9549 | ||
9550 | if (h) | |
9551 | { | |
9552 | x[h] = i; | |
9553 | r.b = (uch)l; | |
9554 | r.e = (uch)(16 + j); | |
9555 | r.v.t = q; | |
9556 | j = i >> (w - l); | |
9557 | u[h-1][j] = r; | |
9558 | } | |
9559 | ; | |
9560 | } | |
9561 | ; | |
9562 | ||
9563 | ||
9564 | r.b = (uch)(k - w); | |
9565 | if (p >= v + n) | |
9566 | r.e = 99; | |
9567 | else if (*p < s) | |
9568 | { | |
9569 | r.e = (uch)(*p < 256 ? 16 : 15); | |
9570 | r.v.n = (ush)(*p); | |
9571 | p++; | |
9572 | } | |
9573 | else | |
9574 | { | |
9575 | r.e = (uch)e[*p - s]; | |
9576 | r.v.n = d[*p++ - s]; | |
9577 | } | |
9578 | ; | |
9579 | ||
9580 | ||
9581 | f = 1 << (k - w); | |
9582 | for (j = i >> w; j < z; j += f) | |
9583 | q[j] = r; | |
9584 | ||
9585 | ||
9586 | for (j = 1 << (k - 1); i & j; j >>= 1) | |
9587 | i ^= j; | |
9588 | i ^= j; | |
9589 | ||
9590 | ||
9591 | while ((i & ((1 << w) - 1)) != x[h]) | |
9592 | { | |
9593 | h--; | |
9594 | w -= l; | |
9595 | } | |
9596 | ; | |
9597 | } | |
9598 | ; | |
9599 | } | |
9600 | ||
9601 | ; | |
9602 | ||
9603 | ||
9604 | ret = y != 0 && g != 1; | |
9605 | ||
9606 | out: | |
9607 | free(stk); | |
9608 | return ret; | |
9609 | } | |
9610 | ||
9611 | ||
9612 | ||
9613 | static int __attribute__ ((__section__ (".init.text"))) huft_free( | |
9614 | struct huft *t | |
9615 | ) | |
9616 | ||
9617 | ||
9618 | ||
9619 | { | |
9620 | register struct huft *p, *q; | |
9621 | ||
9622 | ||
9623 | ||
9624 | p = t; | |
9625 | while (p != (struct huft *)((void *)0)) | |
9626 | { | |
9627 | q = (--p)->v.t; | |
9628 | free((char*)p); | |
9629 | p = q; | |
9630 | } | |
9631 | return 0; | |
9632 | } | |
9633 | ||
9634 | ||
9635 | static int __attribute__ ((__section__ (".init.text"))) inflate_codes( | |
9636 | struct huft *tl, | |
9637 | struct huft *td, | |
9638 | int bl, | |
9639 | int bd | |
9640 | ) | |
9641 | ||
9642 | ||
9643 | { | |
9644 | register unsigned e; | |
9645 | unsigned n, d; | |
9646 | unsigned w; | |
9647 | struct huft *t; | |
9648 | unsigned ml, md; | |
9649 | register ulg b; | |
9650 | register unsigned k; | |
9651 | ||
9652 | ||
9653 | ||
9654 | b = bb; | |
9655 | k = bk; | |
9656 | w = outcnt; | |
9657 | ||
9658 | ||
9659 | ml = mask_bits[bl]; | |
9660 | md = mask_bits[bd]; | |
9661 | for (;;) | |
9662 | { | |
9663 | {while(k<((unsigned)bl)){b|=((ulg)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }))<<k;k+=8;}} | |
9664 | if ((e = (t = tl + ((unsigned)b & ml))->e) > 16) | |
9665 | do { | |
9666 | if (e == 99) | |
9667 | return 1; | |
9668 | {b>>=(t->b);k-=(t->b);} | |
9669 | e -= 16; | |
9670 | {while(k<(e)){b|=((ulg)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }))<<k;k+=8;}} | |
9671 | } while ((e = (t = t->v.t + ((unsigned)b & mask_bits[e]))->e) > 16); | |
9672 | {b>>=(t->b);k-=(t->b);} | |
9673 | if (e == 16) | |
9674 | { | |
9675 | window[w++] = (uch)t->v.n; | |
9676 | ; | |
9677 | if (w == 0x8000) | |
9678 | { | |
9679 | (outcnt=(w),flush_window()); | |
9680 | w = 0; | |
9681 | } | |
9682 | } | |
9683 | else | |
9684 | { | |
9685 | ||
9686 | if (e == 15) | |
9687 | break; | |
9688 | ||
9689 | ||
9690 | {while(k<(e)){b|=((ulg)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }))<<k;k+=8;}} | |
9691 | n = t->v.n + ((unsigned)b & mask_bits[e]); | |
9692 | {b>>=(e);k-=(e);}; | |
9693 | ||
9694 | ||
9695 | {while(k<((unsigned)bd)){b|=((ulg)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }))<<k;k+=8;}} | |
9696 | if ((e = (t = td + ((unsigned)b & md))->e) > 16) | |
9697 | do { | |
9698 | if (e == 99) | |
9699 | return 1; | |
9700 | {b>>=(t->b);k-=(t->b);} | |
9701 | e -= 16; | |
9702 | {while(k<(e)){b|=((ulg)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }))<<k;k+=8;}} | |
9703 | } while ((e = (t = t->v.t + ((unsigned)b & mask_bits[e]))->e) > 16); | |
9704 | {b>>=(t->b);k-=(t->b);} | |
9705 | {while(k<(e)){b|=((ulg)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }))<<k;k+=8;}} | |
9706 | d = w - t->v.n - ((unsigned)b & mask_bits[e]); | |
9707 | {b>>=(e);k-=(e);} | |
9708 | ; | |
9709 | ||
9710 | ||
9711 | do { | |
9712 | n -= (e = (e = 0x8000 - ((d &= 0x8000 -1) > w ? d : w)) > n ? n : e); | |
9713 | ||
9714 | if (w - d >= e) | |
9715 | { | |
9716 | memcpy(window + w, window + d, e); | |
9717 | w += e; | |
9718 | d += e; | |
9719 | } | |
9720 | else | |
9721 | ||
9722 | do { | |
9723 | window[w++] = window[d++]; | |
9724 | ; | |
9725 | } while (--e); | |
9726 | if (w == 0x8000) | |
9727 | { | |
9728 | (outcnt=(w),flush_window()); | |
9729 | w = 0; | |
9730 | } | |
9731 | } while (n); | |
9732 | } | |
9733 | } | |
9734 | ||
9735 | ||
9736 | ||
9737 | outcnt = w; | |
9738 | bb = b; | |
9739 | bk = k; | |
9740 | ||
9741 | ||
9742 | return 0; | |
9743 | ||
9744 | underrun: | |
9745 | return 4; | |
9746 | } | |
9747 | ||
9748 | ||
9749 | ||
9750 | static int __attribute__ ((__section__ (".init.text"))) inflate_stored(void) | |
9751 | ||
9752 | { | |
9753 | unsigned n; | |
9754 | unsigned w; | |
9755 | register ulg b; | |
9756 | register unsigned k; | |
9757 | ||
9758 | ; | |
9759 | ||
9760 | ||
9761 | b = bb; | |
9762 | k = bk; | |
9763 | w = outcnt; | |
9764 | ||
9765 | ||
9766 | ||
9767 | n = k & 7; | |
9768 | {b>>=(n);k-=(n);}; | |
9769 | ||
9770 | ||
9771 | ||
9772 | {while(k<(16)){b|=((ulg)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }))<<k;k+=8;}} | |
9773 | n = ((unsigned)b & 0xffff); | |
9774 | {b>>=(16);k-=(16);} | |
9775 | {while(k<(16)){b|=((ulg)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }))<<k;k+=8;}} | |
9776 | if (n != (unsigned)((~b) & 0xffff)) | |
9777 | return 1; | |
9778 | {b>>=(16);k-=(16);} | |
9779 | ||
9780 | ||
9781 | ||
9782 | while (n--) | |
9783 | { | |
9784 | {while(k<(8)){b|=((ulg)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }))<<k;k+=8;}} | |
9785 | window[w++] = (uch)b; | |
9786 | if (w == 0x8000) | |
9787 | { | |
9788 | (outcnt=(w),flush_window()); | |
9789 | w = 0; | |
9790 | } | |
9791 | {b>>=(8);k-=(8);} | |
9792 | } | |
9793 | ||
9794 | ||
9795 | ||
9796 | outcnt = w; | |
9797 | bb = b; | |
9798 | bk = k; | |
9799 | ||
9800 | ; | |
9801 | return 0; | |
9802 | ||
9803 | underrun: | |
9804 | return 4; | |
9805 | } | |
9806 | ||
9807 | ||
9808 | ||
9809 | ||
9810 | ||
9811 | static int __attribute__((noinline)) __attribute__ ((__section__ (".init.text"))) inflate_fixed(void) | |
9812 | ||
9813 | ||
9814 | ||
9815 | { | |
9816 | int i; | |
9817 | struct huft *tl; | |
9818 | struct huft *td; | |
9819 | int bl; | |
9820 | int bd; | |
9821 | unsigned *l; | |
9822 | ||
9823 | ; | |
9824 | ||
9825 | l = malloc(sizeof(*l) * 288); | |
9826 | if (l == ((void *)0)) | |
9827 | return 3; | |
9828 | ||
9829 | ||
9830 | for (i = 0; i < 144; i++) | |
9831 | l[i] = 8; | |
9832 | for (; i < 256; i++) | |
9833 | l[i] = 9; | |
9834 | for (; i < 280; i++) | |
9835 | l[i] = 7; | |
9836 | for (; i < 288; i++) | |
9837 | l[i] = 8; | |
9838 | bl = 7; | |
9839 | if ((i = huft_build(l, 288, 257, cplens, cplext, &tl, &bl)) != 0) { | |
9840 | free(l); | |
9841 | return i; | |
9842 | } | |
9843 | ||
9844 | ||
9845 | for (i = 0; i < 30; i++) | |
9846 | l[i] = 5; | |
9847 | bd = 5; | |
9848 | if ((i = huft_build(l, 30, 0, cpdist, cpdext, &td, &bd)) > 1) | |
9849 | { | |
9850 | huft_free(tl); | |
9851 | free(l); | |
9852 | ||
9853 | ; | |
9854 | return i; | |
9855 | } | |
9856 | ||
9857 | ||
9858 | ||
9859 | if (inflate_codes(tl, td, bl, bd)) { | |
9860 | free(l); | |
9861 | return 1; | |
9862 | } | |
9863 | ||
9864 | ||
9865 | free(l); | |
9866 | huft_free(tl); | |
9867 | huft_free(td); | |
9868 | return 0; | |
9869 | } | |
9870 | ||
9871 | ||
9872 | ||
9873 | ||
9874 | ||
9875 | static int __attribute__((noinline)) __attribute__ ((__section__ (".init.text"))) inflate_dynamic(void) | |
9876 | ||
9877 | { | |
9878 | int i; | |
9879 | unsigned j; | |
9880 | unsigned l; | |
9881 | unsigned m; | |
9882 | unsigned n; | |
9883 | struct huft *tl; | |
9884 | struct huft *td; | |
9885 | int bl; | |
9886 | int bd; | |
9887 | unsigned nb; | |
9888 | unsigned nl; | |
9889 | unsigned nd; | |
9890 | unsigned *ll; | |
9891 | register ulg b; | |
9892 | register unsigned k; | |
9893 | int ret; | |
9894 | ||
9895 | ; | |
9896 | ||
9897 | ||
9898 | ||
9899 | ||
9900 | ll = malloc(sizeof(*ll) * (286+30)); | |
9901 | ||
9902 | ||
9903 | ||
9904 | b = bb; | |
9905 | k = bk; | |
9906 | ||
9907 | ||
9908 | ||
9909 | {while(k<(5)){b|=((ulg)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }))<<k;k+=8;}} | |
9910 | nl = 257 + ((unsigned)b & 0x1f); | |
9911 | {b>>=(5);k-=(5);} | |
9912 | {while(k<(5)){b|=((ulg)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }))<<k;k+=8;}} | |
9913 | nd = 1 + ((unsigned)b & 0x1f); | |
9914 | {b>>=(5);k-=(5);} | |
9915 | {while(k<(4)){b|=((ulg)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }))<<k;k+=8;}} | |
9916 | nb = 4 + ((unsigned)b & 0xf); | |
9917 | {b>>=(4);k-=(4);} | |
9918 | ||
9919 | ||
9920 | ||
9921 | if (nl > 286 || nd > 30) | |
9922 | ||
9923 | { | |
9924 | ret = 1; | |
9925 | goto out; | |
9926 | } | |
9927 | ||
9928 | ; | |
9929 | ||
9930 | ||
9931 | for (j = 0; j < nb; j++) | |
9932 | { | |
9933 | {while(k<(3)){b|=((ulg)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }))<<k;k+=8;}} | |
9934 | ll[border[j]] = (unsigned)b & 7; | |
9935 | {b>>=(3);k-=(3);} | |
9936 | } | |
9937 | for (; j < 19; j++) | |
9938 | ll[border[j]] = 0; | |
9939 | ||
9940 | ; | |
9941 | ||
9942 | ||
9943 | bl = 7; | |
9944 | if ((i = huft_build(ll, 19, 19, ((void *)0), ((void *)0), &tl, &bl)) != 0) | |
9945 | { | |
9946 | if (i == 1) | |
9947 | huft_free(tl); | |
9948 | ret = i; | |
9949 | goto out; | |
9950 | } | |
9951 | ||
9952 | ; | |
9953 | ||
9954 | ||
9955 | n = nl + nd; | |
9956 | m = mask_bits[bl]; | |
9957 | i = l = 0; | |
9958 | while ((unsigned)i < n) | |
9959 | { | |
9960 | {while(k<((unsigned)bl)){b|=((ulg)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }))<<k;k+=8;}} | |
9961 | j = (td = tl + ((unsigned)b & m))->b; | |
9962 | {b>>=(j);k-=(j);} | |
9963 | j = td->v.n; | |
9964 | if (j < 16) | |
9965 | ll[i++] = l = j; | |
9966 | else if (j == 16) | |
9967 | { | |
9968 | {while(k<(2)){b|=((ulg)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }))<<k;k+=8;}} | |
9969 | j = 3 + ((unsigned)b & 3); | |
9970 | {b>>=(2);k-=(2);} | |
9971 | if ((unsigned)i + j > n) { | |
9972 | ret = 1; | |
9973 | goto out; | |
9974 | } | |
9975 | while (j--) | |
9976 | ll[i++] = l; | |
9977 | } | |
9978 | else if (j == 17) | |
9979 | { | |
9980 | {while(k<(3)){b|=((ulg)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }))<<k;k+=8;}} | |
9981 | j = 3 + ((unsigned)b & 7); | |
9982 | {b>>=(3);k-=(3);} | |
9983 | if ((unsigned)i + j > n) { | |
9984 | ret = 1; | |
9985 | goto out; | |
9986 | } | |
9987 | while (j--) | |
9988 | ll[i++] = 0; | |
9989 | l = 0; | |
9990 | } | |
9991 | else | |
9992 | { | |
9993 | {while(k<(7)){b|=((ulg)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }))<<k;k+=8;}} | |
9994 | j = 11 + ((unsigned)b & 0x7f); | |
9995 | {b>>=(7);k-=(7);} | |
9996 | if ((unsigned)i + j > n) { | |
9997 | ret = 1; | |
9998 | goto out; | |
9999 | } | |
10000 | while (j--) | |
10001 | ll[i++] = 0; | |
10002 | l = 0; | |
10003 | } | |
10004 | } | |
10005 | ||
10006 | ; | |
10007 | ||
10008 | ||
10009 | huft_free(tl); | |
10010 | ||
10011 | ; | |
10012 | ||
10013 | ||
10014 | bb = b; | |
10015 | bk = k; | |
10016 | ||
10017 | ; | |
10018 | ||
10019 | ||
10020 | bl = lbits; | |
10021 | if ((i = huft_build(ll, nl, 257, cplens, cplext, &tl, &bl)) != 0) | |
10022 | { | |
10023 | ; | |
10024 | if (i == 1) { | |
10025 | error("incomplete literal tree"); | |
10026 | huft_free(tl); | |
10027 | } | |
10028 | ret = i; | |
10029 | goto out; | |
10030 | } | |
10031 | ; | |
10032 | bd = dbits; | |
10033 | if ((i = huft_build(ll + nl, nd, 0, cpdist, cpdext, &td, &bd)) != 0) | |
10034 | { | |
10035 | ; | |
10036 | if (i == 1) { | |
10037 | error("incomplete distance tree"); | |
10038 | ||
10039 | ||
10040 | ||
10041 | ||
10042 | huft_free(td); | |
10043 | } | |
10044 | huft_free(tl); | |
10045 | ret = i; | |
10046 | goto out; | |
10047 | ||
10048 | } | |
10049 | ||
10050 | ; | |
10051 | ||
10052 | ||
10053 | if (inflate_codes(tl, td, bl, bd)) { | |
10054 | ret = 1; | |
10055 | goto out; | |
10056 | } | |
10057 | ||
10058 | ; | |
10059 | ||
10060 | ||
10061 | huft_free(tl); | |
10062 | huft_free(td); | |
10063 | ||
10064 | ; | |
10065 | ret = 0; | |
10066 | out: | |
10067 | free(ll); | |
10068 | return ret; | |
10069 | ||
10070 | underrun: | |
10071 | ret = 4; | |
10072 | goto out; | |
10073 | } | |
10074 | ||
10075 | ||
10076 | ||
10077 | static int __attribute__ ((__section__ (".init.text"))) inflate_block( | |
10078 | int *e | |
10079 | ) | |
10080 | ||
10081 | { | |
10082 | unsigned t; | |
10083 | register ulg b; | |
10084 | register unsigned k; | |
10085 | ||
10086 | ; | |
10087 | ||
10088 | ||
10089 | b = bb; | |
10090 | k = bk; | |
10091 | ||
10092 | ||
10093 | ||
10094 | {while(k<(1)){b|=((ulg)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }))<<k;k+=8;}} | |
10095 | *e = (int)b & 1; | |
10096 | {b>>=(1);k-=(1);} | |
10097 | ||
10098 | ||
10099 | ||
10100 | {while(k<(2)){b|=((ulg)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }))<<k;k+=8;}} | |
10101 | t = (unsigned)b & 3; | |
10102 | {b>>=(2);k-=(2);} | |
10103 | ||
10104 | ||
10105 | ||
10106 | bb = b; | |
10107 | bk = k; | |
10108 | ||
10109 | ||
10110 | if (t == 2) | |
10111 | return inflate_dynamic(); | |
10112 | if (t == 0) | |
10113 | return inflate_stored(); | |
10114 | if (t == 1) | |
10115 | return inflate_fixed(); | |
10116 | ||
10117 | ; | |
10118 | ||
10119 | ||
10120 | return 2; | |
10121 | ||
10122 | underrun: | |
10123 | return 4; | |
10124 | } | |
10125 | ||
10126 | ||
10127 | ||
10128 | static int __attribute__ ((__section__ (".init.text"))) inflate(void) | |
10129 | ||
10130 | { | |
10131 | int e; | |
10132 | int r; | |
10133 | unsigned h; | |
10134 | void *ptr; | |
10135 | ||
10136 | ||
10137 | outcnt = 0; | |
10138 | bk = 0; | |
10139 | bb = 0; | |
10140 | ||
10141 | ||
10142 | ||
10143 | h = 0; | |
10144 | do { | |
10145 | hufts = 0; | |
10146 | gzip_mark(&ptr); | |
10147 | if ((r = inflate_block(&e)) != 0) { | |
10148 | gzip_release(&ptr); | |
10149 | return r; | |
10150 | } | |
10151 | gzip_release(&ptr); | |
10152 | if (hufts > h) | |
10153 | h = hufts; | |
10154 | } while (!e); | |
10155 | ||
10156 | ||
10157 | ||
10158 | ||
10159 | while (bk >= 8) { | |
10160 | bk -= 8; | |
10161 | inptr--; | |
10162 | } | |
10163 | ||
10164 | ||
10165 | (outcnt=(outcnt),flush_window()); | |
10166 | ||
10167 | ||
10168 | ||
10169 | ||
10170 | ||
10171 | ||
10172 | return 0; | |
10173 | } | |
10174 | ||
10175 | ||
10176 | ||
10177 | ||
10178 | ||
10179 | ||
10180 | ||
10181 | static ulg crc_32_tab[256]; | |
10182 | static ulg crc; | |
10183 | ||
10184 | ||
10185 | ||
10186 | ||
10187 | ||
10188 | ||
10189 | ||
10190 | static void __attribute__ ((__section__ (".init.text"))) | |
10191 | makecrc(void) | |
10192 | { | |
10193 | ||
10194 | ||
10195 | unsigned long c; | |
10196 | unsigned long e; | |
10197 | int i; | |
10198 | int k; | |
10199 | ||
10200 | ||
10201 | static const int p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; | |
10202 | ||
10203 | ||
10204 | e = 0; | |
10205 | for (i = 0; i < sizeof(p)/sizeof(int); i++) | |
10206 | e |= 1L << (31 - p[i]); | |
10207 | ||
10208 | crc_32_tab[0] = 0; | |
10209 | ||
10210 | for (i = 1; i < 256; i++) | |
10211 | { | |
10212 | c = 0; | |
10213 | for (k = i | 256; k != 1; k >>= 1) | |
10214 | { | |
10215 | c = c & 1 ? (c >> 1) ^ e : c >> 1; | |
10216 | if (k & 1) | |
10217 | c ^= e; | |
10218 | } | |
10219 | crc_32_tab[i] = c; | |
10220 | } | |
10221 | ||
10222 | ||
10223 | crc = (ulg)0xffffffffUL; | |
10224 | } | |
10225 | # 1149 "init/../lib/inflate.c" | |
10226 | static int __attribute__ ((__section__ (".init.text"))) gunzip(void) | |
10227 | { | |
10228 | uch flags; | |
10229 | unsigned char magic[2]; | |
10230 | char method; | |
10231 | ulg orig_crc = 0; | |
10232 | ulg orig_len = 0; | |
10233 | int res; | |
10234 | ||
10235 | magic[0] = ({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }); | |
10236 | magic[1] = ({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }); | |
10237 | method = ({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }); | |
10238 | ||
10239 | if (magic[0] != 037 || | |
10240 | ((magic[1] != 0213) && (magic[1] != 0236))) { | |
10241 | error("bad gzip magic numbers"); | |
10242 | return -1; | |
10243 | } | |
10244 | ||
10245 | ||
10246 | if (method != 8) { | |
10247 | error("internal error, invalid method"); | |
10248 | return -1; | |
10249 | } | |
10250 | ||
10251 | flags = (uch)(inptr < insize ? inbuf[inptr++] : -1); | |
10252 | if ((flags & 0x20) != 0) { | |
10253 | error("Input is encrypted"); | |
10254 | return -1; | |
10255 | } | |
10256 | if ((flags & 0x02) != 0) { | |
10257 | error("Multi part input"); | |
10258 | return -1; | |
10259 | } | |
10260 | if ((flags & 0xC0) != 0) { | |
10261 | error("Input has invalid flags"); | |
10262 | return -1; | |
10263 | } | |
10264 | ({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }); | |
10265 | ({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }); | |
10266 | ({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }); | |
10267 | ({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }); | |
10268 | ||
10269 | (void)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }); | |
10270 | (void)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }); | |
10271 | ||
10272 | if ((flags & 0x04) != 0) { | |
10273 | unsigned len = (unsigned)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }); | |
10274 | len |= ((unsigned)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }))<<8; | |
10275 | while (len--) (void)({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }); | |
10276 | } | |
10277 | ||
10278 | ||
10279 | if ((flags & 0x08) != 0) { | |
10280 | ||
10281 | while (({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }) != 0) ; | |
10282 | } | |
10283 | ||
10284 | ||
10285 | if ((flags & 0x10) != 0) { | |
10286 | while (({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }) != 0) ; | |
10287 | } | |
10288 | ||
10289 | ||
10290 | if ((res = inflate())) { | |
10291 | switch (res) { | |
10292 | case 0: | |
10293 | break; | |
10294 | case 1: | |
10295 | error("invalid compressed format (err=1)"); | |
10296 | break; | |
10297 | case 2: | |
10298 | error("invalid compressed format (err=2)"); | |
10299 | break; | |
10300 | case 3: | |
10301 | error("out of memory"); | |
10302 | break; | |
10303 | case 4: | |
10304 | error("out of input data"); | |
10305 | break; | |
10306 | default: | |
10307 | error("invalid compressed format (other)"); | |
10308 | } | |
10309 | return -1; | |
10310 | } | |
10311 | ||
10312 | ||
10313 | ||
10314 | ||
10315 | ||
10316 | orig_crc = (ulg) ({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }); | |
10317 | orig_crc |= (ulg) ({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }) << 8; | |
10318 | orig_crc |= (ulg) ({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }) << 16; | |
10319 | orig_crc |= (ulg) ({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }) << 24; | |
10320 | ||
10321 | orig_len = (ulg) ({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }); | |
10322 | orig_len |= (ulg) ({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }) << 8; | |
10323 | orig_len |= (ulg) ({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }) << 16; | |
10324 | orig_len |= (ulg) ({ int v = (inptr < insize ? inbuf[inptr++] : -1); if (v < 0) goto underrun; (uch)v; }) << 24; | |
10325 | ||
10326 | ||
10327 | if (orig_crc != (crc ^ 0xffffffffUL)) { | |
10328 | error("crc error"); | |
10329 | return -1; | |
10330 | } | |
10331 | if (orig_len != bytes_out) { | |
10332 | error("length error"); | |
10333 | return -1; | |
10334 | } | |
10335 | return 0; | |
10336 | ||
10337 | underrun: | |
10338 | error("out of input data"); | |
10339 | return -1; | |
10340 | } | |
10341 | # 414 "init/initramfs.c" 2 | |
10342 | ||
10343 | static void __attribute__ ((__section__ (".init.text"))) gzip_mark(void **ptr) | |
10344 | { | |
10345 | } | |
10346 | ||
10347 | static void __attribute__ ((__section__ (".init.text"))) gzip_release(void **ptr) | |
10348 | { | |
10349 | } | |
10350 | ||
10351 | ||
10352 | ||
10353 | ||
10354 | ||
10355 | static void __attribute__ ((__section__ (".init.text"))) flush_window(void) | |
10356 | { | |
10357 | ulg c = crc; | |
10358 | unsigned n; | |
10359 | uch *in, ch; | |
10360 | ||
10361 | flush_buffer(window, outcnt); | |
10362 | in = window; | |
10363 | for (n = 0; n < outcnt; n++) { | |
10364 | ch = *in++; | |
10365 | c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8); | |
10366 | } | |
10367 | crc = c; | |
10368 | bytes_out += (ulg)outcnt; | |
10369 | outcnt = 0; | |
10370 | } | |
10371 | ||
10372 | static char * __attribute__ ((__section__ (".init.text"))) unpack_to_rootfs(char *buf, unsigned len, int check_only) | |
10373 | { | |
10374 | int written; | |
10375 | dry_run = check_only; | |
10376 | header_buf = malloc(110); | |
10377 | symlink_buf = malloc(4096 + ((((4096) + 1) & ~3) + 2) + 1); | |
10378 | name_buf = malloc(((((4096) + 1) & ~3) + 2)); | |
10379 | window = malloc(0x8000); | |
10380 | if (!window || !header_buf || !symlink_buf || !name_buf) | |
10381 | panic("can't allocate buffers"); | |
10382 | state = Start; | |
10383 | this_header = 0; | |
10384 | message = ((void *)0); | |
10385 | while (!message && len) { | |
10386 | loff_t saved_offset = this_header; | |
10387 | if (*buf == '0' && !(this_header & 3)) { | |
10388 | state = Start; | |
10389 | written = write_buffer(buf, len); | |
10390 | buf += written; | |
10391 | len -= written; | |
10392 | continue; | |
10393 | } | |
10394 | if (!*buf) { | |
10395 | buf++; | |
10396 | len--; | |
10397 | this_header++; | |
10398 | continue; | |
10399 | } | |
10400 | this_header = 0; | |
10401 | insize = len; | |
10402 | inbuf = buf; | |
10403 | inptr = 0; | |
10404 | outcnt = 0; | |
10405 | bytes_out = 0; | |
10406 | crc = (ulg)0xffffffffL; | |
10407 | makecrc(); | |
10408 | gunzip(); | |
10409 | if (state != Reset) | |
10410 | error("junk in gzipped archive"); | |
10411 | this_header = saved_offset + inptr; | |
10412 | buf += inptr; | |
10413 | len -= inptr; | |
10414 | } | |
10415 | free(window); | |
10416 | free(name_buf); | |
10417 | free(symlink_buf); | |
10418 | free(header_buf); | |
10419 | return message; | |
10420 | } | |
10421 | ||
10422 | static int __attribute__ ((__section__ (".init.data"))) do_retain_initrd; | |
10423 | ||
10424 | static int __attribute__ ((__section__ (".init.text"))) retain_initrd_param(char *str) | |
10425 | { | |
10426 | if (*str) | |
10427 | return 0; | |
10428 | do_retain_initrd = 1; | |
10429 | return 1; | |
10430 | } | |
10431 | static char __setup_str_retain_initrd_param[] __attribute__ ((__section__ (".init.data"))) = "retain_initrd"; static struct obs_kernel_param __setup_retain_initrd_param __attribute__((__used__)) __attribute__((__section__(".init.setup"))) __attribute__((aligned((sizeof(long))))) = { __setup_str_retain_initrd_param, retain_initrd_param, 0 }; | |
10432 | ||
10433 | extern char __initramfs_start[], __initramfs_end[]; | |
10434 | ||
10435 | # 1 "include/linux/initrd.h" 1 | |
10436 | ||
10437 | ||
10438 | ||
10439 | ||
10440 | extern int rd_doload; | |
10441 | ||
10442 | ||
10443 | extern int rd_prompt; | |
10444 | ||
10445 | ||
10446 | extern int rd_image_start; | |
10447 | ||
10448 | ||
10449 | extern int initrd_below_start_ok; | |
10450 | ||
10451 | ||
10452 | extern unsigned long initrd_start, initrd_end; | |
10453 | extern void free_initrd_mem(unsigned long, unsigned long); | |
10454 | ||
10455 | extern unsigned int real_root_dev; | |
10456 | # 508 "init/initramfs.c" 2 | |
10457 | # 1 "include/linux/kexec.h" 1 | |
10458 | # 159 "include/linux/kexec.h" | |
10459 | struct pt_regs; | |
10460 | struct task_struct; | |
10461 | static inline __attribute__((always_inline)) void crash_kexec(struct pt_regs *regs) { } | |
10462 | static inline __attribute__((always_inline)) int kexec_should_crash(struct task_struct *p) { return 0; } | |
10463 | # 509 "init/initramfs.c" 2 | |
10464 | ||
10465 | static void __attribute__ ((__section__ (".init.text"))) free_initrd(void) | |
10466 | { | |
10467 | ||
10468 | ||
10469 | ||
10470 | ||
10471 | if (do_retain_initrd) | |
10472 | goto skip; | |
10473 | # 536 "init/initramfs.c" | |
10474 | free_initrd_mem(initrd_start, initrd_end); | |
10475 | skip: | |
10476 | initrd_start = 0; | |
10477 | initrd_end = 0; | |
10478 | } | |
10479 | ||
10480 | ||
10481 | ||
10482 | static int __attribute__ ((__section__ (".init.text"))) populate_rootfs(void) | |
10483 | { | |
10484 | char *err = unpack_to_rootfs(__initramfs_start, | |
10485 | __initramfs_end - __initramfs_start, 0); | |
10486 | if (err) | |
10487 | panic(err); | |
10488 | ||
10489 | if (initrd_start) { | |
10490 | ||
10491 | int fd; | |
10492 | printk("<6>" "checking if image is initramfs..."); | |
10493 | err = unpack_to_rootfs((char *)initrd_start, | |
10494 | initrd_end - initrd_start, 1); | |
10495 | if (!err) { | |
10496 | printk(" it is\n"); | |
10497 | unpack_to_rootfs((char *)initrd_start, | |
10498 | initrd_end - initrd_start, 0); | |
10499 | free_initrd(); | |
10500 | return 0; | |
10501 | } | |
10502 | printk("it isn't (%s); looks like an initrd\n", err); | |
10503 | fd = sys_open("/initrd.image", 00000001|00000100, 0700); | |
10504 | if (fd >= 0) { | |
10505 | sys_write(fd, (char *)initrd_start, | |
10506 | initrd_end - initrd_start); | |
10507 | sys_close(fd); | |
10508 | free_initrd(); | |
10509 | } | |
10510 | # 581 "init/initramfs.c" | |
10511 | } | |
10512 | ||
10513 | return 0; | |
10514 | } | |
10515 | static initcall_t __initcall_populate_rootfsrootfs __attribute__((__used__)) __attribute__((__section__(".initcall" "rootfs" ".init"))) = populate_rootfs; |