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