1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#ifndef __ASM_AVR32_POSIX_TYPES_H
23#define __ASM_AVR32_POSIX_TYPES_H
24
25
26
27
28
29
30
31typedef unsigned long __kernel_dev_t;
32typedef unsigned long __kernel_ino_t;
33typedef unsigned short __kernel_mode_t;
34typedef unsigned short __kernel_nlink_t;
35typedef long __kernel_off_t;
36typedef int __kernel_pid_t;
37typedef unsigned short __kernel_ipc_pid_t;
38typedef unsigned int __kernel_uid_t;
39typedef unsigned int __kernel_gid_t;
40typedef unsigned long __kernel_size_t;
41typedef int __kernel_ssize_t;
42typedef int __kernel_ptrdiff_t;
43typedef long __kernel_time_t;
44typedef long __kernel_suseconds_t;
45typedef long __kernel_clock_t;
46typedef int __kernel_timer_t;
47typedef int __kernel_clockid_t;
48typedef int __kernel_daddr_t;
49typedef char * __kernel_caddr_t;
50typedef unsigned short __kernel_uid16_t;
51typedef unsigned short __kernel_gid16_t;
52typedef unsigned int __kernel_uid32_t;
53typedef unsigned int __kernel_gid32_t;
54
55typedef unsigned short __kernel_old_uid_t;
56typedef unsigned short __kernel_old_gid_t;
57typedef unsigned short __kernel_old_dev_t;
58
59#ifdef __GNUC__
60typedef long long __kernel_loff_t;
61#endif
62
63typedef struct {
64#if defined(__KERNEL__) || defined(__USE_ALL)
65 int val[2];
66#else
67 int __val[2];
68#endif
69} __kernel_fsid_t;
70
71#if defined(__KERNEL__)
72
73#undef __FD_SET
74static __inline__ void __FD_SET(unsigned long __fd, __kernel_fd_set *__fdsetp)
75{
76 unsigned long __tmp = __fd / __NFDBITS;
77 unsigned long __rem = __fd % __NFDBITS;
78 __fdsetp->fds_bits[__tmp] |= (1UL<<__rem);
79}
80
81#undef __FD_CLR
82static __inline__ void __FD_CLR(unsigned long __fd, __kernel_fd_set *__fdsetp)
83{
84 unsigned long __tmp = __fd / __NFDBITS;
85 unsigned long __rem = __fd % __NFDBITS;
86 __fdsetp->fds_bits[__tmp] &= ~(1UL<<__rem);
87}
88
89
90#undef __FD_ISSET
91static __inline__ int __FD_ISSET(unsigned long __fd, const __kernel_fd_set *__p)
92{
93 unsigned long __tmp = __fd / __NFDBITS;
94 unsigned long __rem = __fd % __NFDBITS;
95 return (__p->fds_bits[__tmp] & (1UL<<__rem)) != 0;
96}
97
98
99
100
101
102#undef __FD_ZERO
103static __inline__ void __FD_ZERO(__kernel_fd_set *__p)
104{
105 unsigned long *__tmp = __p->fds_bits;
106 int __i;
107
108 if (__builtin_constant_p(__FDSET_LONGS)) {
109 switch (__FDSET_LONGS) {
110 case 16:
111 __tmp[ 0] = 0; __tmp[ 1] = 0;
112 __tmp[ 2] = 0; __tmp[ 3] = 0;
113 __tmp[ 4] = 0; __tmp[ 5] = 0;
114 __tmp[ 6] = 0; __tmp[ 7] = 0;
115 __tmp[ 8] = 0; __tmp[ 9] = 0;
116 __tmp[10] = 0; __tmp[11] = 0;
117 __tmp[12] = 0; __tmp[13] = 0;
118 __tmp[14] = 0; __tmp[15] = 0;
119 return;
120
121 case 8:
122 __tmp[ 0] = 0; __tmp[ 1] = 0;
123 __tmp[ 2] = 0; __tmp[ 3] = 0;
124 __tmp[ 4] = 0; __tmp[ 5] = 0;
125 __tmp[ 6] = 0; __tmp[ 7] = 0;
126 return;
127
128 case 4:
129 __tmp[ 0] = 0; __tmp[ 1] = 0;
130 __tmp[ 2] = 0; __tmp[ 3] = 0;
131 return;
132 }
133 }
134 __i = __FDSET_LONGS;
135 while (__i) {
136 __i--;
137 *__tmp = 0;
138 __tmp++;
139 }
140}
141
142#endif
143
144#endif
145