root / linux-user / syscall_defs.h @ f40070c3
History | View | Annotate | Download (70.5 kB)
1 | 31e31b8a | bellard | /* common syscall defines for all architectures */
|
---|---|---|---|
2 | 31e31b8a | bellard | |
3 | 2521d698 | bellard | /* Note: although the syscall numbers change between architectures,
|
4 | 2521d698 | bellard | most of them stay the same, so we handle it by puting ifdefs if
|
5 | 2521d698 | bellard | necessary */
|
6 | 2521d698 | bellard | |
7 | 6180a181 | bellard | #include "syscall_nr.h" |
8 | 2521d698 | bellard | |
9 | 31e31b8a | bellard | #define SOCKOP_socket 1 |
10 | 31e31b8a | bellard | #define SOCKOP_bind 2 |
11 | 31e31b8a | bellard | #define SOCKOP_connect 3 |
12 | 31e31b8a | bellard | #define SOCKOP_listen 4 |
13 | 31e31b8a | bellard | #define SOCKOP_accept 5 |
14 | 31e31b8a | bellard | #define SOCKOP_getsockname 6 |
15 | 31e31b8a | bellard | #define SOCKOP_getpeername 7 |
16 | 31e31b8a | bellard | #define SOCKOP_socketpair 8 |
17 | 31e31b8a | bellard | #define SOCKOP_send 9 |
18 | 31e31b8a | bellard | #define SOCKOP_recv 10 |
19 | 31e31b8a | bellard | #define SOCKOP_sendto 11 |
20 | 31e31b8a | bellard | #define SOCKOP_recvfrom 12 |
21 | 31e31b8a | bellard | #define SOCKOP_shutdown 13 |
22 | 31e31b8a | bellard | #define SOCKOP_setsockopt 14 |
23 | 31e31b8a | bellard | #define SOCKOP_getsockopt 15 |
24 | 31e31b8a | bellard | #define SOCKOP_sendmsg 16 |
25 | 31e31b8a | bellard | #define SOCKOP_recvmsg 17 |
26 | 31e31b8a | bellard | |
27 | 8853f86e | bellard | #define IPCOP_semop 1 |
28 | 8853f86e | bellard | #define IPCOP_semget 2 |
29 | 8853f86e | bellard | #define IPCOP_semctl 3 |
30 | 8853f86e | bellard | #define IPCOP_semtimedop 4 |
31 | 8853f86e | bellard | #define IPCOP_msgsnd 11 |
32 | 8853f86e | bellard | #define IPCOP_msgrcv 12 |
33 | 8853f86e | bellard | #define IPCOP_msgget 13 |
34 | 8853f86e | bellard | #define IPCOP_msgctl 14 |
35 | 8853f86e | bellard | #define IPCOP_shmat 21 |
36 | 8853f86e | bellard | #define IPCOP_shmdt 22 |
37 | 8853f86e | bellard | #define IPCOP_shmget 23 |
38 | 8853f86e | bellard | #define IPCOP_shmctl 24 |
39 | 8853f86e | bellard | |
40 | 2521d698 | bellard | /*
|
41 | 2521d698 | bellard | * The following is for compatibility across the various Linux
|
42 | 2521d698 | bellard | * platforms. The i386 ioctl numbering scheme doesn't really enforce
|
43 | 2521d698 | bellard | * a type field. De facto, however, the top 8 bits of the lower 16
|
44 | 2521d698 | bellard | * bits are indeed used as a type field, so we might just as well make
|
45 | 2521d698 | bellard | * this explicit here. Please be sure to use the decoding macros
|
46 | 2521d698 | bellard | * below from now on.
|
47 | 2521d698 | bellard | */
|
48 | 2521d698 | bellard | #define TARGET_IOC_NRBITS 8 |
49 | 2521d698 | bellard | #define TARGET_IOC_TYPEBITS 8 |
50 | 2521d698 | bellard | |
51 | 74d753ac | Mika Westerberg | #if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SPARC) \
|
52 | 74d753ac | Mika Westerberg | || defined(TARGET_M68K) || defined(TARGET_SH4) || defined(TARGET_CRIS) |
53 | 74d753ac | Mika Westerberg | /* 16 bit uid wrappers emulation */
|
54 | 74d753ac | Mika Westerberg | #define USE_UID16
|
55 | 74d753ac | Mika Westerberg | #endif
|
56 | 74d753ac | Mika Westerberg | |
57 | e6e5906b | pbrook | #if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SH4) \
|
58 | dccfec67 | aurel32 | || defined(TARGET_M68K) || defined(TARGET_CRIS) |
59 | 2521d698 | bellard | |
60 | 2521d698 | bellard | #define TARGET_IOC_SIZEBITS 14 |
61 | 2521d698 | bellard | #define TARGET_IOC_DIRBITS 2 |
62 | 2521d698 | bellard | |
63 | 2521d698 | bellard | #define TARGET_IOC_NONE 0U |
64 | 2521d698 | bellard | #define TARGET_IOC_WRITE 1U |
65 | 2521d698 | bellard | #define TARGET_IOC_READ 2U |
66 | 2521d698 | bellard | |
67 | 048f6b4d | bellard | #elif defined(TARGET_PPC) || defined(TARGET_ALPHA) || \
|
68 | b779e29e | Edgar E. Iglesias | defined(TARGET_SPARC) || defined(TARGET_MICROBLAZE) || \ |
69 | b779e29e | Edgar E. Iglesias | defined(TARGET_MIPS) |
70 | 2521d698 | bellard | |
71 | 2521d698 | bellard | #define TARGET_IOC_SIZEBITS 13 |
72 | 2521d698 | bellard | #define TARGET_IOC_DIRBITS 3 |
73 | 2521d698 | bellard | |
74 | 2521d698 | bellard | #define TARGET_IOC_NONE 1U |
75 | 2521d698 | bellard | #define TARGET_IOC_READ 2U |
76 | 2521d698 | bellard | #define TARGET_IOC_WRITE 4U |
77 | 2521d698 | bellard | |
78 | 2521d698 | bellard | #else
|
79 | 2521d698 | bellard | #error unsupported CPU
|
80 | 2521d698 | bellard | #endif
|
81 | 2521d698 | bellard | |
82 | 2521d698 | bellard | #define TARGET_IOC_NRMASK ((1 << TARGET_IOC_NRBITS)-1) |
83 | 2521d698 | bellard | #define TARGET_IOC_TYPEMASK ((1 << TARGET_IOC_TYPEBITS)-1) |
84 | 2521d698 | bellard | #define TARGET_IOC_SIZEMASK ((1 << TARGET_IOC_SIZEBITS)-1) |
85 | 2521d698 | bellard | #define TARGET_IOC_DIRMASK ((1 << TARGET_IOC_DIRBITS)-1) |
86 | 2521d698 | bellard | |
87 | 2521d698 | bellard | #define TARGET_IOC_NRSHIFT 0 |
88 | 2521d698 | bellard | #define TARGET_IOC_TYPESHIFT (TARGET_IOC_NRSHIFT+TARGET_IOC_NRBITS)
|
89 | 2521d698 | bellard | #define TARGET_IOC_SIZESHIFT (TARGET_IOC_TYPESHIFT+TARGET_IOC_TYPEBITS)
|
90 | 2521d698 | bellard | #define TARGET_IOC_DIRSHIFT (TARGET_IOC_SIZESHIFT+TARGET_IOC_SIZEBITS)
|
91 | 2521d698 | bellard | |
92 | 2521d698 | bellard | #define TARGET_IOC(dir,type,nr,size) \
|
93 | 2521d698 | bellard | (((dir) << TARGET_IOC_DIRSHIFT) | \ |
94 | 2521d698 | bellard | ((type) << TARGET_IOC_TYPESHIFT) | \ |
95 | 2521d698 | bellard | ((nr) << TARGET_IOC_NRSHIFT) | \ |
96 | 2521d698 | bellard | ((size) << TARGET_IOC_SIZESHIFT)) |
97 | 2521d698 | bellard | |
98 | 2521d698 | bellard | /* used to create numbers */
|
99 | 2521d698 | bellard | #define TARGET_IO(type,nr) TARGET_IOC(TARGET_IOC_NONE,(type),(nr),0) |
100 | 2521d698 | bellard | #define TARGET_IOR(type,nr,size) TARGET_IOC(TARGET_IOC_READ,(type),(nr),sizeof(size)) |
101 | 2521d698 | bellard | #define TARGET_IOW(type,nr,size) TARGET_IOC(TARGET_IOC_WRITE,(type),(nr),sizeof(size)) |
102 | 2521d698 | bellard | #define TARGET_IOWR(type,nr,size) TARGET_IOC(TARGET_IOC_READ|TARGET_IOC_WRITE,(type),(nr),sizeof(size)) |
103 | 2521d698 | bellard | |
104 | 2521d698 | bellard | /* the size is automatically computed for these defines */
|
105 | 2521d698 | bellard | #define TARGET_IORU(type,nr) TARGET_IOC(TARGET_IOC_READ,(type),(nr),TARGET_IOC_SIZEMASK)
|
106 | 2521d698 | bellard | #define TARGET_IOWU(type,nr) TARGET_IOC(TARGET_IOC_WRITE,(type),(nr),TARGET_IOC_SIZEMASK)
|
107 | 2521d698 | bellard | #define TARGET_IOWRU(type,nr) TARGET_IOC(TARGET_IOC_READ|TARGET_IOC_WRITE,(type),(nr),TARGET_IOC_SIZEMASK)
|
108 | 2521d698 | bellard | |
109 | 7854b056 | bellard | struct target_sockaddr {
|
110 | 7854b056 | bellard | uint16_t sa_family; |
111 | 7854b056 | bellard | uint8_t sa_data[14];
|
112 | 7854b056 | bellard | }; |
113 | 7854b056 | bellard | |
114 | b975b83b | Lionel Landwerlin | struct target_in_addr {
|
115 | b975b83b | Lionel Landwerlin | uint32_t s_addr; /* big endian */
|
116 | b975b83b | Lionel Landwerlin | }; |
117 | b975b83b | Lionel Landwerlin | |
118 | b975b83b | Lionel Landwerlin | struct target_ip_mreq {
|
119 | b975b83b | Lionel Landwerlin | struct target_in_addr imr_multiaddr;
|
120 | b975b83b | Lionel Landwerlin | struct target_in_addr imr_address;
|
121 | b975b83b | Lionel Landwerlin | }; |
122 | b975b83b | Lionel Landwerlin | |
123 | b975b83b | Lionel Landwerlin | struct target_ip_mreqn {
|
124 | b975b83b | Lionel Landwerlin | struct target_in_addr imr_multiaddr;
|
125 | b975b83b | Lionel Landwerlin | struct target_in_addr imr_address;
|
126 | b975b83b | Lionel Landwerlin | abi_long imr_ifindex; |
127 | b975b83b | Lionel Landwerlin | }; |
128 | b975b83b | Lionel Landwerlin | |
129 | 6e3cb58f | Lionel Landwerlin | struct target_ip_mreq_source {
|
130 | 6e3cb58f | Lionel Landwerlin | /* big endian */
|
131 | 6e3cb58f | Lionel Landwerlin | uint32_t imr_multiaddr; |
132 | 6e3cb58f | Lionel Landwerlin | uint32_t imr_interface; |
133 | 6e3cb58f | Lionel Landwerlin | uint32_t imr_sourceaddr; |
134 | 6e3cb58f | Lionel Landwerlin | }; |
135 | 6e3cb58f | Lionel Landwerlin | |
136 | 31e31b8a | bellard | struct target_timeval {
|
137 | 992f48a0 | blueswir1 | abi_long tv_sec; |
138 | 992f48a0 | blueswir1 | abi_long tv_usec; |
139 | 31e31b8a | bellard | }; |
140 | 31e31b8a | bellard | |
141 | 1b6b029e | bellard | struct target_timespec {
|
142 | 992f48a0 | blueswir1 | abi_long tv_sec; |
143 | 992f48a0 | blueswir1 | abi_long tv_nsec; |
144 | 1b6b029e | bellard | }; |
145 | 1b6b029e | bellard | |
146 | 66fb9763 | bellard | struct target_itimerval {
|
147 | 66fb9763 | bellard | struct target_timeval it_interval;
|
148 | 66fb9763 | bellard | struct target_timeval it_value;
|
149 | 66fb9763 | bellard | }; |
150 | 66fb9763 | bellard | |
151 | 992f48a0 | blueswir1 | typedef abi_long target_clock_t;
|
152 | 32f36bce | bellard | |
153 | c596ed17 | bellard | #define TARGET_HZ 100 |
154 | c596ed17 | bellard | |
155 | 32f36bce | bellard | struct target_tms {
|
156 | 32f36bce | bellard | target_clock_t tms_utime; |
157 | 32f36bce | bellard | target_clock_t tms_stime; |
158 | 32f36bce | bellard | target_clock_t tms_cutime; |
159 | 32f36bce | bellard | target_clock_t tms_cstime; |
160 | 32f36bce | bellard | }; |
161 | 32f36bce | bellard | |
162 | 6180a181 | bellard | struct target_utimbuf {
|
163 | 992f48a0 | blueswir1 | abi_long actime; |
164 | 992f48a0 | blueswir1 | abi_long modtime; |
165 | 6180a181 | bellard | }; |
166 | 6180a181 | bellard | |
167 | f2674e31 | bellard | struct target_sel_arg_struct {
|
168 | 992f48a0 | blueswir1 | abi_long n; |
169 | 992f48a0 | blueswir1 | abi_long inp, outp, exp; |
170 | 992f48a0 | blueswir1 | abi_long tvp; |
171 | f2674e31 | bellard | }; |
172 | f2674e31 | bellard | |
173 | 31e31b8a | bellard | struct target_iovec {
|
174 | 992f48a0 | blueswir1 | abi_long iov_base; /* Starting address */
|
175 | 992f48a0 | blueswir1 | abi_long iov_len; /* Number of bytes */
|
176 | 31e31b8a | bellard | }; |
177 | 31e31b8a | bellard | |
178 | 1a9353d2 | bellard | struct target_msghdr {
|
179 | 992f48a0 | blueswir1 | abi_long msg_name; /* Socket name */
|
180 | 992f48a0 | blueswir1 | int msg_namelen; /* Length of name */ |
181 | 992f48a0 | blueswir1 | abi_long msg_iov; /* Data blocks */
|
182 | 992f48a0 | blueswir1 | abi_long msg_iovlen; /* Number of blocks */
|
183 | 992f48a0 | blueswir1 | abi_long msg_control; /* Per protocol magic (eg BSD file descriptor passing) */
|
184 | 992f48a0 | blueswir1 | abi_long msg_controllen; /* Length of cmsg list */
|
185 | 1a9353d2 | bellard | unsigned int msg_flags; |
186 | 1a9353d2 | bellard | }; |
187 | 1a9353d2 | bellard | |
188 | 7854b056 | bellard | struct target_cmsghdr {
|
189 | 992f48a0 | blueswir1 | abi_long cmsg_len; |
190 | 7854b056 | bellard | int cmsg_level;
|
191 | 7854b056 | bellard | int cmsg_type;
|
192 | 7854b056 | bellard | }; |
193 | 7854b056 | bellard | |
194 | 7854b056 | bellard | #define TARGET_CMSG_DATA(cmsg) ((unsigned char *) ((struct target_cmsghdr *) (cmsg) + 1)) |
195 | 7854b056 | bellard | #define TARGET_CMSG_NXTHDR(mhdr, cmsg) __target_cmsg_nxthdr (mhdr, cmsg)
|
196 | 992f48a0 | blueswir1 | #define TARGET_CMSG_ALIGN(len) (((len) + sizeof (abi_long) - 1) \ |
197 | 992f48a0 | blueswir1 | & (size_t) ~(sizeof (abi_long) - 1)) |
198 | 7854b056 | bellard | #define TARGET_CMSG_SPACE(len) (TARGET_CMSG_ALIGN (len) \
|
199 | 7854b056 | bellard | + TARGET_CMSG_ALIGN (sizeof (struct target_cmsghdr))) |
200 | 7854b056 | bellard | #define TARGET_CMSG_LEN(len) (TARGET_CMSG_ALIGN (sizeof (struct target_cmsghdr)) + (len)) |
201 | 7854b056 | bellard | |
202 | 7854b056 | bellard | static __inline__ struct target_cmsghdr * |
203 | 7854b056 | bellard | __target_cmsg_nxthdr (struct target_msghdr *__mhdr, struct target_cmsghdr *__cmsg) |
204 | 7854b056 | bellard | { |
205 | 2b8bdefc | ths | struct target_cmsghdr *__ptr;
|
206 | 2b8bdefc | ths | |
207 | 2b8bdefc | ths | __ptr = (struct target_cmsghdr *)((unsigned char *) __cmsg |
208 | 2b8bdefc | ths | + TARGET_CMSG_ALIGN (tswapl(__cmsg->cmsg_len))); |
209 | 2b8bdefc | ths | if ((unsigned long)((char *)(__ptr+1) - (char *)(size_t)tswapl(__mhdr->msg_control)) |
210 | 2b8bdefc | ths | > tswapl(__mhdr->msg_controllen)) |
211 | 7854b056 | bellard | /* No more entries. */
|
212 | 2b8bdefc | ths | return (struct target_cmsghdr *)0; |
213 | 7854b056 | bellard | return __cmsg;
|
214 | 7854b056 | bellard | } |
215 | 7854b056 | bellard | |
216 | 7854b056 | bellard | |
217 | 31e31b8a | bellard | struct target_rusage {
|
218 | 31e31b8a | bellard | struct target_timeval ru_utime; /* user time used */ |
219 | 31e31b8a | bellard | struct target_timeval ru_stime; /* system time used */ |
220 | 992f48a0 | blueswir1 | abi_long ru_maxrss; /* maximum resident set size */
|
221 | 992f48a0 | blueswir1 | abi_long ru_ixrss; /* integral shared memory size */
|
222 | 992f48a0 | blueswir1 | abi_long ru_idrss; /* integral unshared data size */
|
223 | 992f48a0 | blueswir1 | abi_long ru_isrss; /* integral unshared stack size */
|
224 | 992f48a0 | blueswir1 | abi_long ru_minflt; /* page reclaims */
|
225 | 992f48a0 | blueswir1 | abi_long ru_majflt; /* page faults */
|
226 | 992f48a0 | blueswir1 | abi_long ru_nswap; /* swaps */
|
227 | 992f48a0 | blueswir1 | abi_long ru_inblock; /* block input operations */
|
228 | 992f48a0 | blueswir1 | abi_long ru_oublock; /* block output operations */
|
229 | 992f48a0 | blueswir1 | abi_long ru_msgsnd; /* messages sent */
|
230 | 992f48a0 | blueswir1 | abi_long ru_msgrcv; /* messages received */
|
231 | 992f48a0 | blueswir1 | abi_long ru_nsignals; /* signals received */
|
232 | 992f48a0 | blueswir1 | abi_long ru_nvcsw; /* voluntary context switches */
|
233 | 992f48a0 | blueswir1 | abi_long ru_nivcsw; /* involuntary " */
|
234 | 31e31b8a | bellard | }; |
235 | 31e31b8a | bellard | |
236 | 31e31b8a | bellard | typedef struct { |
237 | 31e31b8a | bellard | int val[2]; |
238 | 31e31b8a | bellard | } kernel_fsid_t; |
239 | 31e31b8a | bellard | |
240 | 72f03900 | bellard | struct kernel_statfs {
|
241 | 31e31b8a | bellard | int f_type;
|
242 | 31e31b8a | bellard | int f_bsize;
|
243 | 31e31b8a | bellard | int f_blocks;
|
244 | 31e31b8a | bellard | int f_bfree;
|
245 | 31e31b8a | bellard | int f_bavail;
|
246 | 31e31b8a | bellard | int f_files;
|
247 | 31e31b8a | bellard | int f_ffree;
|
248 | 31e31b8a | bellard | kernel_fsid_t f_fsid; |
249 | 31e31b8a | bellard | int f_namelen;
|
250 | 31e31b8a | bellard | int f_spare[6]; |
251 | 31e31b8a | bellard | }; |
252 | 31e31b8a | bellard | |
253 | dab2ed99 | bellard | struct target_dirent {
|
254 | 992f48a0 | blueswir1 | abi_long d_ino; |
255 | 992f48a0 | blueswir1 | abi_long d_off; |
256 | dab2ed99 | bellard | unsigned short d_reclen; |
257 | dab2ed99 | bellard | char d_name[256]; /* We must not include limits.h! */ |
258 | dab2ed99 | bellard | }; |
259 | dab2ed99 | bellard | |
260 | dab2ed99 | bellard | struct target_dirent64 {
|
261 | dab2ed99 | bellard | uint64_t d_ino; |
262 | dab2ed99 | bellard | int64_t d_off; |
263 | dab2ed99 | bellard | unsigned short d_reclen; |
264 | dab2ed99 | bellard | unsigned char d_type; |
265 | dab2ed99 | bellard | char d_name[256]; |
266 | dab2ed99 | bellard | }; |
267 | dab2ed99 | bellard | |
268 | dab2ed99 | bellard | |
269 | 31e31b8a | bellard | /* mostly generic signal stuff */
|
270 | 992f48a0 | blueswir1 | #define TARGET_SIG_DFL ((abi_long)0) /* default signal handling */ |
271 | 992f48a0 | blueswir1 | #define TARGET_SIG_IGN ((abi_long)1) /* ignore signal */ |
272 | 992f48a0 | blueswir1 | #define TARGET_SIG_ERR ((abi_long)-1) /* error return from signal */ |
273 | 31e31b8a | bellard | |
274 | 31e31b8a | bellard | #ifdef TARGET_MIPS
|
275 | 31e31b8a | bellard | #define TARGET_NSIG 128 |
276 | 31e31b8a | bellard | #else
|
277 | 31e31b8a | bellard | #define TARGET_NSIG 64 |
278 | 31e31b8a | bellard | #endif
|
279 | 992f48a0 | blueswir1 | #define TARGET_NSIG_BPW TARGET_ABI_BITS
|
280 | 31e31b8a | bellard | #define TARGET_NSIG_WORDS (TARGET_NSIG / TARGET_NSIG_BPW)
|
281 | 31e31b8a | bellard | |
282 | 31e31b8a | bellard | typedef struct { |
283 | 992f48a0 | blueswir1 | abi_ulong sig[TARGET_NSIG_WORDS]; |
284 | 31e31b8a | bellard | } target_sigset_t; |
285 | 31e31b8a | bellard | |
286 | 66fb9763 | bellard | #ifdef BSWAP_NEEDED
|
287 | 66fb9763 | bellard | static inline void tswap_sigset(target_sigset_t *d, const target_sigset_t *s) |
288 | 66fb9763 | bellard | { |
289 | 66fb9763 | bellard | int i;
|
290 | 66fb9763 | bellard | for(i = 0;i < TARGET_NSIG_WORDS; i++) |
291 | 66fb9763 | bellard | d->sig[i] = tswapl(s->sig[i]); |
292 | 66fb9763 | bellard | } |
293 | 66fb9763 | bellard | #else
|
294 | 66fb9763 | bellard | static inline void tswap_sigset(target_sigset_t *d, const target_sigset_t *s) |
295 | 66fb9763 | bellard | { |
296 | 66fb9763 | bellard | *d = *s; |
297 | 66fb9763 | bellard | } |
298 | 66fb9763 | bellard | #endif
|
299 | 66fb9763 | bellard | |
300 | 992f48a0 | blueswir1 | static inline void target_siginitset(target_sigset_t *d, abi_ulong set) |
301 | 66fb9763 | bellard | { |
302 | 66fb9763 | bellard | int i;
|
303 | 66fb9763 | bellard | d->sig[0] = set;
|
304 | 66fb9763 | bellard | for(i = 1;i < TARGET_NSIG_WORDS; i++) |
305 | 66fb9763 | bellard | d->sig[i] = 0;
|
306 | 66fb9763 | bellard | } |
307 | 66fb9763 | bellard | |
308 | c596ed17 | bellard | void host_to_target_sigset(target_sigset_t *d, const sigset_t *s); |
309 | c596ed17 | bellard | void target_to_host_sigset(sigset_t *d, const target_sigset_t *s); |
310 | 992f48a0 | blueswir1 | void host_to_target_old_sigset(abi_ulong *old_sigset,
|
311 | 66fb9763 | bellard | const sigset_t *sigset);
|
312 | 5fafdf24 | ths | void target_to_host_old_sigset(sigset_t *sigset,
|
313 | 992f48a0 | blueswir1 | const abi_ulong *old_sigset);
|
314 | 66fb9763 | bellard | struct target_sigaction;
|
315 | 66fb9763 | bellard | int do_sigaction(int sig, const struct target_sigaction *act, |
316 | 66fb9763 | bellard | struct target_sigaction *oact);
|
317 | 66fb9763 | bellard | |
318 | b779e29e | Edgar E. Iglesias | #if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SPARC) || defined(TARGET_PPC) || defined(TARGET_MIPS) || defined (TARGET_SH4) || defined(TARGET_M68K) || defined(TARGET_ALPHA) || defined(TARGET_CRIS) || defined(TARGET_MICROBLAZE)
|
319 | 2521d698 | bellard | |
320 | 048f6b4d | bellard | #if defined(TARGET_SPARC)
|
321 | 048f6b4d | bellard | #define TARGET_SA_NOCLDSTOP 8u |
322 | 048f6b4d | bellard | #define TARGET_SA_NOCLDWAIT 0x100u |
323 | 048f6b4d | bellard | #define TARGET_SA_SIGINFO 0x200u |
324 | 048f6b4d | bellard | #define TARGET_SA_ONSTACK 1u |
325 | 048f6b4d | bellard | #define TARGET_SA_RESTART 2u |
326 | 048f6b4d | bellard | #define TARGET_SA_NODEFER 0x20u |
327 | 048f6b4d | bellard | #define TARGET_SA_RESETHAND 4u |
328 | 048f6b4d | bellard | #elif defined(TARGET_MIPS)
|
329 | 048f6b4d | bellard | #define TARGET_SA_NOCLDSTOP 0x00000001 |
330 | 048f6b4d | bellard | #define TARGET_SA_NOCLDWAIT 0x00010000 |
331 | 048f6b4d | bellard | #define TARGET_SA_SIGINFO 0x00000008 |
332 | 048f6b4d | bellard | #define TARGET_SA_ONSTACK 0x08000000 |
333 | 048f6b4d | bellard | #define TARGET_SA_NODEFER 0x40000000 |
334 | 048f6b4d | bellard | #define TARGET_SA_RESTART 0x10000000 |
335 | 048f6b4d | bellard | #define TARGET_SA_RESETHAND 0x80000000 |
336 | d26bc211 | ths | #if !defined(TARGET_ABI_MIPSN32) && !defined(TARGET_ABI_MIPSN64)
|
337 | d26bc211 | ths | #define TARGET_SA_RESTORER 0x04000000 /* Only for O32 */ |
338 | 540635ba | ths | #endif
|
339 | 048f6b4d | bellard | #else
|
340 | 2521d698 | bellard | #define TARGET_SA_NOCLDSTOP 0x00000001 |
341 | 2521d698 | bellard | #define TARGET_SA_NOCLDWAIT 0x00000002 /* not supported yet */ |
342 | 2521d698 | bellard | #define TARGET_SA_SIGINFO 0x00000004 |
343 | 2521d698 | bellard | #define TARGET_SA_ONSTACK 0x08000000 |
344 | 2521d698 | bellard | #define TARGET_SA_RESTART 0x10000000 |
345 | 2521d698 | bellard | #define TARGET_SA_NODEFER 0x40000000 |
346 | 2521d698 | bellard | #define TARGET_SA_RESETHAND 0x80000000 |
347 | 2521d698 | bellard | #define TARGET_SA_RESTORER 0x04000000 |
348 | 6d5e216d | bellard | #endif
|
349 | 6d5e216d | bellard | |
350 | 6d5e216d | bellard | #if defined(TARGET_SPARC)
|
351 | 6d5e216d | bellard | |
352 | 6d5e216d | bellard | #define TARGET_SIGHUP 1 |
353 | 6d5e216d | bellard | #define TARGET_SIGINT 2 |
354 | 6d5e216d | bellard | #define TARGET_SIGQUIT 3 |
355 | 6d5e216d | bellard | #define TARGET_SIGILL 4 |
356 | 6d5e216d | bellard | #define TARGET_SIGTRAP 5 |
357 | 6d5e216d | bellard | #define TARGET_SIGABRT 6 |
358 | 6d5e216d | bellard | #define TARGET_SIGIOT 6 |
359 | 6d5e216d | bellard | #define TARGET_SIGSTKFLT 7 /* actually EMT */ |
360 | 6d5e216d | bellard | #define TARGET_SIGFPE 8 |
361 | 6d5e216d | bellard | #define TARGET_SIGKILL 9 |
362 | 6d5e216d | bellard | #define TARGET_SIGBUS 10 |
363 | 6d5e216d | bellard | #define TARGET_SIGSEGV 11 |
364 | 6d5e216d | bellard | #define TARGET_SIGSYS 12 |
365 | 6d5e216d | bellard | #define TARGET_SIGPIPE 13 |
366 | 6d5e216d | bellard | #define TARGET_SIGALRM 14 |
367 | 6d5e216d | bellard | #define TARGET_SIGTERM 15 |
368 | 6d5e216d | bellard | #define TARGET_SIGURG 16 |
369 | 6d5e216d | bellard | #define TARGET_SIGSTOP 17 |
370 | 6d5e216d | bellard | #define TARGET_SIGTSTP 18 |
371 | 6d5e216d | bellard | #define TARGET_SIGCONT 19 |
372 | 6d5e216d | bellard | #define TARGET_SIGCHLD 20 |
373 | 6d5e216d | bellard | #define TARGET_SIGTTIN 21 |
374 | 6d5e216d | bellard | #define TARGET_SIGTTOU 22 |
375 | 6d5e216d | bellard | #define TARGET_SIGIO 23 |
376 | 6d5e216d | bellard | #define TARGET_SIGXCPU 24 |
377 | 6d5e216d | bellard | #define TARGET_SIGXFSZ 25 |
378 | 6d5e216d | bellard | #define TARGET_SIGVTALRM 26 |
379 | 6d5e216d | bellard | #define TARGET_SIGPROF 27 |
380 | 6d5e216d | bellard | #define TARGET_SIGWINCH 28 |
381 | 6d5e216d | bellard | #define TARGET_SIGPWR 29 |
382 | 6d5e216d | bellard | #define TARGET_SIGUSR1 30 |
383 | 6d5e216d | bellard | #define TARGET_SIGUSR2 31 |
384 | 6d5e216d | bellard | #define TARGET_SIGRTMIN 32 |
385 | 6d5e216d | bellard | |
386 | 6d5e216d | bellard | #define TARGET_SIG_BLOCK 0x01 /* for blocking signals */ |
387 | 6d5e216d | bellard | #define TARGET_SIG_UNBLOCK 0x02 /* for unblocking signals */ |
388 | 6d5e216d | bellard | #define TARGET_SIG_SETMASK 0x04 /* for setting the signal mask */ |
389 | 6d5e216d | bellard | |
390 | 048f6b4d | bellard | #elif defined(TARGET_MIPS)
|
391 | 048f6b4d | bellard | |
392 | 048f6b4d | bellard | #define TARGET_SIGHUP 1 /* Hangup (POSIX). */ |
393 | 048f6b4d | bellard | #define TARGET_SIGINT 2 /* Interrupt (ANSI). */ |
394 | 048f6b4d | bellard | #define TARGET_SIGQUIT 3 /* Quit (POSIX). */ |
395 | 048f6b4d | bellard | #define TARGET_SIGILL 4 /* Illegal instruction (ANSI). */ |
396 | 048f6b4d | bellard | #define TARGET_SIGTRAP 5 /* Trace trap (POSIX). */ |
397 | 048f6b4d | bellard | #define TARGET_SIGIOT 6 /* IOT trap (4.2 BSD). */ |
398 | 048f6b4d | bellard | #define TARGET_SIGABRT TARGET_SIGIOT /* Abort (ANSI). */ |
399 | 048f6b4d | bellard | #define TARGET_SIGEMT 7 |
400 | 048f6b4d | bellard | #define TARGET_SIGSTKFLT 7 /* XXX: incorrect */ |
401 | 048f6b4d | bellard | #define TARGET_SIGFPE 8 /* Floating-point exception (ANSI). */ |
402 | 048f6b4d | bellard | #define TARGET_SIGKILL 9 /* Kill, unblockable (POSIX). */ |
403 | 048f6b4d | bellard | #define TARGET_SIGBUS 10 /* BUS error (4.2 BSD). */ |
404 | 048f6b4d | bellard | #define TARGET_SIGSEGV 11 /* Segmentation violation (ANSI). */ |
405 | 048f6b4d | bellard | #define TARGET_SIGSYS 12 |
406 | 048f6b4d | bellard | #define TARGET_SIGPIPE 13 /* Broken pipe (POSIX). */ |
407 | 048f6b4d | bellard | #define TARGET_SIGALRM 14 /* Alarm clock (POSIX). */ |
408 | 048f6b4d | bellard | #define TARGET_SIGTERM 15 /* Termination (ANSI). */ |
409 | 048f6b4d | bellard | #define TARGET_SIGUSR1 16 /* User-defined signal 1 (POSIX). */ |
410 | 048f6b4d | bellard | #define TARGET_SIGUSR2 17 /* User-defined signal 2 (POSIX). */ |
411 | 048f6b4d | bellard | #define TARGET_SIGCHLD 18 /* Child status has changed (POSIX). */ |
412 | 048f6b4d | bellard | #define TARGET_SIGCLD TARGET_SIGCHLD /* Same as TARGET_SIGCHLD (System V). */ |
413 | 048f6b4d | bellard | #define TARGET_SIGPWR 19 /* Power failure restart (System V). */ |
414 | 048f6b4d | bellard | #define TARGET_SIGWINCH 20 /* Window size change (4.3 BSD, Sun). */ |
415 | 048f6b4d | bellard | #define TARGET_SIGURG 21 /* Urgent condition on socket (4.2 BSD). */ |
416 | 048f6b4d | bellard | #define TARGET_SIGIO 22 /* I/O now possible (4.2 BSD). */ |
417 | 048f6b4d | bellard | #define TARGET_SIGPOLL TARGET_SIGIO /* Pollable event occurred (System V). */ |
418 | 048f6b4d | bellard | #define TARGET_SIGSTOP 23 /* Stop, unblockable (POSIX). */ |
419 | 048f6b4d | bellard | #define TARGET_SIGTSTP 24 /* Keyboard stop (POSIX). */ |
420 | 048f6b4d | bellard | #define TARGET_SIGCONT 25 /* Continue (POSIX). */ |
421 | 048f6b4d | bellard | #define TARGET_SIGTTIN 26 /* Background read from tty (POSIX). */ |
422 | 048f6b4d | bellard | #define TARGET_SIGTTOU 27 /* Background write to tty (POSIX). */ |
423 | 048f6b4d | bellard | #define TARGET_SIGVTALRM 28 /* Virtual alarm clock (4.2 BSD). */ |
424 | 048f6b4d | bellard | #define TARGET_SIGPROF 29 /* Profiling alarm clock (4.2 BSD). */ |
425 | 048f6b4d | bellard | #define TARGET_SIGXCPU 30 /* CPU limit exceeded (4.2 BSD). */ |
426 | 048f6b4d | bellard | #define TARGET_SIGXFSZ 31 /* File size limit exceeded (4.2 BSD). */ |
427 | 048f6b4d | bellard | #define TARGET_SIGRTMIN 32 |
428 | 048f6b4d | bellard | |
429 | 048f6b4d | bellard | #define TARGET_SIG_BLOCK 1 /* for blocking signals */ |
430 | 048f6b4d | bellard | #define TARGET_SIG_UNBLOCK 2 /* for unblocking signals */ |
431 | 048f6b4d | bellard | #define TARGET_SIG_SETMASK 3 /* for setting the signal mask */ |
432 | 048f6b4d | bellard | |
433 | 6d5e216d | bellard | #else
|
434 | 2521d698 | bellard | |
435 | 2521d698 | bellard | #define TARGET_SIGHUP 1 |
436 | 2521d698 | bellard | #define TARGET_SIGINT 2 |
437 | 2521d698 | bellard | #define TARGET_SIGQUIT 3 |
438 | 2521d698 | bellard | #define TARGET_SIGILL 4 |
439 | 2521d698 | bellard | #define TARGET_SIGTRAP 5 |
440 | 2521d698 | bellard | #define TARGET_SIGABRT 6 |
441 | 2521d698 | bellard | #define TARGET_SIGIOT 6 |
442 | 2521d698 | bellard | #define TARGET_SIGBUS 7 |
443 | 2521d698 | bellard | #define TARGET_SIGFPE 8 |
444 | 2521d698 | bellard | #define TARGET_SIGKILL 9 |
445 | 2521d698 | bellard | #define TARGET_SIGUSR1 10 |
446 | 2521d698 | bellard | #define TARGET_SIGSEGV 11 |
447 | 2521d698 | bellard | #define TARGET_SIGUSR2 12 |
448 | 2521d698 | bellard | #define TARGET_SIGPIPE 13 |
449 | 2521d698 | bellard | #define TARGET_SIGALRM 14 |
450 | 2521d698 | bellard | #define TARGET_SIGTERM 15 |
451 | 2521d698 | bellard | #define TARGET_SIGSTKFLT 16 |
452 | 2521d698 | bellard | #define TARGET_SIGCHLD 17 |
453 | 2521d698 | bellard | #define TARGET_SIGCONT 18 |
454 | 2521d698 | bellard | #define TARGET_SIGSTOP 19 |
455 | 2521d698 | bellard | #define TARGET_SIGTSTP 20 |
456 | 2521d698 | bellard | #define TARGET_SIGTTIN 21 |
457 | 2521d698 | bellard | #define TARGET_SIGTTOU 22 |
458 | 2521d698 | bellard | #define TARGET_SIGURG 23 |
459 | 2521d698 | bellard | #define TARGET_SIGXCPU 24 |
460 | 2521d698 | bellard | #define TARGET_SIGXFSZ 25 |
461 | 2521d698 | bellard | #define TARGET_SIGVTALRM 26 |
462 | 2521d698 | bellard | #define TARGET_SIGPROF 27 |
463 | 2521d698 | bellard | #define TARGET_SIGWINCH 28 |
464 | 2521d698 | bellard | #define TARGET_SIGIO 29 |
465 | c596ed17 | bellard | #define TARGET_SIGPWR 30 |
466 | c596ed17 | bellard | #define TARGET_SIGSYS 31 |
467 | 2521d698 | bellard | #define TARGET_SIGRTMIN 32 |
468 | 2521d698 | bellard | |
469 | 2521d698 | bellard | #define TARGET_SIG_BLOCK 0 /* for blocking signals */ |
470 | 2521d698 | bellard | #define TARGET_SIG_UNBLOCK 1 /* for unblocking signals */ |
471 | 2521d698 | bellard | #define TARGET_SIG_SETMASK 2 /* for setting the signal mask */ |
472 | 2521d698 | bellard | |
473 | 6d5e216d | bellard | #endif
|
474 | 6d5e216d | bellard | |
475 | 106ec879 | bellard | #if defined(TARGET_MIPS)
|
476 | 106ec879 | bellard | |
477 | 106ec879 | bellard | struct target_sigaction {
|
478 | 540635ba | ths | uint32_t sa_flags; |
479 | d26bc211 | ths | #if defined(TARGET_ABI_MIPSN32)
|
480 | 540635ba | ths | uint32_t _sa_handler; |
481 | 540635ba | ths | #else
|
482 | 992f48a0 | blueswir1 | abi_ulong _sa_handler; |
483 | 540635ba | ths | #endif
|
484 | 106ec879 | bellard | target_sigset_t sa_mask; |
485 | 106ec879 | bellard | }; |
486 | 106ec879 | bellard | |
487 | 106ec879 | bellard | #else
|
488 | 2521d698 | bellard | struct target_old_sigaction {
|
489 | 992f48a0 | blueswir1 | abi_ulong _sa_handler; |
490 | 992f48a0 | blueswir1 | abi_ulong sa_mask; |
491 | 992f48a0 | blueswir1 | abi_ulong sa_flags; |
492 | 992f48a0 | blueswir1 | abi_ulong sa_restorer; |
493 | 2521d698 | bellard | }; |
494 | 2521d698 | bellard | |
495 | 2521d698 | bellard | struct target_sigaction {
|
496 | 992f48a0 | blueswir1 | abi_ulong _sa_handler; |
497 | 992f48a0 | blueswir1 | abi_ulong sa_flags; |
498 | 992f48a0 | blueswir1 | abi_ulong sa_restorer; |
499 | 2521d698 | bellard | target_sigset_t sa_mask; |
500 | 2521d698 | bellard | }; |
501 | 106ec879 | bellard | #endif
|
502 | 2521d698 | bellard | |
503 | 2521d698 | bellard | typedef union target_sigval { |
504 | 2521d698 | bellard | int sival_int;
|
505 | 992f48a0 | blueswir1 | abi_ulong sival_ptr; |
506 | 2521d698 | bellard | } target_sigval_t; |
507 | 6d5e216d | bellard | #if 0
|
508 | 6d5e216d | bellard | #if defined (TARGET_SPARC)
|
509 | 6d5e216d | bellard | typedef struct {
|
510 | 6d5e216d | bellard | struct {
|
511 | 992f48a0 | blueswir1 | abi_ulong psr;
|
512 | 992f48a0 | blueswir1 | abi_ulong pc;
|
513 | 992f48a0 | blueswir1 | abi_ulong npc;
|
514 | 992f48a0 | blueswir1 | abi_ulong y;
|
515 | 992f48a0 | blueswir1 | abi_ulong u_regs[16]; /* globals and ins */
|
516 | 6d5e216d | bellard | } si_regs;
|
517 | 6d5e216d | bellard | int si_mask;
|
518 | 6d5e216d | bellard | } __siginfo_t;
|
519 | 6d5e216d | bellard | |
520 | 6d5e216d | bellard | typedef struct {
|
521 | 6d5e216d | bellard | unsigned long si_float_regs [32];
|
522 | 6d5e216d | bellard | unsigned long si_fsr;
|
523 | 6d5e216d | bellard | unsigned long si_fpqdepth;
|
524 | 6d5e216d | bellard | struct {
|
525 | 6d5e216d | bellard | unsigned long *insn_addr;
|
526 | 6d5e216d | bellard | unsigned long insn;
|
527 | 6d5e216d | bellard | } si_fpqueue [16];
|
528 | 6d5e216d | bellard | } __siginfo_fpu_t;
|
529 | 6d5e216d | bellard | #endif
|
530 | 6d5e216d | bellard | #endif
|
531 | 2521d698 | bellard | |
532 | 2521d698 | bellard | #define TARGET_SI_MAX_SIZE 128 |
533 | 2521d698 | bellard | #define TARGET_SI_PAD_SIZE ((TARGET_SI_MAX_SIZE/sizeof(int)) - 3) |
534 | 2521d698 | bellard | |
535 | 2521d698 | bellard | typedef struct target_siginfo { |
536 | 3f53d546 | pbrook | #ifdef TARGET_MIPS
|
537 | 3f53d546 | pbrook | int si_signo;
|
538 | 3f53d546 | pbrook | int si_code;
|
539 | 3f53d546 | pbrook | int si_errno;
|
540 | 3f53d546 | pbrook | #else
|
541 | 2521d698 | bellard | int si_signo;
|
542 | 2521d698 | bellard | int si_errno;
|
543 | 2521d698 | bellard | int si_code;
|
544 | 3f53d546 | pbrook | #endif
|
545 | 2521d698 | bellard | |
546 | 2521d698 | bellard | union {
|
547 | 2521d698 | bellard | int _pad[TARGET_SI_PAD_SIZE];
|
548 | 2521d698 | bellard | |
549 | 2521d698 | bellard | /* kill() */
|
550 | 2521d698 | bellard | struct {
|
551 | 2521d698 | bellard | pid_t _pid; /* sender's pid */
|
552 | 2521d698 | bellard | uid_t _uid; /* sender's uid */
|
553 | 2521d698 | bellard | } _kill; |
554 | 2521d698 | bellard | |
555 | 2521d698 | bellard | /* POSIX.1b timers */
|
556 | 2521d698 | bellard | struct {
|
557 | 2521d698 | bellard | unsigned int _timer1; |
558 | 2521d698 | bellard | unsigned int _timer2; |
559 | 2521d698 | bellard | } _timer; |
560 | 2521d698 | bellard | |
561 | 2521d698 | bellard | /* POSIX.1b signals */
|
562 | 2521d698 | bellard | struct {
|
563 | 2521d698 | bellard | pid_t _pid; /* sender's pid */
|
564 | 2521d698 | bellard | uid_t _uid; /* sender's uid */
|
565 | 2521d698 | bellard | target_sigval_t _sigval; |
566 | 2521d698 | bellard | } _rt; |
567 | 2521d698 | bellard | |
568 | 2521d698 | bellard | /* SIGCHLD */
|
569 | 2521d698 | bellard | struct {
|
570 | 2521d698 | bellard | pid_t _pid; /* which child */
|
571 | 2521d698 | bellard | uid_t _uid; /* sender's uid */
|
572 | 2521d698 | bellard | int _status; /* exit code */ |
573 | 2521d698 | bellard | target_clock_t _utime; |
574 | 2521d698 | bellard | target_clock_t _stime; |
575 | 2521d698 | bellard | } _sigchld; |
576 | 2521d698 | bellard | |
577 | 2521d698 | bellard | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
|
578 | 2521d698 | bellard | struct {
|
579 | 992f48a0 | blueswir1 | abi_ulong _addr; /* faulting insn/memory ref. */
|
580 | 2521d698 | bellard | } _sigfault; |
581 | 2521d698 | bellard | |
582 | 2521d698 | bellard | /* SIGPOLL */
|
583 | 2521d698 | bellard | struct {
|
584 | 2521d698 | bellard | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ |
585 | 2521d698 | bellard | int _fd;
|
586 | 2521d698 | bellard | } _sigpoll; |
587 | 2521d698 | bellard | } _sifields; |
588 | 2521d698 | bellard | } target_siginfo_t; |
589 | 2521d698 | bellard | |
590 | 2521d698 | bellard | /*
|
591 | 2521d698 | bellard | * si_code values
|
592 | 2521d698 | bellard | * Digital reserves positive values for kernel-generated signals.
|
593 | 2521d698 | bellard | */
|
594 | 2521d698 | bellard | #define TARGET_SI_USER 0 /* sent by kill, sigsend, raise */ |
595 | 2521d698 | bellard | #define TARGET_SI_KERNEL 0x80 /* sent by the kernel from somewhere */ |
596 | 2521d698 | bellard | #define TARGET_SI_QUEUE -1 /* sent by sigqueue */ |
597 | 2521d698 | bellard | #define TARGET_SI_TIMER -2 /* sent by timer expiration */ |
598 | 2521d698 | bellard | #define TARGET_SI_MESGQ -3 /* sent by real time mesq state change */ |
599 | 2521d698 | bellard | #define TARGET_SI_ASYNCIO -4 /* sent by AIO completion */ |
600 | 2521d698 | bellard | #define TARGET_SI_SIGIO -5 /* sent by queued SIGIO */ |
601 | 2521d698 | bellard | |
602 | 2521d698 | bellard | /*
|
603 | 2521d698 | bellard | * SIGILL si_codes
|
604 | 2521d698 | bellard | */
|
605 | ffa65c3b | bellard | #define TARGET_ILL_ILLOPC (1) /* illegal opcode */ |
606 | 2521d698 | bellard | #define TARGET_ILL_ILLOPN (2) /* illegal operand */ |
607 | ffa65c3b | bellard | #define TARGET_ILL_ILLADR (3) /* illegal addressing mode */ |
608 | ffa65c3b | bellard | #define TARGET_ILL_ILLTRP (4) /* illegal trap */ |
609 | ffa65c3b | bellard | #define TARGET_ILL_PRVOPC (5) /* privileged opcode */ |
610 | ffa65c3b | bellard | #define TARGET_ILL_PRVREG (6) /* privileged register */ |
611 | ffa65c3b | bellard | #define TARGET_ILL_COPROC (7) /* coprocessor error */ |
612 | ffa65c3b | bellard | #define TARGET_ILL_BADSTK (8) /* internal stack error */ |
613 | 2521d698 | bellard | |
614 | 2521d698 | bellard | /*
|
615 | 2521d698 | bellard | * SIGFPE si_codes
|
616 | 2521d698 | bellard | */
|
617 | 2521d698 | bellard | #define TARGET_FPE_INTDIV (1) /* integer divide by zero */ |
618 | 2521d698 | bellard | #define TARGET_FPE_INTOVF (2) /* integer overflow */ |
619 | 2521d698 | bellard | #define TARGET_FPE_FLTDIV (3) /* floating point divide by zero */ |
620 | 2521d698 | bellard | #define TARGET_FPE_FLTOVF (4) /* floating point overflow */ |
621 | 2521d698 | bellard | #define TARGET_FPE_FLTUND (5) /* floating point underflow */ |
622 | 2521d698 | bellard | #define TARGET_FPE_FLTRES (6) /* floating point inexact result */ |
623 | 2521d698 | bellard | #define TARGET_FPE_FLTINV (7) /* floating point invalid operation */ |
624 | 2521d698 | bellard | #define TARGET_FPE_FLTSUB (8) /* subscript out of range */ |
625 | 2521d698 | bellard | #define TARGET_NSIGFPE 8 |
626 | 2521d698 | bellard | |
627 | 2521d698 | bellard | /*
|
628 | 2521d698 | bellard | * SIGSEGV si_codes
|
629 | 2521d698 | bellard | */
|
630 | 2521d698 | bellard | #define TARGET_SEGV_MAPERR (1) /* address not mapped to object */ |
631 | 2521d698 | bellard | #define TARGET_SEGV_ACCERR (2) /* invalid permissions for mapped object */ |
632 | 2521d698 | bellard | |
633 | 2521d698 | bellard | /*
|
634 | ffa65c3b | bellard | * SIGBUS si_codes
|
635 | ffa65c3b | bellard | */
|
636 | ffa65c3b | bellard | #define TARGET_BUS_ADRALN (1) /* invalid address alignment */ |
637 | ffa65c3b | bellard | #define TARGET_BUS_ADRERR (2) /* non-existant physical address */ |
638 | ffa65c3b | bellard | #define TARGET_BUS_OBJERR (3) /* object specific hardware error */ |
639 | ffa65c3b | bellard | |
640 | ffa65c3b | bellard | /*
|
641 | 2521d698 | bellard | * SIGTRAP si_codes
|
642 | 2521d698 | bellard | */
|
643 | 2521d698 | bellard | #define TARGET_TRAP_BRKPT (1) /* process breakpoint */ |
644 | 2521d698 | bellard | #define TARGET_TRAP_TRACE (2) /* process trace trap */ |
645 | 2521d698 | bellard | |
646 | 2521d698 | bellard | #endif /* defined(TARGET_I386) || defined(TARGET_ARM) */ |
647 | 2521d698 | bellard | |
648 | 9de5e440 | bellard | struct target_rlimit {
|
649 | 992f48a0 | blueswir1 | abi_ulong rlim_cur; |
650 | 992f48a0 | blueswir1 | abi_ulong rlim_max; |
651 | 9de5e440 | bellard | }; |
652 | 9de5e440 | bellard | |
653 | 9de5e440 | bellard | struct target_pollfd {
|
654 | 9de5e440 | bellard | int fd; /* file descriptor */ |
655 | 9de5e440 | bellard | short events; /* requested events */ |
656 | 9de5e440 | bellard | short revents; /* returned events */ |
657 | 9de5e440 | bellard | }; |
658 | 9de5e440 | bellard | |
659 | 8e5a0667 | bellard | /* virtual terminal ioctls */
|
660 | 0221cfcd | bellard | #define TARGET_KIOCSOUND 0x4B2F /* start sound generation (0 for off) */ |
661 | 0221cfcd | bellard | #define TARGET_KDMKTONE 0x4B30 /* generate tone */ |
662 | 8e5a0667 | bellard | #define TARGET_KDGKBTYPE 0x4b33 |
663 | 0221cfcd | bellard | #define TARGET_KDGKBENT 0x4B46 /* gets one entry in translation table */ |
664 | 0221cfcd | bellard | #define TARGET_KDGKBSENT 0x4B48 /* gets one function key string entry */ |
665 | 8e5a0667 | bellard | |
666 | 2521d698 | bellard | #define TARGET_SIOCATMARK 0x8905 |
667 | 2521d698 | bellard | |
668 | 31e31b8a | bellard | /* Networking ioctls */
|
669 | 31e31b8a | bellard | #define TARGET_SIOCADDRT 0x890B /* add routing table entry */ |
670 | 31e31b8a | bellard | #define TARGET_SIOCDELRT 0x890C /* delete routing table entry */ |
671 | 31e31b8a | bellard | #define TARGET_SIOCGIFNAME 0x8910 /* get iface name */ |
672 | 31e31b8a | bellard | #define TARGET_SIOCSIFLINK 0x8911 /* set iface channel */ |
673 | 31e31b8a | bellard | #define TARGET_SIOCGIFCONF 0x8912 /* get iface list */ |
674 | 31e31b8a | bellard | #define TARGET_SIOCGIFFLAGS 0x8913 /* get flags */ |
675 | 31e31b8a | bellard | #define TARGET_SIOCSIFFLAGS 0x8914 /* set flags */ |
676 | 31e31b8a | bellard | #define TARGET_SIOCGIFADDR 0x8915 /* get PA address */ |
677 | 31e31b8a | bellard | #define TARGET_SIOCSIFADDR 0x8916 /* set PA address */ |
678 | 31e31b8a | bellard | #define TARGET_SIOCGIFDSTADDR 0x8917 /* get remote PA address */ |
679 | 31e31b8a | bellard | #define TARGET_SIOCSIFDSTADDR 0x8918 /* set remote PA address */ |
680 | 31e31b8a | bellard | #define TARGET_SIOCGIFBRDADDR 0x8919 /* get broadcast PA address */ |
681 | 31e31b8a | bellard | #define TARGET_SIOCSIFBRDADDR 0x891a /* set broadcast PA address */ |
682 | 31e31b8a | bellard | #define TARGET_SIOCGIFNETMASK 0x891b /* get network PA mask */ |
683 | 31e31b8a | bellard | #define TARGET_SIOCSIFNETMASK 0x891c /* set network PA mask */ |
684 | 31e31b8a | bellard | #define TARGET_SIOCGIFMETRIC 0x891d /* get metric */ |
685 | 31e31b8a | bellard | #define TARGET_SIOCSIFMETRIC 0x891e /* set metric */ |
686 | 31e31b8a | bellard | #define TARGET_SIOCGIFMEM 0x891f /* get memory address (BSD) */ |
687 | 31e31b8a | bellard | #define TARGET_SIOCSIFMEM 0x8920 /* set memory address (BSD) */ |
688 | 31e31b8a | bellard | #define TARGET_SIOCGIFMTU 0x8921 /* get MTU size */ |
689 | 31e31b8a | bellard | #define TARGET_SIOCSIFMTU 0x8922 /* set MTU size */ |
690 | 31e31b8a | bellard | #define TARGET_SIOCSIFHWADDR 0x8924 /* set hardware address (NI) */ |
691 | 31e31b8a | bellard | #define TARGET_SIOCGIFENCAP 0x8925 /* get/set slip encapsulation */ |
692 | 31e31b8a | bellard | #define TARGET_SIOCSIFENCAP 0x8926 |
693 | 31e31b8a | bellard | #define TARGET_SIOCGIFHWADDR 0x8927 /* Get hardware address */ |
694 | 31e31b8a | bellard | #define TARGET_SIOCGIFSLAVE 0x8929 /* Driver slaving support */ |
695 | 31e31b8a | bellard | #define TARGET_SIOCSIFSLAVE 0x8930 |
696 | 31e31b8a | bellard | #define TARGET_SIOCADDMULTI 0x8931 /* Multicast address lists */ |
697 | 31e31b8a | bellard | #define TARGET_SIOCDELMULTI 0x8932 |
698 | 31e31b8a | bellard | |
699 | 31e31b8a | bellard | /* Bridging control calls */
|
700 | 31e31b8a | bellard | #define TARGET_SIOCGIFBR 0x8940 /* Bridging support */ |
701 | 31e31b8a | bellard | #define TARGET_SIOCSIFBR 0x8941 /* Set bridging options */ |
702 | 31e31b8a | bellard | |
703 | 31e31b8a | bellard | #define TARGET_SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */ |
704 | 31e31b8a | bellard | #define TARGET_SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */ |
705 | 31e31b8a | bellard | |
706 | 31e31b8a | bellard | /* ARP cache control calls. */
|
707 | 31e31b8a | bellard | #define TARGET_OLD_SIOCDARP 0x8950 /* old delete ARP table entry */ |
708 | 31e31b8a | bellard | #define TARGET_OLD_SIOCGARP 0x8951 /* old get ARP table entry */ |
709 | 31e31b8a | bellard | #define TARGET_OLD_SIOCSARP 0x8952 /* old set ARP table entry */ |
710 | 31e31b8a | bellard | #define TARGET_SIOCDARP 0x8953 /* delete ARP table entry */ |
711 | 31e31b8a | bellard | #define TARGET_SIOCGARP 0x8954 /* get ARP table entry */ |
712 | 31e31b8a | bellard | #define TARGET_SIOCSARP 0x8955 /* set ARP table entry */ |
713 | 31e31b8a | bellard | |
714 | 31e31b8a | bellard | /* RARP cache control calls. */
|
715 | 31e31b8a | bellard | #define TARGET_SIOCDRARP 0x8960 /* delete RARP table entry */ |
716 | 31e31b8a | bellard | #define TARGET_SIOCGRARP 0x8961 /* get RARP table entry */ |
717 | 31e31b8a | bellard | #define TARGET_SIOCSRARP 0x8962 /* set RARP table entry */ |
718 | 31e31b8a | bellard | |
719 | 31e31b8a | bellard | /* Driver configuration calls */
|
720 | 31e31b8a | bellard | #define TARGET_SIOCGIFMAP 0x8970 /* Get device parameters */ |
721 | 31e31b8a | bellard | #define TARGET_SIOCSIFMAP 0x8971 /* Set device parameters */ |
722 | 31e31b8a | bellard | |
723 | 31e31b8a | bellard | /* DLCI configuration calls */
|
724 | 31e31b8a | bellard | #define TARGET_SIOCADDDLCI 0x8980 /* Create new DLCI device */ |
725 | 31e31b8a | bellard | #define TARGET_SIOCDELDLCI 0x8981 /* Delete DLCI device */ |
726 | 31e31b8a | bellard | |
727 | 31e31b8a | bellard | |
728 | 31e31b8a | bellard | /* From <linux/fs.h> */
|
729 | 31e31b8a | bellard | |
730 | 31e31b8a | bellard | #define TARGET_BLKROSET TARGET_IO(0x12,93) /* set device read-only (0 = read-write) */ |
731 | 31e31b8a | bellard | #define TARGET_BLKROGET TARGET_IO(0x12,94) /* get read-only status (0 = read_write) */ |
732 | 31e31b8a | bellard | #define TARGET_BLKRRPART TARGET_IO(0x12,95) /* re-read partition table */ |
733 | 31e31b8a | bellard | #define TARGET_BLKGETSIZE TARGET_IO(0x12,96) /* return device size /512 (long *arg) */ |
734 | 31e31b8a | bellard | #define TARGET_BLKFLSBUF TARGET_IO(0x12,97) /* flush buffer cache */ |
735 | 31e31b8a | bellard | #define TARGET_BLKRASET TARGET_IO(0x12,98) /* Set read ahead for block device */ |
736 | 31e31b8a | bellard | #define TARGET_BLKRAGET TARGET_IO(0x12,99) /* get current read ahead setting */ |
737 | 31e31b8a | bellard | #define TARGET_BLKFRASET TARGET_IO(0x12,100)/* set filesystem (mm/filemap.c) read-ahead */ |
738 | 31e31b8a | bellard | #define TARGET_BLKFRAGET TARGET_IO(0x12,101)/* get filesystem (mm/filemap.c) read-ahead */ |
739 | 31e31b8a | bellard | #define TARGET_BLKSECTSET TARGET_IO(0x12,102)/* set max sectors per request (ll_rw_blk.c) */ |
740 | 31e31b8a | bellard | #define TARGET_BLKSECTGET TARGET_IO(0x12,103)/* get max sectors per request (ll_rw_blk.c) */ |
741 | 31e31b8a | bellard | #define TARGET_BLKSSZGET TARGET_IO(0x12,104)/* get block device sector size */ |
742 | 31e31b8a | bellard | /* A jump here: 108-111 have been used for various private purposes. */
|
743 | 31e31b8a | bellard | #define TARGET_BLKBSZGET TARGET_IOR(0x12,112,sizeof(int)) |
744 | 31e31b8a | bellard | #define TARGET_BLKBSZSET TARGET_IOW(0x12,113,sizeof(int)) |
745 | 31e31b8a | bellard | #define TARGET_BLKGETSIZE64 TARGET_IOR(0x12,114,sizeof(uint64_t)) /* return device size in bytes (u64 *arg) */ |
746 | 31e31b8a | bellard | #define TARGET_FIBMAP TARGET_IO(0x00,1) /* bmap access */ |
747 | 31e31b8a | bellard | #define TARGET_FIGETBSZ TARGET_IO(0x00,2) /* get the block size used for bmap */ |
748 | 31e31b8a | bellard | |
749 | 31e31b8a | bellard | /* cdrom commands */
|
750 | 5fafdf24 | ths | #define TARGET_CDROMPAUSE 0x5301 /* Pause Audio Operation */ |
751 | 31e31b8a | bellard | #define TARGET_CDROMRESUME 0x5302 /* Resume paused Audio Operation */ |
752 | 31e31b8a | bellard | #define TARGET_CDROMPLAYMSF 0x5303 /* Play Audio MSF (struct cdrom_msf) */ |
753 | 5fafdf24 | ths | #define TARGET_CDROMPLAYTRKIND 0x5304 /* Play Audio Track/index |
754 | 31e31b8a | bellard | (struct cdrom_ti) */
|
755 | 5fafdf24 | ths | #define TARGET_CDROMREADTOCHDR 0x5305 /* Read TOC header |
756 | 31e31b8a | bellard | (struct cdrom_tochdr) */
|
757 | 5fafdf24 | ths | #define TARGET_CDROMREADTOCENTRY 0x5306 /* Read TOC entry |
758 | 31e31b8a | bellard | (struct cdrom_tocentry) */
|
759 | 31e31b8a | bellard | #define TARGET_CDROMSTOP 0x5307 /* Stop the cdrom drive */ |
760 | 31e31b8a | bellard | #define TARGET_CDROMSTART 0x5308 /* Start the cdrom drive */ |
761 | 31e31b8a | bellard | #define TARGET_CDROMEJECT 0x5309 /* Ejects the cdrom media */ |
762 | 5fafdf24 | ths | #define TARGET_CDROMVOLCTRL 0x530a /* Control output volume |
763 | 31e31b8a | bellard | (struct cdrom_volctrl) */
|
764 | 5fafdf24 | ths | #define TARGET_CDROMSUBCHNL 0x530b /* Read subchannel data |
765 | 31e31b8a | bellard | (struct cdrom_subchnl) */
|
766 | 5fafdf24 | ths | #define TARGET_CDROMREADMODE2 0x530c /* Read TARGET_CDROM mode 2 data (2336 Bytes) |
767 | 31e31b8a | bellard | (struct cdrom_read) */
|
768 | 31e31b8a | bellard | #define TARGET_CDROMREADMODE1 0x530d /* Read TARGET_CDROM mode 1 data (2048 Bytes) |
769 | 31e31b8a | bellard | (struct cdrom_read) */
|
770 | 31e31b8a | bellard | #define TARGET_CDROMREADAUDIO 0x530e /* (struct cdrom_read_audio) */ |
771 | 31e31b8a | bellard | #define TARGET_CDROMEJECT_SW 0x530f /* enable(1)/disable(0) auto-ejecting */ |
772 | 5fafdf24 | ths | #define TARGET_CDROMMULTISESSION 0x5310 /* Obtain the start-of-last-session |
773 | 5fafdf24 | ths | address of multi session disks
|
774 | 31e31b8a | bellard | (struct cdrom_multisession) */
|
775 | 5fafdf24 | ths | #define TARGET_CDROM_GET_MCN 0x5311 /* Obtain the "Universal Product Code" |
776 | 31e31b8a | bellard | if available (struct cdrom_mcn) */
|
777 | 5fafdf24 | ths | #define TARGET_CDROM_GET_UPC TARGET_CDROM_GET_MCN /* This one is depricated, |
778 | 31e31b8a | bellard | but here anyway for compatability */
|
779 | 31e31b8a | bellard | #define TARGET_CDROMRESET 0x5312 /* hard-reset the drive */ |
780 | 5fafdf24 | ths | #define TARGET_CDROMVOLREAD 0x5313 /* Get the drive's volume setting |
781 | 31e31b8a | bellard | (struct cdrom_volctrl) */
|
782 | 31e31b8a | bellard | #define TARGET_CDROMREADRAW 0x5314 /* read data in raw mode (2352 Bytes) |
783 | 31e31b8a | bellard | (struct cdrom_read) */
|
784 | 5fafdf24 | ths | /*
|
785 | 31e31b8a | bellard | * These ioctls are used only used in aztcd.c and optcd.c
|
786 | 31e31b8a | bellard | */
|
787 | 31e31b8a | bellard | #define TARGET_CDROMREADCOOKED 0x5315 /* read data in cooked mode */ |
788 | 31e31b8a | bellard | #define TARGET_CDROMSEEK 0x5316 /* seek msf address */ |
789 | 3b46e624 | ths | |
790 | 31e31b8a | bellard | /*
|
791 | 3b46e624 | ths | * This ioctl is only used by the scsi-cd driver.
|
792 | 31e31b8a | bellard | It is for playing audio in logical block addressing mode.
|
793 | 31e31b8a | bellard | */
|
794 | 31e31b8a | bellard | #define TARGET_CDROMPLAYBLK 0x5317 /* (struct cdrom_blk) */ |
795 | 31e31b8a | bellard | |
796 | 5fafdf24 | ths | /*
|
797 | 31e31b8a | bellard | * These ioctls are only used in optcd.c
|
798 | 31e31b8a | bellard | */
|
799 | 31e31b8a | bellard | #define TARGET_CDROMREADALL 0x5318 /* read all 2646 bytes */ |
800 | 31e31b8a | bellard | |
801 | 5fafdf24 | ths | /*
|
802 | 5fafdf24 | ths | * These ioctls are (now) only in ide-cd.c for controlling
|
803 | 31e31b8a | bellard | * drive spindown time. They should be implemented in the
|
804 | 31e31b8a | bellard | * Uniform driver, via generic packet commands, GPCMD_MODE_SELECT_10,
|
805 | 31e31b8a | bellard | * GPCMD_MODE_SENSE_10 and the GPMODE_POWER_PAGE...
|
806 | 31e31b8a | bellard | * -Erik
|
807 | 31e31b8a | bellard | */
|
808 | 31e31b8a | bellard | #define TARGET_CDROMGETSPINDOWN 0x531d |
809 | 31e31b8a | bellard | #define TARGET_CDROMSETSPINDOWN 0x531e |
810 | 31e31b8a | bellard | |
811 | 5fafdf24 | ths | /*
|
812 | 31e31b8a | bellard | * These ioctls are implemented through the uniform CD-ROM driver
|
813 | 31e31b8a | bellard | * They _will_ be adopted by all CD-ROM drivers, when all the CD-ROM
|
814 | 31e31b8a | bellard | * drivers are eventually ported to the uniform CD-ROM driver interface.
|
815 | 31e31b8a | bellard | */
|
816 | 31e31b8a | bellard | #define TARGET_CDROMCLOSETRAY 0x5319 /* pendant of CDROMEJECT */ |
817 | 31e31b8a | bellard | #define TARGET_CDROM_SET_OPTIONS 0x5320 /* Set behavior options */ |
818 | 31e31b8a | bellard | #define TARGET_CDROM_CLEAR_OPTIONS 0x5321 /* Clear behavior options */ |
819 | 31e31b8a | bellard | #define TARGET_CDROM_SELECT_SPEED 0x5322 /* Set the CD-ROM speed */ |
820 | 31e31b8a | bellard | #define TARGET_CDROM_SELECT_DISC 0x5323 /* Select disc (for juke-boxes) */ |
821 | 31e31b8a | bellard | #define TARGET_CDROM_MEDIA_CHANGED 0x5325 /* Check is media changed */ |
822 | 31e31b8a | bellard | #define TARGET_CDROM_DRIVE_STATUS 0x5326 /* Get tray position, etc. */ |
823 | 31e31b8a | bellard | #define TARGET_CDROM_DISC_STATUS 0x5327 /* Get disc type, etc. */ |
824 | 31e31b8a | bellard | #define TARGET_CDROM_CHANGER_NSLOTS 0x5328 /* Get number of slots */ |
825 | 31e31b8a | bellard | #define TARGET_CDROM_LOCKDOOR 0x5329 /* lock or unlock door */ |
826 | 31e31b8a | bellard | #define TARGET_CDROM_DEBUG 0x5330 /* Turn debug messages on/off */ |
827 | 31e31b8a | bellard | #define TARGET_CDROM_GET_CAPABILITY 0x5331 /* get capabilities */ |
828 | 31e31b8a | bellard | |
829 | 31e31b8a | bellard | /* Note that scsi/scsi_ioctl.h also uses 0x5382 - 0x5386.
|
830 | 31e31b8a | bellard | * Future CDROM ioctls should be kept below 0x537F
|
831 | 31e31b8a | bellard | */
|
832 | 31e31b8a | bellard | |
833 | 31e31b8a | bellard | /* This ioctl is only used by sbpcd at the moment */
|
834 | 31e31b8a | bellard | #define TARGET_CDROMAUDIOBUFSIZ 0x5382 /* set the audio buffer size */ |
835 | 31e31b8a | bellard | /* conflict with SCSI_IOCTL_GET_IDLUN */
|
836 | 31e31b8a | bellard | |
837 | 31e31b8a | bellard | /* DVD-ROM Specific ioctls */
|
838 | 31e31b8a | bellard | #define TARGET_DVD_READ_STRUCT 0x5390 /* Read structure */ |
839 | 31e31b8a | bellard | #define TARGET_DVD_WRITE_STRUCT 0x5391 /* Write structure */ |
840 | 31e31b8a | bellard | #define TARGET_DVD_AUTH 0x5392 /* Authentication */ |
841 | 31e31b8a | bellard | |
842 | 31e31b8a | bellard | #define TARGET_CDROM_SEND_PACKET 0x5393 /* send a packet to the drive */ |
843 | 31e31b8a | bellard | #define TARGET_CDROM_NEXT_WRITABLE 0x5394 /* get next writable block */ |
844 | 31e31b8a | bellard | #define TARGET_CDROM_LAST_WRITTEN 0x5395 /* get last block written on disc */ |
845 | 31e31b8a | bellard | |
846 | 31e31b8a | bellard | /* HD commands */
|
847 | 31e31b8a | bellard | |
848 | 31e31b8a | bellard | /* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x030n/0x031n */
|
849 | 31e31b8a | bellard | #define TARGET_HDIO_GETGEO 0x0301 /* get device geometry */ |
850 | 31e31b8a | bellard | #define TARGET_HDIO_GET_UNMASKINTR 0x0302 /* get current unmask setting */ |
851 | 31e31b8a | bellard | #define TARGET_HDIO_GET_MULTCOUNT 0x0304 /* get current IDE blockmode setting */ |
852 | 31e31b8a | bellard | #define TARGET_HDIO_GET_KEEPSETTINGS 0x0308 /* get keep-settings-on-reset flag */ |
853 | 31e31b8a | bellard | #define TARGET_HDIO_GET_32BIT 0x0309 /* get current io_32bit setting */ |
854 | 31e31b8a | bellard | #define TARGET_HDIO_GET_NOWERR 0x030a /* get ignore-write-error flag */ |
855 | 31e31b8a | bellard | #define TARGET_HDIO_GET_DMA 0x030b /* get use-dma flag */ |
856 | 2521d698 | bellard | #define TARGET_HDIO_GET_IDENTITY 0x030d /* get IDE identification info */ |
857 | 31e31b8a | bellard | #define TARGET_HDIO_DRIVE_CMD 0x031f /* execute a special drive command */ |
858 | 31e31b8a | bellard | |
859 | 31e31b8a | bellard | /* hd/ide ctl's that pass (arg) non-ptr values are numbered 0x032n/0x033n */
|
860 | 31e31b8a | bellard | #define TARGET_HDIO_SET_MULTCOUNT 0x0321 /* change IDE blockmode */ |
861 | 31e31b8a | bellard | #define TARGET_HDIO_SET_UNMASKINTR 0x0322 /* permit other irqs during I/O */ |
862 | 31e31b8a | bellard | #define TARGET_HDIO_SET_KEEPSETTINGS 0x0323 /* keep ioctl settings on reset */ |
863 | 31e31b8a | bellard | #define TARGET_HDIO_SET_32BIT 0x0324 /* change io_32bit flags */ |
864 | 31e31b8a | bellard | #define TARGET_HDIO_SET_NOWERR 0x0325 /* change ignore-write-error flag */ |
865 | 31e31b8a | bellard | #define TARGET_HDIO_SET_DMA 0x0326 /* change use-dma flag */ |
866 | 31e31b8a | bellard | #define TARGET_HDIO_SET_PIO_MODE 0x0327 /* reconfig interface to new speed */ |
867 | 2521d698 | bellard | |
868 | b8005914 | balrog | /* loop ioctls */
|
869 | b8005914 | balrog | #define TARGET_LOOP_SET_FD 0x4C00 |
870 | b8005914 | balrog | #define TARGET_LOOP_CLR_FD 0x4C01 |
871 | b8005914 | balrog | #define TARGET_LOOP_SET_STATUS 0x4C02 |
872 | b8005914 | balrog | #define TARGET_LOOP_GET_STATUS 0x4C03 |
873 | b8005914 | balrog | #define TARGET_LOOP_SET_STATUS64 0x4C04 |
874 | b8005914 | balrog | #define TARGET_LOOP_GET_STATUS64 0x4C05 |
875 | b8005914 | balrog | #define TARGET_LOOP_CHANGE_FD 0x4C06 |
876 | 2521d698 | bellard | |
877 | 2521d698 | bellard | /* from asm/termbits.h */
|
878 | 2521d698 | bellard | |
879 | 3bfd9da1 | bellard | #define TARGET_NCC 8 |
880 | 3bfd9da1 | bellard | struct target_termio {
|
881 | 3bfd9da1 | bellard | unsigned short c_iflag; /* input mode flags */ |
882 | 3bfd9da1 | bellard | unsigned short c_oflag; /* output mode flags */ |
883 | 3bfd9da1 | bellard | unsigned short c_cflag; /* control mode flags */ |
884 | 3bfd9da1 | bellard | unsigned short c_lflag; /* local mode flags */ |
885 | 3bfd9da1 | bellard | unsigned char c_line; /* line discipline */ |
886 | 3bfd9da1 | bellard | unsigned char c_cc[TARGET_NCC]; /* control characters */ |
887 | 3bfd9da1 | bellard | }; |
888 | 2521d698 | bellard | |
889 | 3bfd9da1 | bellard | struct target_winsize {
|
890 | 3bfd9da1 | bellard | unsigned short ws_row; |
891 | 3bfd9da1 | bellard | unsigned short ws_col; |
892 | 3bfd9da1 | bellard | unsigned short ws_xpixel; |
893 | 3bfd9da1 | bellard | unsigned short ws_ypixel; |
894 | 2521d698 | bellard | }; |
895 | 2521d698 | bellard | |
896 | 3bfd9da1 | bellard | #include "termbits.h" |
897 | 2521d698 | bellard | |
898 | e44a3e79 | aurel32 | /* Common */
|
899 | 2521d698 | bellard | #define TARGET_MAP_SHARED 0x01 /* Share changes */ |
900 | 2521d698 | bellard | #define TARGET_MAP_PRIVATE 0x02 /* Changes are private */ |
901 | e44a3e79 | aurel32 | #define TARGET_MAP_TYPE 0x0f /* Mask for type of mapping */ |
902 | e44a3e79 | aurel32 | |
903 | e44a3e79 | aurel32 | /* Target specific */
|
904 | 048f6b4d | bellard | #if defined(TARGET_MIPS)
|
905 | e44a3e79 | aurel32 | #define TARGET_MAP_FIXED 0x10 /* Interpret addr exactly */ |
906 | 048f6b4d | bellard | #define TARGET_MAP_ANONYMOUS 0x0800 /* don't use a file */ |
907 | 048f6b4d | bellard | #define TARGET_MAP_GROWSDOWN 0x1000 /* stack-like segment */ |
908 | 048f6b4d | bellard | #define TARGET_MAP_DENYWRITE 0x2000 /* ETXTBSY */ |
909 | 048f6b4d | bellard | #define TARGET_MAP_EXECUTABLE 0x4000 /* mark it as an executable */ |
910 | 048f6b4d | bellard | #define TARGET_MAP_LOCKED 0x8000 /* pages are locked */ |
911 | 048f6b4d | bellard | #define TARGET_MAP_NORESERVE 0x0400 /* don't check for reservations */ |
912 | 540635ba | ths | #define TARGET_MAP_POPULATE 0x10000 /* populate (prefault) pagetables */ |
913 | 540635ba | ths | #define TARGET_MAP_NONBLOCK 0x20000 /* do not block on IO */ |
914 | e44a3e79 | aurel32 | #elif defined(TARGET_PPC)
|
915 | e44a3e79 | aurel32 | #define TARGET_MAP_FIXED 0x10 /* Interpret addr exactly */ |
916 | 2521d698 | bellard | #define TARGET_MAP_ANONYMOUS 0x20 /* don't use a file */ |
917 | 2521d698 | bellard | #define TARGET_MAP_GROWSDOWN 0x0100 /* stack-like segment */ |
918 | 2521d698 | bellard | #define TARGET_MAP_DENYWRITE 0x0800 /* ETXTBSY */ |
919 | 2521d698 | bellard | #define TARGET_MAP_EXECUTABLE 0x1000 /* mark it as an executable */ |
920 | 7ec93196 | j_mayer | #define TARGET_MAP_LOCKED 0x0080 /* pages are locked */ |
921 | 7ec93196 | j_mayer | #define TARGET_MAP_NORESERVE 0x0040 /* don't check for reservations */ |
922 | e44a3e79 | aurel32 | #define TARGET_MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ |
923 | e44a3e79 | aurel32 | #define TARGET_MAP_NONBLOCK 0x10000 /* do not block on IO */ |
924 | e44a3e79 | aurel32 | #elif defined(TARGET_ALPHA)
|
925 | e44a3e79 | aurel32 | #define TARGET_MAP_ANONYMOUS 0x10 /* don't use a file */ |
926 | e44a3e79 | aurel32 | #define TARGET_MAP_FIXED 0x100 /* Interpret addr exactly */ |
927 | e44a3e79 | aurel32 | #define TARGET_MAP_GROWSDOWN 0x01000 /* stack-like segment */ |
928 | e44a3e79 | aurel32 | #define TARGET_MAP_DENYWRITE 0x02000 /* ETXTBSY */ |
929 | e44a3e79 | aurel32 | #define TARGET_MAP_EXECUTABLE 0x04000 /* mark it as an executable */ |
930 | e44a3e79 | aurel32 | #define TARGET_MAP_LOCKED 0x08000 /* lock the mapping */ |
931 | e44a3e79 | aurel32 | #define TARGET_MAP_NORESERVE 0x10000 /* no check for reservations */ |
932 | e44a3e79 | aurel32 | #define TARGET_MAP_POPULATE 0x20000 /* pop (prefault) pagetables */ |
933 | e44a3e79 | aurel32 | #define TARGET_MAP_NONBLOCK 0x40000 /* do not block on IO */ |
934 | 7ec93196 | j_mayer | #else
|
935 | e44a3e79 | aurel32 | #define TARGET_MAP_FIXED 0x10 /* Interpret addr exactly */ |
936 | e44a3e79 | aurel32 | #define TARGET_MAP_ANONYMOUS 0x20 /* don't use a file */ |
937 | e44a3e79 | aurel32 | #define TARGET_MAP_GROWSDOWN 0x0100 /* stack-like segment */ |
938 | e44a3e79 | aurel32 | #define TARGET_MAP_DENYWRITE 0x0800 /* ETXTBSY */ |
939 | e44a3e79 | aurel32 | #define TARGET_MAP_EXECUTABLE 0x1000 /* mark it as an executable */ |
940 | 2521d698 | bellard | #define TARGET_MAP_LOCKED 0x2000 /* pages are locked */ |
941 | 2521d698 | bellard | #define TARGET_MAP_NORESERVE 0x4000 /* don't check for reservations */ |
942 | 540635ba | ths | #define TARGET_MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ |
943 | 540635ba | ths | #define TARGET_MAP_NONBLOCK 0x10000 /* do not block on IO */ |
944 | 7ec93196 | j_mayer | #endif
|
945 | 2521d698 | bellard | |
946 | d2fd1af7 | bellard | #if (defined(TARGET_I386) && defined(TARGET_ABI32)) || defined(TARGET_ARM) || defined(TARGET_CRIS)
|
947 | 2521d698 | bellard | struct target_stat {
|
948 | 2521d698 | bellard | unsigned short st_dev; |
949 | 2521d698 | bellard | unsigned short __pad1; |
950 | 992f48a0 | blueswir1 | abi_ulong st_ino; |
951 | 2521d698 | bellard | unsigned short st_mode; |
952 | 2521d698 | bellard | unsigned short st_nlink; |
953 | 2521d698 | bellard | unsigned short st_uid; |
954 | 2521d698 | bellard | unsigned short st_gid; |
955 | 2521d698 | bellard | unsigned short st_rdev; |
956 | 2521d698 | bellard | unsigned short __pad2; |
957 | 992f48a0 | blueswir1 | abi_ulong st_size; |
958 | 992f48a0 | blueswir1 | abi_ulong st_blksize; |
959 | 992f48a0 | blueswir1 | abi_ulong st_blocks; |
960 | 992f48a0 | blueswir1 | abi_ulong target_st_atime; |
961 | 992f48a0 | blueswir1 | abi_ulong __unused1; |
962 | 992f48a0 | blueswir1 | abi_ulong target_st_mtime; |
963 | 992f48a0 | blueswir1 | abi_ulong __unused2; |
964 | 992f48a0 | blueswir1 | abi_ulong target_st_ctime; |
965 | 992f48a0 | blueswir1 | abi_ulong __unused3; |
966 | 992f48a0 | blueswir1 | abi_ulong __unused4; |
967 | 992f48a0 | blueswir1 | abi_ulong __unused5; |
968 | 2521d698 | bellard | }; |
969 | 2521d698 | bellard | |
970 | 2521d698 | bellard | /* This matches struct stat64 in glibc2.1, hence the absolutely
|
971 | 2521d698 | bellard | * insane amounts of padding around dev_t's.
|
972 | 2521d698 | bellard | */
|
973 | 2521d698 | bellard | struct target_stat64 {
|
974 | 2521d698 | bellard | unsigned short st_dev; |
975 | 2521d698 | bellard | unsigned char __pad0[10]; |
976 | 2521d698 | bellard | |
977 | 2521d698 | bellard | #define TARGET_STAT64_HAS_BROKEN_ST_INO 1 |
978 | 992f48a0 | blueswir1 | abi_ulong __st_ino; |
979 | 2521d698 | bellard | |
980 | 2521d698 | bellard | unsigned int st_mode; |
981 | 2521d698 | bellard | unsigned int st_nlink; |
982 | 2521d698 | bellard | |
983 | 992f48a0 | blueswir1 | abi_ulong st_uid; |
984 | 992f48a0 | blueswir1 | abi_ulong st_gid; |
985 | 2521d698 | bellard | |
986 | 2521d698 | bellard | unsigned short st_rdev; |
987 | 2521d698 | bellard | unsigned char __pad3[10]; |
988 | 2521d698 | bellard | |
989 | 2521d698 | bellard | long long st_size; |
990 | 992f48a0 | blueswir1 | abi_ulong st_blksize; |
991 | 2521d698 | bellard | |
992 | 992f48a0 | blueswir1 | abi_ulong st_blocks; /* Number 512-byte blocks allocated. */
|
993 | 992f48a0 | blueswir1 | abi_ulong __pad4; /* future possible st_blocks high bits */
|
994 | 2521d698 | bellard | |
995 | 992f48a0 | blueswir1 | abi_ulong target_st_atime; |
996 | 992f48a0 | blueswir1 | abi_ulong __pad5; |
997 | 2521d698 | bellard | |
998 | 992f48a0 | blueswir1 | abi_ulong target_st_mtime; |
999 | 992f48a0 | blueswir1 | abi_ulong __pad6; |
1000 | 2521d698 | bellard | |
1001 | 992f48a0 | blueswir1 | abi_ulong target_st_ctime; |
1002 | 992f48a0 | blueswir1 | abi_ulong __pad7; /* will be high 32 bits of ctime someday */
|
1003 | 2521d698 | bellard | |
1004 | 2521d698 | bellard | unsigned long long st_ino; |
1005 | 2521d698 | bellard | } __attribute__((packed)); |
1006 | 2521d698 | bellard | |
1007 | ce4defa0 | pbrook | #ifdef TARGET_ARM
|
1008 | ce4defa0 | pbrook | struct target_eabi_stat64 {
|
1009 | ce4defa0 | pbrook | unsigned long long st_dev; |
1010 | ce4defa0 | pbrook | unsigned int __pad1; |
1011 | 992f48a0 | blueswir1 | abi_ulong __st_ino; |
1012 | ce4defa0 | pbrook | unsigned int st_mode; |
1013 | ce4defa0 | pbrook | unsigned int st_nlink; |
1014 | ce4defa0 | pbrook | |
1015 | 992f48a0 | blueswir1 | abi_ulong st_uid; |
1016 | 992f48a0 | blueswir1 | abi_ulong st_gid; |
1017 | ce4defa0 | pbrook | |
1018 | ce4defa0 | pbrook | unsigned long long st_rdev; |
1019 | ce4defa0 | pbrook | unsigned int __pad2[2]; |
1020 | ce4defa0 | pbrook | |
1021 | ce4defa0 | pbrook | long long st_size; |
1022 | 992f48a0 | blueswir1 | abi_ulong st_blksize; |
1023 | ce4defa0 | pbrook | unsigned int __pad3; |
1024 | ce4defa0 | pbrook | unsigned long long st_blocks; |
1025 | ce4defa0 | pbrook | |
1026 | 992f48a0 | blueswir1 | abi_ulong target_st_atime; |
1027 | 992f48a0 | blueswir1 | abi_ulong target_st_atime_nsec; |
1028 | ce4defa0 | pbrook | |
1029 | 992f48a0 | blueswir1 | abi_ulong target_st_mtime; |
1030 | 992f48a0 | blueswir1 | abi_ulong target_st_mtime_nsec; |
1031 | ce4defa0 | pbrook | |
1032 | 992f48a0 | blueswir1 | abi_ulong target_st_ctime; |
1033 | 992f48a0 | blueswir1 | abi_ulong target_st_ctime_nsec; |
1034 | ce4defa0 | pbrook | |
1035 | ce4defa0 | pbrook | unsigned long long st_ino; |
1036 | ce4defa0 | pbrook | } __attribute__ ((packed)); |
1037 | ce4defa0 | pbrook | #endif
|
1038 | ce4defa0 | pbrook | |
1039 | 992f48a0 | blueswir1 | #elif defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
|
1040 | 1b8dd648 | blueswir1 | struct target_stat {
|
1041 | 1b8dd648 | blueswir1 | unsigned int st_dev; |
1042 | 992f48a0 | blueswir1 | abi_ulong st_ino; |
1043 | 1b8dd648 | blueswir1 | unsigned int st_mode; |
1044 | 1b8dd648 | blueswir1 | unsigned int st_nlink; |
1045 | 1b8dd648 | blueswir1 | unsigned int st_uid; |
1046 | 1b8dd648 | blueswir1 | unsigned int st_gid; |
1047 | 1b8dd648 | blueswir1 | unsigned int st_rdev; |
1048 | 992f48a0 | blueswir1 | abi_long st_size; |
1049 | 992f48a0 | blueswir1 | abi_long target_st_atime; |
1050 | 992f48a0 | blueswir1 | abi_long target_st_mtime; |
1051 | 992f48a0 | blueswir1 | abi_long target_st_ctime; |
1052 | 992f48a0 | blueswir1 | abi_long st_blksize; |
1053 | 992f48a0 | blueswir1 | abi_long st_blocks; |
1054 | 992f48a0 | blueswir1 | abi_ulong __unused4[2];
|
1055 | 1b8dd648 | blueswir1 | }; |
1056 | 1b8dd648 | blueswir1 | |
1057 | 1b8dd648 | blueswir1 | struct target_stat64 {
|
1058 | 1b8dd648 | blueswir1 | unsigned char __pad0[6]; |
1059 | 1b8dd648 | blueswir1 | unsigned short st_dev; |
1060 | 1b8dd648 | blueswir1 | |
1061 | 1b8dd648 | blueswir1 | uint64_t st_ino; |
1062 | 1b8dd648 | blueswir1 | uint64_t st_nlink; |
1063 | 1b8dd648 | blueswir1 | |
1064 | 1b8dd648 | blueswir1 | unsigned int st_mode; |
1065 | 1b8dd648 | blueswir1 | |
1066 | 1b8dd648 | blueswir1 | unsigned int st_uid; |
1067 | 1b8dd648 | blueswir1 | unsigned int st_gid; |
1068 | 1b8dd648 | blueswir1 | |
1069 | 1b8dd648 | blueswir1 | unsigned char __pad2[6]; |
1070 | 1b8dd648 | blueswir1 | unsigned short st_rdev; |
1071 | 1b8dd648 | blueswir1 | |
1072 | 1b8dd648 | blueswir1 | int64_t st_size; |
1073 | 1b8dd648 | blueswir1 | int64_t st_blksize; |
1074 | 1b8dd648 | blueswir1 | |
1075 | 1b8dd648 | blueswir1 | unsigned char __pad4[4]; |
1076 | 1b8dd648 | blueswir1 | unsigned int st_blocks; |
1077 | 1b8dd648 | blueswir1 | |
1078 | 992f48a0 | blueswir1 | abi_ulong target_st_atime; |
1079 | 992f48a0 | blueswir1 | abi_ulong __unused1; |
1080 | 1b8dd648 | blueswir1 | |
1081 | 992f48a0 | blueswir1 | abi_ulong target_st_mtime; |
1082 | 992f48a0 | blueswir1 | abi_ulong __unused2; |
1083 | 1b8dd648 | blueswir1 | |
1084 | 992f48a0 | blueswir1 | abi_ulong target_st_ctime; |
1085 | 992f48a0 | blueswir1 | abi_ulong __unused3; |
1086 | 1b8dd648 | blueswir1 | |
1087 | 992f48a0 | blueswir1 | abi_ulong __unused4[3];
|
1088 | 1b8dd648 | blueswir1 | }; |
1089 | 1b8dd648 | blueswir1 | |
1090 | 3bfd9da1 | bellard | #elif defined(TARGET_SPARC)
|
1091 | 3bfd9da1 | bellard | |
1092 | 3bfd9da1 | bellard | struct target_stat {
|
1093 | 3bfd9da1 | bellard | unsigned short st_dev; |
1094 | 992f48a0 | blueswir1 | abi_ulong st_ino; |
1095 | 3bfd9da1 | bellard | unsigned short st_mode; |
1096 | 3bfd9da1 | bellard | short st_nlink;
|
1097 | 3bfd9da1 | bellard | unsigned short st_uid; |
1098 | 3bfd9da1 | bellard | unsigned short st_gid; |
1099 | 3bfd9da1 | bellard | unsigned short st_rdev; |
1100 | 992f48a0 | blueswir1 | abi_long st_size; |
1101 | 992f48a0 | blueswir1 | abi_long target_st_atime; |
1102 | 992f48a0 | blueswir1 | abi_ulong __unused1; |
1103 | 992f48a0 | blueswir1 | abi_long target_st_mtime; |
1104 | 992f48a0 | blueswir1 | abi_ulong __unused2; |
1105 | 992f48a0 | blueswir1 | abi_long target_st_ctime; |
1106 | 992f48a0 | blueswir1 | abi_ulong __unused3; |
1107 | 992f48a0 | blueswir1 | abi_long st_blksize; |
1108 | 992f48a0 | blueswir1 | abi_long st_blocks; |
1109 | 992f48a0 | blueswir1 | abi_ulong __unused4[2];
|
1110 | 3bfd9da1 | bellard | }; |
1111 | 3bfd9da1 | bellard | |
1112 | 3bfd9da1 | bellard | struct target_stat64 {
|
1113 | 3bfd9da1 | bellard | unsigned char __pad0[6]; |
1114 | 3bfd9da1 | bellard | unsigned short st_dev; |
1115 | 3bfd9da1 | bellard | |
1116 | 3bfd9da1 | bellard | uint64_t st_ino; |
1117 | 3bfd9da1 | bellard | |
1118 | 3bfd9da1 | bellard | unsigned int st_mode; |
1119 | 3bfd9da1 | bellard | unsigned int st_nlink; |
1120 | 3bfd9da1 | bellard | |
1121 | 3bfd9da1 | bellard | unsigned int st_uid; |
1122 | 3bfd9da1 | bellard | unsigned int st_gid; |
1123 | 3bfd9da1 | bellard | |
1124 | 3bfd9da1 | bellard | unsigned char __pad2[6]; |
1125 | 3bfd9da1 | bellard | unsigned short st_rdev; |
1126 | 3bfd9da1 | bellard | |
1127 | 3bfd9da1 | bellard | unsigned char __pad3[8]; |
1128 | 3bfd9da1 | bellard | |
1129 | 3bfd9da1 | bellard | int64_t st_size; |
1130 | 3bfd9da1 | bellard | unsigned int st_blksize; |
1131 | 3bfd9da1 | bellard | |
1132 | 3bfd9da1 | bellard | unsigned char __pad4[8]; |
1133 | 3bfd9da1 | bellard | unsigned int st_blocks; |
1134 | 3bfd9da1 | bellard | |
1135 | 3bfd9da1 | bellard | unsigned int target_st_atime; |
1136 | 3bfd9da1 | bellard | unsigned int __unused1; |
1137 | 3bfd9da1 | bellard | |
1138 | 3bfd9da1 | bellard | unsigned int target_st_mtime; |
1139 | 3bfd9da1 | bellard | unsigned int __unused2; |
1140 | 3bfd9da1 | bellard | |
1141 | 3bfd9da1 | bellard | unsigned int target_st_ctime; |
1142 | 3bfd9da1 | bellard | unsigned int __unused3; |
1143 | 3bfd9da1 | bellard | |
1144 | 3bfd9da1 | bellard | unsigned int __unused4; |
1145 | 3bfd9da1 | bellard | unsigned int __unused5; |
1146 | 3bfd9da1 | bellard | }; |
1147 | 3bfd9da1 | bellard | |
1148 | 67867308 | bellard | #elif defined(TARGET_PPC)
|
1149 | 67867308 | bellard | |
1150 | 67867308 | bellard | struct target_stat {
|
1151 | e32448e0 | j_mayer | abi_ulong st_dev; |
1152 | 992f48a0 | blueswir1 | abi_ulong st_ino; |
1153 | 325e651f | j_mayer | #if defined(TARGET_PPC64) && !defined(TARGET_ABI32)
|
1154 | e32448e0 | j_mayer | abi_ulong st_nlink; |
1155 | 325e651f | j_mayer | unsigned int st_mode; |
1156 | 325e651f | j_mayer | #else
|
1157 | 67867308 | bellard | unsigned int st_mode; |
1158 | 67867308 | bellard | unsigned short st_nlink; |
1159 | 325e651f | j_mayer | #endif
|
1160 | 67867308 | bellard | unsigned int st_uid; |
1161 | 67867308 | bellard | unsigned int st_gid; |
1162 | e32448e0 | j_mayer | abi_ulong st_rdev; |
1163 | 992f48a0 | blueswir1 | abi_ulong st_size; |
1164 | 992f48a0 | blueswir1 | abi_ulong st_blksize; |
1165 | 992f48a0 | blueswir1 | abi_ulong st_blocks; |
1166 | 992f48a0 | blueswir1 | abi_ulong target_st_atime; |
1167 | e32448e0 | j_mayer | abi_ulong target_st_atime_nsec; |
1168 | 992f48a0 | blueswir1 | abi_ulong target_st_mtime; |
1169 | e32448e0 | j_mayer | abi_ulong target_st_mtime_nsec; |
1170 | 992f48a0 | blueswir1 | abi_ulong target_st_ctime; |
1171 | e32448e0 | j_mayer | abi_ulong target_st_ctime_nsec; |
1172 | 992f48a0 | blueswir1 | abi_ulong __unused4; |
1173 | 992f48a0 | blueswir1 | abi_ulong __unused5; |
1174 | 325e651f | j_mayer | #if defined(TARGET_PPC64) && !defined(TARGET_ABI32)
|
1175 | 325e651f | j_mayer | abi_ulong __unused6; |
1176 | 325e651f | j_mayer | #endif
|
1177 | 67867308 | bellard | }; |
1178 | 67867308 | bellard | |
1179 | e1ce5e40 | aurel32 | struct __attribute__((__packed__)) target_stat64 {
|
1180 | 67867308 | bellard | unsigned long long st_dev; |
1181 | 67867308 | bellard | unsigned long long st_ino; |
1182 | 3bfd9da1 | bellard | unsigned int st_mode; |
1183 | 3bfd9da1 | bellard | unsigned int st_nlink; |
1184 | 67867308 | bellard | unsigned int st_uid; |
1185 | 67867308 | bellard | unsigned int st_gid; |
1186 | 3bfd9da1 | bellard | unsigned long long st_rdev; |
1187 | e1ce5e40 | aurel32 | unsigned long long __pad0; |
1188 | e32448e0 | j_mayer | long long st_size; |
1189 | e32448e0 | j_mayer | int st_blksize;
|
1190 | e32448e0 | j_mayer | long long st_blocks; /* Number 512-byte blocks allocated. */ |
1191 | e1ce5e40 | aurel32 | unsigned int __pad1; |
1192 | e32448e0 | j_mayer | int target_st_atime;
|
1193 | e32448e0 | j_mayer | unsigned int target_st_atime_nsec; |
1194 | e32448e0 | j_mayer | int target_st_mtime;
|
1195 | e32448e0 | j_mayer | unsigned int target_st_mtime_nsec; |
1196 | e32448e0 | j_mayer | int target_st_ctime;
|
1197 | e32448e0 | j_mayer | unsigned int target_st_ctime_nsec; |
1198 | e32448e0 | j_mayer | unsigned int __unused4; |
1199 | e32448e0 | j_mayer | unsigned int __unused5; |
1200 | 67867308 | bellard | }; |
1201 | 67867308 | bellard | |
1202 | b779e29e | Edgar E. Iglesias | #elif defined(TARGET_MICROBLAZE)
|
1203 | b779e29e | Edgar E. Iglesias | |
1204 | b779e29e | Edgar E. Iglesias | struct target_stat {
|
1205 | b779e29e | Edgar E. Iglesias | abi_ulong st_dev; |
1206 | b779e29e | Edgar E. Iglesias | abi_ulong st_ino; |
1207 | b779e29e | Edgar E. Iglesias | unsigned int st_mode; |
1208 | b779e29e | Edgar E. Iglesias | unsigned short st_nlink; |
1209 | b779e29e | Edgar E. Iglesias | unsigned int st_uid; |
1210 | b779e29e | Edgar E. Iglesias | unsigned int st_gid; |
1211 | b779e29e | Edgar E. Iglesias | abi_ulong st_rdev; |
1212 | b779e29e | Edgar E. Iglesias | abi_ulong st_size; |
1213 | b779e29e | Edgar E. Iglesias | abi_ulong st_blksize; |
1214 | b779e29e | Edgar E. Iglesias | abi_ulong st_blocks; |
1215 | b779e29e | Edgar E. Iglesias | abi_ulong target_st_atime; |
1216 | b779e29e | Edgar E. Iglesias | abi_ulong target_st_atime_nsec; |
1217 | b779e29e | Edgar E. Iglesias | abi_ulong target_st_mtime; |
1218 | b779e29e | Edgar E. Iglesias | abi_ulong target_st_mtime_nsec; |
1219 | b779e29e | Edgar E. Iglesias | abi_ulong target_st_ctime; |
1220 | b779e29e | Edgar E. Iglesias | abi_ulong target_st_ctime_nsec; |
1221 | b779e29e | Edgar E. Iglesias | abi_ulong __unused4; |
1222 | b779e29e | Edgar E. Iglesias | abi_ulong __unused5; |
1223 | b779e29e | Edgar E. Iglesias | }; |
1224 | b779e29e | Edgar E. Iglesias | |
1225 | b779e29e | Edgar E. Iglesias | /* FIXME: Microblaze no-mmu user-space has a difference stat64 layout... */
|
1226 | b779e29e | Edgar E. Iglesias | struct __attribute__((__packed__)) target_stat64 {
|
1227 | b779e29e | Edgar E. Iglesias | uint64_t st_dev; |
1228 | b779e29e | Edgar E. Iglesias | uint64_t st_ino; |
1229 | b779e29e | Edgar E. Iglesias | uint32_t st_mode; |
1230 | b779e29e | Edgar E. Iglesias | uint32_t st_nlink; |
1231 | b779e29e | Edgar E. Iglesias | uint32_t st_uid; |
1232 | b779e29e | Edgar E. Iglesias | uint32_t st_gid; |
1233 | b779e29e | Edgar E. Iglesias | uint64_t st_rdev; |
1234 | 21ebeb23 | Edgar E. Iglesias | uint64_t __pad1; |
1235 | b779e29e | Edgar E. Iglesias | |
1236 | b779e29e | Edgar E. Iglesias | int64_t st_size; |
1237 | 21ebeb23 | Edgar E. Iglesias | int32_t st_blksize; |
1238 | 21ebeb23 | Edgar E. Iglesias | uint32_t __pad2; |
1239 | b779e29e | Edgar E. Iglesias | int64_t st_blocks; /* Number 512-byte blocks allocated. */
|
1240 | b779e29e | Edgar E. Iglesias | |
1241 | b779e29e | Edgar E. Iglesias | int target_st_atime;
|
1242 | b779e29e | Edgar E. Iglesias | unsigned int target_st_atime_nsec; |
1243 | b779e29e | Edgar E. Iglesias | int target_st_mtime;
|
1244 | b779e29e | Edgar E. Iglesias | unsigned int target_st_mtime_nsec; |
1245 | b779e29e | Edgar E. Iglesias | int target_st_ctime;
|
1246 | b779e29e | Edgar E. Iglesias | unsigned int target_st_ctime_nsec; |
1247 | b779e29e | Edgar E. Iglesias | uint32_t __unused4; |
1248 | b779e29e | Edgar E. Iglesias | uint32_t __unused5; |
1249 | b779e29e | Edgar E. Iglesias | }; |
1250 | b779e29e | Edgar E. Iglesias | |
1251 | e6e5906b | pbrook | #elif defined(TARGET_M68K)
|
1252 | e6e5906b | pbrook | |
1253 | e6e5906b | pbrook | struct target_stat {
|
1254 | e6e5906b | pbrook | unsigned short st_dev; |
1255 | e6e5906b | pbrook | unsigned short __pad1; |
1256 | 992f48a0 | blueswir1 | abi_ulong st_ino; |
1257 | e6e5906b | pbrook | unsigned short st_mode; |
1258 | e6e5906b | pbrook | unsigned short st_nlink; |
1259 | e6e5906b | pbrook | unsigned short st_uid; |
1260 | e6e5906b | pbrook | unsigned short st_gid; |
1261 | e6e5906b | pbrook | unsigned short st_rdev; |
1262 | e6e5906b | pbrook | unsigned short __pad2; |
1263 | 992f48a0 | blueswir1 | abi_ulong st_size; |
1264 | 992f48a0 | blueswir1 | abi_ulong st_blksize; |
1265 | 992f48a0 | blueswir1 | abi_ulong st_blocks; |
1266 | 992f48a0 | blueswir1 | abi_ulong target_st_atime; |
1267 | 992f48a0 | blueswir1 | abi_ulong __unused1; |
1268 | 992f48a0 | blueswir1 | abi_ulong target_st_mtime; |
1269 | 992f48a0 | blueswir1 | abi_ulong __unused2; |
1270 | 992f48a0 | blueswir1 | abi_ulong target_st_ctime; |
1271 | 992f48a0 | blueswir1 | abi_ulong __unused3; |
1272 | 992f48a0 | blueswir1 | abi_ulong __unused4; |
1273 | 992f48a0 | blueswir1 | abi_ulong __unused5; |
1274 | e6e5906b | pbrook | }; |
1275 | e6e5906b | pbrook | |
1276 | e6e5906b | pbrook | /* This matches struct stat64 in glibc2.1, hence the absolutely
|
1277 | e6e5906b | pbrook | * insane amounts of padding around dev_t's.
|
1278 | e6e5906b | pbrook | */
|
1279 | e6e5906b | pbrook | struct target_stat64 {
|
1280 | e6e5906b | pbrook | unsigned long long st_dev; |
1281 | e6e5906b | pbrook | unsigned char __pad1[2]; |
1282 | e6e5906b | pbrook | |
1283 | e6e5906b | pbrook | #define TARGET_STAT64_HAS_BROKEN_ST_INO 1 |
1284 | 992f48a0 | blueswir1 | abi_ulong __st_ino; |
1285 | e6e5906b | pbrook | |
1286 | e6e5906b | pbrook | unsigned int st_mode; |
1287 | e6e5906b | pbrook | unsigned int st_nlink; |
1288 | e6e5906b | pbrook | |
1289 | 992f48a0 | blueswir1 | abi_ulong st_uid; |
1290 | 992f48a0 | blueswir1 | abi_ulong st_gid; |
1291 | e6e5906b | pbrook | |
1292 | e6e5906b | pbrook | unsigned long long st_rdev; |
1293 | e6e5906b | pbrook | unsigned char __pad3[2]; |
1294 | e6e5906b | pbrook | |
1295 | e6e5906b | pbrook | long long st_size; |
1296 | 992f48a0 | blueswir1 | abi_ulong st_blksize; |
1297 | e6e5906b | pbrook | |
1298 | 992f48a0 | blueswir1 | abi_ulong __pad4; /* future possible st_blocks high bits */
|
1299 | 992f48a0 | blueswir1 | abi_ulong st_blocks; /* Number 512-byte blocks allocated. */
|
1300 | e6e5906b | pbrook | |
1301 | 992f48a0 | blueswir1 | abi_ulong target_st_atime; |
1302 | 992f48a0 | blueswir1 | abi_ulong target_st_atime_nsec; |
1303 | e6e5906b | pbrook | |
1304 | 992f48a0 | blueswir1 | abi_ulong target_st_mtime; |
1305 | 992f48a0 | blueswir1 | abi_ulong target_st_mtime_nsec; |
1306 | e6e5906b | pbrook | |
1307 | 992f48a0 | blueswir1 | abi_ulong target_st_ctime; |
1308 | 992f48a0 | blueswir1 | abi_ulong target_st_ctime_nsec; |
1309 | e6e5906b | pbrook | |
1310 | e6e5906b | pbrook | unsigned long long st_ino; |
1311 | e6e5906b | pbrook | } __attribute__((packed)); |
1312 | e6e5906b | pbrook | |
1313 | d26bc211 | ths | #elif defined(TARGET_ABI_MIPSN64)
|
1314 | 540635ba | ths | |
1315 | 540635ba | ths | /* The memory layout is the same as of struct stat64 of the 32-bit kernel. */
|
1316 | 540635ba | ths | struct target_stat {
|
1317 | 540635ba | ths | unsigned int st_dev; |
1318 | 540635ba | ths | unsigned int st_pad0[3]; /* Reserved for st_dev expansion */ |
1319 | 540635ba | ths | |
1320 | 992f48a0 | blueswir1 | abi_ulong st_ino; |
1321 | 540635ba | ths | |
1322 | 540635ba | ths | unsigned int st_mode; |
1323 | 540635ba | ths | unsigned int st_nlink; |
1324 | 540635ba | ths | |
1325 | 540635ba | ths | int st_uid;
|
1326 | 540635ba | ths | int st_gid;
|
1327 | 540635ba | ths | |
1328 | 540635ba | ths | unsigned int st_rdev; |
1329 | 540635ba | ths | unsigned int st_pad1[3]; /* Reserved for st_rdev expansion */ |
1330 | 540635ba | ths | |
1331 | 992f48a0 | blueswir1 | abi_ulong st_size; |
1332 | 540635ba | ths | |
1333 | 540635ba | ths | /*
|
1334 | 540635ba | ths | * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
|
1335 | 540635ba | ths | * but we don't have it under Linux.
|
1336 | 540635ba | ths | */
|
1337 | 540635ba | ths | unsigned int target_st_atime; |
1338 | 540635ba | ths | unsigned int target_st_atime_nsec; |
1339 | 540635ba | ths | |
1340 | 540635ba | ths | unsigned int target_st_mtime; |
1341 | 540635ba | ths | unsigned int target_st_mtime_nsec; |
1342 | 540635ba | ths | |
1343 | 540635ba | ths | unsigned int target_st_ctime; |
1344 | 540635ba | ths | unsigned int target_st_ctime_nsec; |
1345 | 540635ba | ths | |
1346 | 540635ba | ths | unsigned int st_blksize; |
1347 | 540635ba | ths | unsigned int st_pad2; |
1348 | 540635ba | ths | |
1349 | 992f48a0 | blueswir1 | abi_ulong st_blocks; |
1350 | 540635ba | ths | }; |
1351 | 540635ba | ths | |
1352 | d26bc211 | ths | #elif defined(TARGET_ABI_MIPSN32)
|
1353 | 540635ba | ths | |
1354 | 540635ba | ths | struct target_stat {
|
1355 | 540635ba | ths | unsigned st_dev;
|
1356 | 540635ba | ths | int st_pad1[3]; /* Reserved for network id */ |
1357 | 540635ba | ths | unsigned int st_ino; |
1358 | 540635ba | ths | unsigned int st_mode; |
1359 | 540635ba | ths | unsigned int st_nlink; |
1360 | 540635ba | ths | int st_uid;
|
1361 | 540635ba | ths | int st_gid;
|
1362 | 540635ba | ths | unsigned st_rdev;
|
1363 | 540635ba | ths | unsigned int st_pad2[2]; |
1364 | 540635ba | ths | unsigned int st_size; |
1365 | 540635ba | ths | unsigned int st_pad3; |
1366 | 540635ba | ths | /*
|
1367 | 540635ba | ths | * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
|
1368 | 540635ba | ths | * but we don't have it under Linux.
|
1369 | 540635ba | ths | */
|
1370 | 540635ba | ths | unsigned int target_st_atime; |
1371 | 540635ba | ths | unsigned int target_st_atime_nsec; |
1372 | 540635ba | ths | unsigned int target_st_mtime; |
1373 | 540635ba | ths | unsigned int target_st_mtime_nsec; |
1374 | 540635ba | ths | unsigned int target_st_ctime; |
1375 | 540635ba | ths | unsigned int target_st_ctime_nsec; |
1376 | 540635ba | ths | unsigned int st_blksize; |
1377 | 540635ba | ths | unsigned int st_blocks; |
1378 | 540635ba | ths | unsigned int st_pad4[14]; |
1379 | 540635ba | ths | }; |
1380 | 540635ba | ths | |
1381 | 540635ba | ths | /*
|
1382 | 540635ba | ths | * This matches struct stat64 in glibc2.1, hence the absolutely insane
|
1383 | 540635ba | ths | * amounts of padding around dev_t's. The memory layout is the same as of
|
1384 | 540635ba | ths | * struct stat of the 64-bit kernel.
|
1385 | 540635ba | ths | */
|
1386 | 540635ba | ths | |
1387 | 540635ba | ths | struct target_stat64 {
|
1388 | 540635ba | ths | unsigned int st_dev; |
1389 | 540635ba | ths | unsigned int st_pad0[3]; /* Reserved for st_dev expansion */ |
1390 | 540635ba | ths | |
1391 | 540635ba | ths | target_ulong st_ino; |
1392 | 540635ba | ths | |
1393 | 540635ba | ths | unsigned int st_mode; |
1394 | 540635ba | ths | unsigned int st_nlink; |
1395 | 540635ba | ths | |
1396 | 540635ba | ths | int st_uid;
|
1397 | 540635ba | ths | int st_gid;
|
1398 | 540635ba | ths | |
1399 | 540635ba | ths | unsigned int st_rdev; |
1400 | 540635ba | ths | unsigned int st_pad1[3]; /* Reserved for st_rdev expansion */ |
1401 | 540635ba | ths | |
1402 | 540635ba | ths | int st_size;
|
1403 | 540635ba | ths | |
1404 | 540635ba | ths | /*
|
1405 | 540635ba | ths | * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
|
1406 | 540635ba | ths | * but we don't have it under Linux.
|
1407 | 540635ba | ths | */
|
1408 | 540635ba | ths | int target_st_atime;
|
1409 | 540635ba | ths | unsigned int target_st_atime_nsec; /* Reserved for st_atime expansion */ |
1410 | 540635ba | ths | |
1411 | 540635ba | ths | int target_st_mtime;
|
1412 | 540635ba | ths | unsigned int target_st_mtime_nsec; /* Reserved for st_mtime expansion */ |
1413 | 540635ba | ths | |
1414 | 540635ba | ths | int target_st_ctime;
|
1415 | 540635ba | ths | unsigned int target_st_ctime_nsec; /* Reserved for st_ctime expansion */ |
1416 | 540635ba | ths | |
1417 | 540635ba | ths | unsigned int st_blksize; |
1418 | 540635ba | ths | unsigned int st_pad2; |
1419 | 540635ba | ths | |
1420 | 540635ba | ths | int st_blocks;
|
1421 | 540635ba | ths | }; |
1422 | 540635ba | ths | |
1423 | d26bc211 | ths | #elif defined(TARGET_ABI_MIPSO32)
|
1424 | 048f6b4d | bellard | |
1425 | 048f6b4d | bellard | struct target_stat {
|
1426 | 048f6b4d | bellard | unsigned st_dev;
|
1427 | 992f48a0 | blueswir1 | abi_long st_pad1[3]; /* Reserved for network id */ |
1428 | 992f48a0 | blueswir1 | abi_ulong st_ino; |
1429 | 048f6b4d | bellard | unsigned int st_mode; |
1430 | 048f6b4d | bellard | unsigned int st_nlink; |
1431 | 048f6b4d | bellard | int st_uid;
|
1432 | 048f6b4d | bellard | int st_gid;
|
1433 | 048f6b4d | bellard | unsigned st_rdev;
|
1434 | 992f48a0 | blueswir1 | abi_long st_pad2[2];
|
1435 | 992f48a0 | blueswir1 | abi_long st_size; |
1436 | 992f48a0 | blueswir1 | abi_long st_pad3; |
1437 | 048f6b4d | bellard | /*
|
1438 | 048f6b4d | bellard | * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
|
1439 | 048f6b4d | bellard | * but we don't have it under Linux.
|
1440 | 048f6b4d | bellard | */
|
1441 | 992f48a0 | blueswir1 | abi_long target_st_atime; |
1442 | 992f48a0 | blueswir1 | abi_long target_st_atime_nsec; |
1443 | 992f48a0 | blueswir1 | abi_long target_st_mtime; |
1444 | 992f48a0 | blueswir1 | abi_long target_st_mtime_nsec; |
1445 | 992f48a0 | blueswir1 | abi_long target_st_ctime; |
1446 | 992f48a0 | blueswir1 | abi_long target_st_ctime_nsec; |
1447 | 992f48a0 | blueswir1 | abi_long st_blksize; |
1448 | 992f48a0 | blueswir1 | abi_long st_blocks; |
1449 | 992f48a0 | blueswir1 | abi_long st_pad4[14];
|
1450 | 048f6b4d | bellard | }; |
1451 | 048f6b4d | bellard | |
1452 | 048f6b4d | bellard | /*
|
1453 | 048f6b4d | bellard | * This matches struct stat64 in glibc2.1, hence the absolutely insane
|
1454 | 048f6b4d | bellard | * amounts of padding around dev_t's. The memory layout is the same as of
|
1455 | 048f6b4d | bellard | * struct stat of the 64-bit kernel.
|
1456 | 048f6b4d | bellard | */
|
1457 | 048f6b4d | bellard | |
1458 | 048f6b4d | bellard | struct target_stat64 {
|
1459 | 992f48a0 | blueswir1 | abi_ulong st_dev; |
1460 | 992f48a0 | blueswir1 | abi_ulong st_pad0[3]; /* Reserved for st_dev expansion */ |
1461 | 048f6b4d | bellard | |
1462 | 048f6b4d | bellard | uint64_t st_ino; |
1463 | 048f6b4d | bellard | |
1464 | 048f6b4d | bellard | unsigned int st_mode; |
1465 | 048f6b4d | bellard | unsigned int st_nlink; |
1466 | 048f6b4d | bellard | |
1467 | 048f6b4d | bellard | int st_uid;
|
1468 | 048f6b4d | bellard | int st_gid;
|
1469 | 048f6b4d | bellard | |
1470 | 992f48a0 | blueswir1 | abi_ulong st_rdev; |
1471 | 992f48a0 | blueswir1 | abi_ulong st_pad1[3]; /* Reserved for st_rdev expansion */ |
1472 | 048f6b4d | bellard | |
1473 | 048f6b4d | bellard | int64_t st_size; |
1474 | 048f6b4d | bellard | |
1475 | 048f6b4d | bellard | /*
|
1476 | 048f6b4d | bellard | * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
|
1477 | 048f6b4d | bellard | * but we don't have it under Linux.
|
1478 | 048f6b4d | bellard | */
|
1479 | 992f48a0 | blueswir1 | abi_long target_st_atime; |
1480 | 992f48a0 | blueswir1 | abi_ulong target_st_atime_nsec; /* Reserved for st_atime expansion */
|
1481 | 048f6b4d | bellard | |
1482 | 992f48a0 | blueswir1 | abi_long target_st_mtime; |
1483 | 992f48a0 | blueswir1 | abi_ulong target_st_mtime_nsec; /* Reserved for st_mtime expansion */
|
1484 | 048f6b4d | bellard | |
1485 | 992f48a0 | blueswir1 | abi_long target_st_ctime; |
1486 | 992f48a0 | blueswir1 | abi_ulong target_st_ctime_nsec; /* Reserved for st_ctime expansion */
|
1487 | 048f6b4d | bellard | |
1488 | 992f48a0 | blueswir1 | abi_ulong st_blksize; |
1489 | 992f48a0 | blueswir1 | abi_ulong st_pad2; |
1490 | 048f6b4d | bellard | |
1491 | 048f6b4d | bellard | int64_t st_blocks; |
1492 | 048f6b4d | bellard | }; |
1493 | 7a3148a9 | j_mayer | |
1494 | 7a3148a9 | j_mayer | #elif defined(TARGET_ALPHA)
|
1495 | 7a3148a9 | j_mayer | |
1496 | 7a3148a9 | j_mayer | struct target_stat {
|
1497 | 7a3148a9 | j_mayer | unsigned int st_dev; |
1498 | 7a3148a9 | j_mayer | unsigned int st_ino; |
1499 | 7a3148a9 | j_mayer | unsigned int st_mode; |
1500 | 7a3148a9 | j_mayer | unsigned int st_nlink; |
1501 | 7a3148a9 | j_mayer | unsigned int st_uid; |
1502 | 7a3148a9 | j_mayer | unsigned int st_gid; |
1503 | 7a3148a9 | j_mayer | unsigned int st_rdev; |
1504 | 992f48a0 | blueswir1 | abi_long st_size; |
1505 | 992f48a0 | blueswir1 | abi_ulong target_st_atime; |
1506 | 992f48a0 | blueswir1 | abi_ulong target_st_mtime; |
1507 | 992f48a0 | blueswir1 | abi_ulong target_st_ctime; |
1508 | 7a3148a9 | j_mayer | unsigned int st_blksize; |
1509 | 7a3148a9 | j_mayer | unsigned int st_blocks; |
1510 | 7a3148a9 | j_mayer | unsigned int st_flags; |
1511 | 7a3148a9 | j_mayer | unsigned int st_gen; |
1512 | 7a3148a9 | j_mayer | }; |
1513 | 7a3148a9 | j_mayer | |
1514 | 7a3148a9 | j_mayer | struct target_stat64 {
|
1515 | 992f48a0 | blueswir1 | abi_ulong st_dev; |
1516 | 992f48a0 | blueswir1 | abi_ulong st_ino; |
1517 | 992f48a0 | blueswir1 | abi_ulong st_rdev; |
1518 | 992f48a0 | blueswir1 | abi_long st_size; |
1519 | 992f48a0 | blueswir1 | abi_ulong st_blocks; |
1520 | 7a3148a9 | j_mayer | |
1521 | 7a3148a9 | j_mayer | unsigned int st_mode; |
1522 | 7a3148a9 | j_mayer | unsigned int st_uid; |
1523 | 7a3148a9 | j_mayer | unsigned int st_gid; |
1524 | 7a3148a9 | j_mayer | unsigned int st_blksize; |
1525 | 7a3148a9 | j_mayer | unsigned int st_nlink; |
1526 | 7a3148a9 | j_mayer | unsigned int __pad0; |
1527 | 7a3148a9 | j_mayer | |
1528 | 992f48a0 | blueswir1 | abi_ulong target_st_atime; |
1529 | 992f48a0 | blueswir1 | abi_ulong target_st_atime_nsec; |
1530 | 992f48a0 | blueswir1 | abi_ulong target_st_mtime; |
1531 | 992f48a0 | blueswir1 | abi_ulong target_st_mtime_nsec; |
1532 | 992f48a0 | blueswir1 | abi_ulong target_st_ctime; |
1533 | 992f48a0 | blueswir1 | abi_ulong target_st_ctime_nsec; |
1534 | 992f48a0 | blueswir1 | abi_long __unused[3];
|
1535 | 7a3148a9 | j_mayer | }; |
1536 | 7a3148a9 | j_mayer | |
1537 | 6db45e65 | ths | #elif defined(TARGET_SH4)
|
1538 | 6db45e65 | ths | |
1539 | 6db45e65 | ths | struct target_stat {
|
1540 | 992f48a0 | blueswir1 | abi_ulong st_dev; |
1541 | 992f48a0 | blueswir1 | abi_ulong st_ino; |
1542 | 6db45e65 | ths | unsigned short st_mode; |
1543 | 6db45e65 | ths | unsigned short st_nlink; |
1544 | 6db45e65 | ths | unsigned short st_uid; |
1545 | 6db45e65 | ths | unsigned short st_gid; |
1546 | 992f48a0 | blueswir1 | abi_ulong st_rdev; |
1547 | 992f48a0 | blueswir1 | abi_ulong st_size; |
1548 | 992f48a0 | blueswir1 | abi_ulong st_blksize; |
1549 | 992f48a0 | blueswir1 | abi_ulong st_blocks; |
1550 | 992f48a0 | blueswir1 | abi_ulong target_st_atime; |
1551 | 992f48a0 | blueswir1 | abi_ulong target_st_atime_nsec; |
1552 | 992f48a0 | blueswir1 | abi_ulong target_st_mtime; |
1553 | 992f48a0 | blueswir1 | abi_ulong target_st_mtime_nsec; |
1554 | 992f48a0 | blueswir1 | abi_ulong target_st_ctime; |
1555 | 992f48a0 | blueswir1 | abi_ulong target_st_ctime_nsec; |
1556 | 992f48a0 | blueswir1 | abi_ulong __unused4; |
1557 | 992f48a0 | blueswir1 | abi_ulong __unused5; |
1558 | 6db45e65 | ths | }; |
1559 | 6db45e65 | ths | |
1560 | 6db45e65 | ths | /* This matches struct stat64 in glibc2.1, hence the absolutely
|
1561 | 6db45e65 | ths | * insane amounts of padding around dev_t's.
|
1562 | 6db45e65 | ths | */
|
1563 | 91bd8ce9 | aurel32 | struct __attribute__((__packed__)) target_stat64 {
|
1564 | 6db45e65 | ths | unsigned long long st_dev; |
1565 | 6db45e65 | ths | unsigned char __pad0[4]; |
1566 | 6db45e65 | ths | |
1567 | 6db45e65 | ths | #define TARGET_STAT64_HAS_BROKEN_ST_INO 1 |
1568 | 992f48a0 | blueswir1 | abi_ulong __st_ino; |
1569 | 6db45e65 | ths | |
1570 | 6db45e65 | ths | unsigned int st_mode; |
1571 | 6db45e65 | ths | unsigned int st_nlink; |
1572 | 6db45e65 | ths | |
1573 | 992f48a0 | blueswir1 | abi_ulong st_uid; |
1574 | 992f48a0 | blueswir1 | abi_ulong st_gid; |
1575 | 6db45e65 | ths | |
1576 | 6db45e65 | ths | unsigned long long st_rdev; |
1577 | 6db45e65 | ths | unsigned char __pad3[4]; |
1578 | 6db45e65 | ths | |
1579 | 6db45e65 | ths | long long st_size; |
1580 | 992f48a0 | blueswir1 | abi_ulong st_blksize; |
1581 | 6db45e65 | ths | |
1582 | 6db45e65 | ths | unsigned long long st_blocks; /* Number 512-byte blocks allocated. */ |
1583 | 6db45e65 | ths | |
1584 | 992f48a0 | blueswir1 | abi_ulong target_st_atime; |
1585 | 992f48a0 | blueswir1 | abi_ulong target_st_atime_nsec; |
1586 | 6db45e65 | ths | |
1587 | 992f48a0 | blueswir1 | abi_ulong target_st_mtime; |
1588 | 992f48a0 | blueswir1 | abi_ulong target_st_mtime_nsec; |
1589 | 6db45e65 | ths | |
1590 | 992f48a0 | blueswir1 | abi_ulong target_st_ctime; |
1591 | 992f48a0 | blueswir1 | abi_ulong target_st_ctime_nsec; |
1592 | 6db45e65 | ths | |
1593 | 6db45e65 | ths | unsigned long long st_ino; |
1594 | 6db45e65 | ths | }; |
1595 | 6db45e65 | ths | |
1596 | d2fd1af7 | bellard | #elif defined(TARGET_I386) && !defined(TARGET_ABI32)
|
1597 | d2fd1af7 | bellard | struct target_stat {
|
1598 | d2fd1af7 | bellard | abi_ulong st_dev; |
1599 | d2fd1af7 | bellard | abi_ulong st_ino; |
1600 | d2fd1af7 | bellard | abi_ulong st_nlink; |
1601 | d2fd1af7 | bellard | |
1602 | d2fd1af7 | bellard | unsigned int st_mode; |
1603 | d2fd1af7 | bellard | unsigned int st_uid; |
1604 | d2fd1af7 | bellard | unsigned int st_gid; |
1605 | d2fd1af7 | bellard | unsigned int __pad0; |
1606 | d2fd1af7 | bellard | abi_ulong st_rdev; |
1607 | d2fd1af7 | bellard | abi_long st_size; |
1608 | d2fd1af7 | bellard | abi_long st_blksize; |
1609 | d2fd1af7 | bellard | abi_long st_blocks; /* Number 512-byte blocks allocated. */
|
1610 | d2fd1af7 | bellard | |
1611 | d2fd1af7 | bellard | abi_ulong target_st_atime; |
1612 | d2fd1af7 | bellard | abi_ulong target_st_atime_nsec; |
1613 | d2fd1af7 | bellard | abi_ulong target_st_mtime; |
1614 | d2fd1af7 | bellard | abi_ulong target_st_mtime_nsec; |
1615 | d2fd1af7 | bellard | abi_ulong target_st_ctime; |
1616 | d2fd1af7 | bellard | abi_ulong target_st_ctime_nsec; |
1617 | d2fd1af7 | bellard | |
1618 | d2fd1af7 | bellard | abi_long __unused[3];
|
1619 | d2fd1af7 | bellard | }; |
1620 | 048f6b4d | bellard | #else
|
1621 | 048f6b4d | bellard | #error unsupported CPU
|
1622 | 048f6b4d | bellard | #endif
|
1623 | 2521d698 | bellard | |
1624 | 4ce6f8de | ths | typedef struct { |
1625 | 4ce6f8de | ths | int val[2]; |
1626 | 4ce6f8de | ths | } target_fsid_t; |
1627 | 4ce6f8de | ths | |
1628 | 56c8f68f | bellard | #ifdef TARGET_MIPS
|
1629 | d26bc211 | ths | #ifdef TARGET_ABI_MIPSN32
|
1630 | 540635ba | ths | struct target_statfs {
|
1631 | 540635ba | ths | int32_t f_type; |
1632 | 540635ba | ths | int32_t f_bsize; |
1633 | 540635ba | ths | int32_t f_frsize; /* Fragment size - unsupported */
|
1634 | 540635ba | ths | int32_t f_blocks; |
1635 | 540635ba | ths | int32_t f_bfree; |
1636 | 540635ba | ths | int32_t f_files; |
1637 | 540635ba | ths | int32_t f_ffree; |
1638 | 540635ba | ths | int32_t f_bavail; |
1639 | 540635ba | ths | |
1640 | 540635ba | ths | /* Linux specials */
|
1641 | 540635ba | ths | target_fsid_t f_fsid; |
1642 | 540635ba | ths | int32_t f_namelen; |
1643 | 540635ba | ths | int32_t f_spare[6];
|
1644 | 540635ba | ths | }; |
1645 | 540635ba | ths | #else
|
1646 | 56c8f68f | bellard | struct target_statfs {
|
1647 | 992f48a0 | blueswir1 | abi_long f_type; |
1648 | 992f48a0 | blueswir1 | abi_long f_bsize; |
1649 | 992f48a0 | blueswir1 | abi_long f_frsize; /* Fragment size - unsupported */
|
1650 | 992f48a0 | blueswir1 | abi_long f_blocks; |
1651 | 992f48a0 | blueswir1 | abi_long f_bfree; |
1652 | 992f48a0 | blueswir1 | abi_long f_files; |
1653 | 992f48a0 | blueswir1 | abi_long f_ffree; |
1654 | 992f48a0 | blueswir1 | abi_long f_bavail; |
1655 | 56c8f68f | bellard | |
1656 | 56c8f68f | bellard | /* Linux specials */
|
1657 | 4ce6f8de | ths | target_fsid_t f_fsid; |
1658 | 992f48a0 | blueswir1 | abi_long f_namelen; |
1659 | 992f48a0 | blueswir1 | abi_long f_spare[6];
|
1660 | 56c8f68f | bellard | }; |
1661 | 540635ba | ths | #endif
|
1662 | 56c8f68f | bellard | |
1663 | 56c8f68f | bellard | struct target_statfs64 {
|
1664 | 56c8f68f | bellard | uint32_t f_type; |
1665 | 56c8f68f | bellard | uint32_t f_bsize; |
1666 | 56c8f68f | bellard | uint32_t f_frsize; /* Fragment size - unsupported */
|
1667 | 56c8f68f | bellard | uint32_t __pad; |
1668 | 56c8f68f | bellard | uint64_t f_blocks; |
1669 | 56c8f68f | bellard | uint64_t f_bfree; |
1670 | 56c8f68f | bellard | uint64_t f_files; |
1671 | 56c8f68f | bellard | uint64_t f_ffree; |
1672 | 56c8f68f | bellard | uint64_t f_bavail; |
1673 | 4ce6f8de | ths | target_fsid_t f_fsid; |
1674 | 56c8f68f | bellard | uint32_t f_namelen; |
1675 | 56c8f68f | bellard | uint32_t f_spare[6];
|
1676 | 56c8f68f | bellard | }; |
1677 | c4d10628 | balrog | #elif (defined(TARGET_PPC64) || defined(TARGET_X86_64) || \
|
1678 | c4d10628 | balrog | defined(TARGET_SPARC64)) && !defined(TARGET_ABI32) |
1679 | 325e651f | j_mayer | struct target_statfs {
|
1680 | 325e651f | j_mayer | abi_long f_type; |
1681 | 325e651f | j_mayer | abi_long f_bsize; |
1682 | 325e651f | j_mayer | abi_long f_blocks; |
1683 | 325e651f | j_mayer | abi_long f_bfree; |
1684 | 325e651f | j_mayer | abi_long f_bavail; |
1685 | 325e651f | j_mayer | abi_long f_files; |
1686 | 325e651f | j_mayer | abi_long f_ffree; |
1687 | 325e651f | j_mayer | target_fsid_t f_fsid; |
1688 | 325e651f | j_mayer | abi_long f_namelen; |
1689 | 325e651f | j_mayer | abi_long f_frsize; |
1690 | 325e651f | j_mayer | abi_long f_spare[5];
|
1691 | 325e651f | j_mayer | }; |
1692 | 325e651f | j_mayer | |
1693 | 325e651f | j_mayer | struct target_statfs64 {
|
1694 | 325e651f | j_mayer | abi_long f_type; |
1695 | 325e651f | j_mayer | abi_long f_bsize; |
1696 | 325e651f | j_mayer | abi_long f_blocks; |
1697 | 325e651f | j_mayer | abi_long f_bfree; |
1698 | 325e651f | j_mayer | abi_long f_bavail; |
1699 | 325e651f | j_mayer | abi_long f_files; |
1700 | 325e651f | j_mayer | abi_long f_ffree; |
1701 | 325e651f | j_mayer | target_fsid_t f_fsid; |
1702 | 325e651f | j_mayer | abi_long f_namelen; |
1703 | 325e651f | j_mayer | abi_long f_frsize; |
1704 | 325e651f | j_mayer | abi_long f_spare[5];
|
1705 | 325e651f | j_mayer | }; |
1706 | 56c8f68f | bellard | #else
|
1707 | 56c8f68f | bellard | struct target_statfs {
|
1708 | 56c8f68f | bellard | uint32_t f_type; |
1709 | 56c8f68f | bellard | uint32_t f_bsize; |
1710 | 56c8f68f | bellard | uint32_t f_blocks; |
1711 | 56c8f68f | bellard | uint32_t f_bfree; |
1712 | 56c8f68f | bellard | uint32_t f_bavail; |
1713 | 56c8f68f | bellard | uint32_t f_files; |
1714 | 56c8f68f | bellard | uint32_t f_ffree; |
1715 | 4ce6f8de | ths | target_fsid_t f_fsid; |
1716 | 56c8f68f | bellard | uint32_t f_namelen; |
1717 | 56c8f68f | bellard | uint32_t f_frsize; |
1718 | 56c8f68f | bellard | uint32_t f_spare[5];
|
1719 | 56c8f68f | bellard | }; |
1720 | 56c8f68f | bellard | |
1721 | 56c8f68f | bellard | struct target_statfs64 {
|
1722 | 56c8f68f | bellard | uint32_t f_type; |
1723 | 56c8f68f | bellard | uint32_t f_bsize; |
1724 | 56c8f68f | bellard | uint64_t f_blocks; |
1725 | 56c8f68f | bellard | uint64_t f_bfree; |
1726 | 56c8f68f | bellard | uint64_t f_bavail; |
1727 | 56c8f68f | bellard | uint64_t f_files; |
1728 | 56c8f68f | bellard | uint64_t f_ffree; |
1729 | 4ce6f8de | ths | target_fsid_t f_fsid; |
1730 | 56c8f68f | bellard | uint32_t f_namelen; |
1731 | 56c8f68f | bellard | uint32_t f_frsize; |
1732 | 56c8f68f | bellard | uint32_t f_spare[5];
|
1733 | 56c8f68f | bellard | }; |
1734 | 56c8f68f | bellard | #endif
|
1735 | 56c8f68f | bellard | |
1736 | 56c8f68f | bellard | |
1737 | 2521d698 | bellard | #define TARGET_F_DUPFD 0 /* dup */ |
1738 | 2521d698 | bellard | #define TARGET_F_GETFD 1 /* get close_on_exec */ |
1739 | 2521d698 | bellard | #define TARGET_F_SETFD 2 /* set/clear close_on_exec */ |
1740 | 2521d698 | bellard | #define TARGET_F_GETFL 3 /* get file->f_flags */ |
1741 | 2521d698 | bellard | #define TARGET_F_SETFL 4 /* set file->f_flags */ |
1742 | 2521d698 | bellard | |
1743 | 2521d698 | bellard | #if defined(TARGET_ALPHA)
|
1744 | 2521d698 | bellard | #define TARGET_F_GETLK 7 |
1745 | 2521d698 | bellard | #define TARGET_F_SETLK 8 |
1746 | 2521d698 | bellard | #define TARGET_F_SETLKW 9 |
1747 | 2521d698 | bellard | #define TARGET_F_SETOWN 5 /* for sockets. */ |
1748 | 2521d698 | bellard | #define TARGET_F_GETOWN 6 /* for sockets. */ |
1749 | 5f106811 | Arnaud Patard (Rtp) | #elif defined(TARGET_MIPS)
|
1750 | 5f106811 | Arnaud Patard (Rtp) | #define TARGET_F_GETLK 14 |
1751 | 5f106811 | Arnaud Patard (Rtp) | #define TARGET_F_SETLK 6 |
1752 | 5f106811 | Arnaud Patard (Rtp) | #define TARGET_F_SETLKW 7 |
1753 | 5f106811 | Arnaud Patard (Rtp) | #define TARGET_F_SETOWN 24 /* for sockets. */ |
1754 | 5f106811 | Arnaud Patard (Rtp) | #define TARGET_F_GETOWN 25 /* for sockets. */ |
1755 | 2521d698 | bellard | #else
|
1756 | 2521d698 | bellard | #define TARGET_F_GETLK 5 |
1757 | 2521d698 | bellard | #define TARGET_F_SETLK 6 |
1758 | 2521d698 | bellard | #define TARGET_F_SETLKW 7 |
1759 | 2521d698 | bellard | #define TARGET_F_SETOWN 8 /* for sockets. */ |
1760 | 2521d698 | bellard | #define TARGET_F_GETOWN 9 /* for sockets. */ |
1761 | 2521d698 | bellard | #endif
|
1762 | 2521d698 | bellard | |
1763 | 2521d698 | bellard | #define TARGET_F_SETSIG 10 /* for sockets. */ |
1764 | 2521d698 | bellard | #define TARGET_F_GETSIG 11 /* for sockets. */ |
1765 | 2521d698 | bellard | |
1766 | 5f106811 | Arnaud Patard (Rtp) | #if defined(TARGET_MIPS)
|
1767 | 5f106811 | Arnaud Patard (Rtp) | #define TARGET_F_GETLK64 33 /* using 'struct flock64' */ |
1768 | 5f106811 | Arnaud Patard (Rtp) | #define TARGET_F_SETLK64 34 |
1769 | 5f106811 | Arnaud Patard (Rtp) | #define TARGET_F_SETLKW64 35 |
1770 | 5f106811 | Arnaud Patard (Rtp) | #else
|
1771 | 2521d698 | bellard | #define TARGET_F_GETLK64 12 /* using 'struct flock64' */ |
1772 | 2521d698 | bellard | #define TARGET_F_SETLK64 13 |
1773 | 2521d698 | bellard | #define TARGET_F_SETLKW64 14 |
1774 | 5f106811 | Arnaud Patard (Rtp) | #endif
|
1775 | f09936ac | bellard | #if defined (TARGET_ARM)
|
1776 | f09936ac | bellard | #define TARGET_O_ACCMODE 0003 |
1777 | f09936ac | bellard | #define TARGET_O_RDONLY 00 |
1778 | f09936ac | bellard | #define TARGET_O_WRONLY 01 |
1779 | f09936ac | bellard | #define TARGET_O_RDWR 02 |
1780 | f09936ac | bellard | #define TARGET_O_CREAT 0100 /* not fcntl */ |
1781 | f09936ac | bellard | #define TARGET_O_EXCL 0200 /* not fcntl */ |
1782 | f09936ac | bellard | #define TARGET_O_NOCTTY 0400 /* not fcntl */ |
1783 | f09936ac | bellard | #define TARGET_O_TRUNC 01000 /* not fcntl */ |
1784 | f09936ac | bellard | #define TARGET_O_APPEND 02000 |
1785 | f09936ac | bellard | #define TARGET_O_NONBLOCK 04000 |
1786 | 048f6b4d | bellard | #define TARGET_O_NDELAY TARGET_O_NONBLOCK
|
1787 | f09936ac | bellard | #define TARGET_O_SYNC 010000 |
1788 | f09936ac | bellard | #define TARGET_FASYNC 020000 /* fcntl, for BSD compatibility */ |
1789 | f09936ac | bellard | #define TARGET_O_DIRECTORY 040000 /* must be a directory */ |
1790 | f09936ac | bellard | #define TARGET_O_NOFOLLOW 0100000 /* don't follow links */ |
1791 | f09936ac | bellard | #define TARGET_O_DIRECT 0200000 /* direct disk access hint */ |
1792 | f09936ac | bellard | #define TARGET_O_LARGEFILE 0400000 |
1793 | f09936ac | bellard | #elif defined (TARGET_PPC)
|
1794 | ffa65c3b | bellard | #define TARGET_O_ACCMODE 0003 |
1795 | ffa65c3b | bellard | #define TARGET_O_RDONLY 00 |
1796 | ffa65c3b | bellard | #define TARGET_O_WRONLY 01 |
1797 | ffa65c3b | bellard | #define TARGET_O_RDWR 02 |
1798 | ffa65c3b | bellard | #define TARGET_O_CREAT 0100 /* not fcntl */ |
1799 | ffa65c3b | bellard | #define TARGET_O_EXCL 0200 /* not fcntl */ |
1800 | ffa65c3b | bellard | #define TARGET_O_NOCTTY 0400 /* not fcntl */ |
1801 | ffa65c3b | bellard | #define TARGET_O_TRUNC 01000 /* not fcntl */ |
1802 | ffa65c3b | bellard | #define TARGET_O_APPEND 02000 |
1803 | ffa65c3b | bellard | #define TARGET_O_NONBLOCK 04000 |
1804 | 048f6b4d | bellard | #define TARGET_O_NDELAY TARGET_O_NONBLOCK
|
1805 | ffa65c3b | bellard | #define TARGET_O_SYNC 010000 |
1806 | ffa65c3b | bellard | #define TARGET_FASYNC 020000 /* fcntl, for BSD compatibility */ |
1807 | ffa65c3b | bellard | #define TARGET_O_DIRECTORY 040000 /* must be a directory */ |
1808 | ffa65c3b | bellard | #define TARGET_O_NOFOLLOW 0100000 /* don't follow links */ |
1809 | ffa65c3b | bellard | #define TARGET_O_LARGEFILE 0200000 |
1810 | ffa65c3b | bellard | #define TARGET_O_DIRECT 0400000 /* direct disk access hint */ |
1811 | b779e29e | Edgar E. Iglesias | #elif defined (TARGET_MICROBLAZE)
|
1812 | b779e29e | Edgar E. Iglesias | #define TARGET_O_ACCMODE 0003 |
1813 | b779e29e | Edgar E. Iglesias | #define TARGET_O_RDONLY 00 |
1814 | b779e29e | Edgar E. Iglesias | #define TARGET_O_WRONLY 01 |
1815 | b779e29e | Edgar E. Iglesias | #define TARGET_O_RDWR 02 |
1816 | b779e29e | Edgar E. Iglesias | #define TARGET_O_CREAT 0100 /* not fcntl */ |
1817 | b779e29e | Edgar E. Iglesias | #define TARGET_O_EXCL 0200 /* not fcntl */ |
1818 | b779e29e | Edgar E. Iglesias | #define TARGET_O_NOCTTY 0400 /* not fcntl */ |
1819 | b779e29e | Edgar E. Iglesias | #define TARGET_O_TRUNC 01000 /* not fcntl */ |
1820 | b779e29e | Edgar E. Iglesias | #define TARGET_O_APPEND 02000 |
1821 | b779e29e | Edgar E. Iglesias | #define TARGET_O_NONBLOCK 04000 |
1822 | b779e29e | Edgar E. Iglesias | #define TARGET_O_NDELAY TARGET_O_NONBLOCK
|
1823 | b779e29e | Edgar E. Iglesias | #define TARGET_O_SYNC 010000 |
1824 | b779e29e | Edgar E. Iglesias | #define TARGET_FASYNC 020000 /* fcntl, for BSD compatibility */ |
1825 | b779e29e | Edgar E. Iglesias | #define TARGET_O_DIRECTORY 040000 /* must be a directory */ |
1826 | b779e29e | Edgar E. Iglesias | #define TARGET_O_NOFOLLOW 0100000 /* don't follow links */ |
1827 | b779e29e | Edgar E. Iglesias | #define TARGET_O_LARGEFILE 0200000 |
1828 | b779e29e | Edgar E. Iglesias | #define TARGET_O_DIRECT 0400000 /* direct disk access hint */ |
1829 | 6d5e216d | bellard | #elif defined (TARGET_SPARC)
|
1830 | 6d5e216d | bellard | #define TARGET_O_RDONLY 0x0000 |
1831 | 6d5e216d | bellard | #define TARGET_O_WRONLY 0x0001 |
1832 | 6d5e216d | bellard | #define TARGET_O_RDWR 0x0002 |
1833 | 6d5e216d | bellard | #define TARGET_O_ACCMODE 0x0003 |
1834 | 6d5e216d | bellard | #define TARGET_O_APPEND 0x0008 |
1835 | 6d5e216d | bellard | #define TARGET_FASYNC 0x0040 /* fcntl, for BSD compatibility */ |
1836 | 6d5e216d | bellard | #define TARGET_O_CREAT 0x0200 /* not fcntl */ |
1837 | 6d5e216d | bellard | #define TARGET_O_TRUNC 0x0400 /* not fcntl */ |
1838 | 6d5e216d | bellard | #define TARGET_O_EXCL 0x0800 /* not fcntl */ |
1839 | 6d5e216d | bellard | #define TARGET_O_SYNC 0x2000 |
1840 | 6d5e216d | bellard | #define TARGET_O_NONBLOCK 0x4000 |
1841 | 048f6b4d | bellard | #define TARGET_O_NDELAY (0x0004 | TARGET_O_NONBLOCK) |
1842 | 6d5e216d | bellard | #define TARGET_O_NOCTTY 0x8000 /* not fcntl */ |
1843 | 6d5e216d | bellard | #define TARGET_O_DIRECTORY 0x10000 /* must be a directory */ |
1844 | 6d5e216d | bellard | #define TARGET_O_NOFOLLOW 0x20000 /* don't follow links */ |
1845 | 6d5e216d | bellard | #define TARGET_O_LARGEFILE 0x40000 |
1846 | 6d5e216d | bellard | #define TARGET_O_DIRECT 0x100000 /* direct disk access hint */ |
1847 | 048f6b4d | bellard | #elif defined(TARGET_MIPS)
|
1848 | 048f6b4d | bellard | #define TARGET_O_ACCMODE 0x0003 |
1849 | 048f6b4d | bellard | #define TARGET_O_RDONLY 0x0000 |
1850 | 048f6b4d | bellard | #define TARGET_O_WRONLY 0x0001 |
1851 | 048f6b4d | bellard | #define TARGET_O_RDWR 0x0002 |
1852 | 048f6b4d | bellard | #define TARGET_O_APPEND 0x0008 |
1853 | 048f6b4d | bellard | #define TARGET_O_SYNC 0x0010 |
1854 | 048f6b4d | bellard | #define TARGET_O_NONBLOCK 0x0080 |
1855 | 048f6b4d | bellard | #define TARGET_O_CREAT 0x0100 /* not fcntl */ |
1856 | 048f6b4d | bellard | #define TARGET_O_TRUNC 0x0200 /* not fcntl */ |
1857 | 048f6b4d | bellard | #define TARGET_O_EXCL 0x0400 /* not fcntl */ |
1858 | 048f6b4d | bellard | #define TARGET_O_NOCTTY 0x0800 /* not fcntl */ |
1859 | 048f6b4d | bellard | #define TARGET_FASYNC 0x1000 /* fcntl, for BSD compatibility */ |
1860 | 048f6b4d | bellard | #define TARGET_O_LARGEFILE 0x2000 /* allow large file opens */ |
1861 | 048f6b4d | bellard | #define TARGET_O_DIRECT 0x8000 /* direct disk access hint */ |
1862 | 048f6b4d | bellard | #define TARGET_O_DIRECTORY 0x10000 /* must be a directory */ |
1863 | 048f6b4d | bellard | #define TARGET_O_NOFOLLOW 0x20000 /* don't follow links */ |
1864 | 048f6b4d | bellard | #define TARGET_O_NOATIME 0x40000 |
1865 | 048f6b4d | bellard | #define TARGET_O_NDELAY TARGET_O_NONBLOCK
|
1866 | 1f961124 | aurel32 | #elif defined(TARGET_ALPHA)
|
1867 | 1f961124 | aurel32 | #define TARGET_O_ACCMODE 0x0003 |
1868 | 1f961124 | aurel32 | #define TARGET_O_RDONLY 0x0000 |
1869 | 1f961124 | aurel32 | #define TARGET_O_WRONLY 0x0001 |
1870 | 1f961124 | aurel32 | #define TARGET_O_RDWR 0x0002 |
1871 | 1f961124 | aurel32 | #define TARGET_O_APPEND 0x0008 |
1872 | 1f961124 | aurel32 | #define TARGET_O_SYNC 0x4000 |
1873 | 1f961124 | aurel32 | #define TARGET_O_NONBLOCK 0x0004 |
1874 | 1f961124 | aurel32 | #define TARGET_O_CREAT 0x0200 /* not fcntl */ |
1875 | 1f961124 | aurel32 | #define TARGET_O_TRUNC 0x0400 /* not fcntl */ |
1876 | 1f961124 | aurel32 | #define TARGET_O_EXCL 0x0800 /* not fcntl */ |
1877 | 1f961124 | aurel32 | #define TARGET_O_NOCTTY 0x1000 /* not fcntl */ |
1878 | 1f961124 | aurel32 | #define TARGET_FASYNC 0x2000 /* fcntl, for BSD compatibility */ |
1879 | 1f961124 | aurel32 | #define TARGET_O_LARGEFILE 0x0000 /* not necessary, always 64-bit */ |
1880 | 1f961124 | aurel32 | #define TARGET_O_DIRECT 0x80000 /* direct disk access hint */ |
1881 | 1f961124 | aurel32 | #define TARGET_O_DIRECTORY 0x8000 /* must be a directory */ |
1882 | 1f961124 | aurel32 | #define TARGET_O_NOFOLLOW 0x10000 /* don't follow links */ |
1883 | 1f961124 | aurel32 | #define TARGET_O_NOATIME 0x100000 |
1884 | 1f961124 | aurel32 | #define TARGET_O_NDELAY TARGET_O_NONBLOCK
|
1885 | ffa65c3b | bellard | #else
|
1886 | ffa65c3b | bellard | #define TARGET_O_ACCMODE 0003 |
1887 | ffa65c3b | bellard | #define TARGET_O_RDONLY 00 |
1888 | ffa65c3b | bellard | #define TARGET_O_WRONLY 01 |
1889 | ffa65c3b | bellard | #define TARGET_O_RDWR 02 |
1890 | ffa65c3b | bellard | #define TARGET_O_CREAT 0100 /* not fcntl */ |
1891 | ffa65c3b | bellard | #define TARGET_O_EXCL 0200 /* not fcntl */ |
1892 | ffa65c3b | bellard | #define TARGET_O_NOCTTY 0400 /* not fcntl */ |
1893 | ffa65c3b | bellard | #define TARGET_O_TRUNC 01000 /* not fcntl */ |
1894 | ffa65c3b | bellard | #define TARGET_O_APPEND 02000 |
1895 | ffa65c3b | bellard | #define TARGET_O_NONBLOCK 04000 |
1896 | 048f6b4d | bellard | #define TARGET_O_NDELAY TARGET_O_NONBLOCK
|
1897 | ffa65c3b | bellard | #define TARGET_O_SYNC 010000 |
1898 | ffa65c3b | bellard | #define TARGET_FASYNC 020000 /* fcntl, for BSD compatibility */ |
1899 | ffa65c3b | bellard | #define TARGET_O_DIRECT 040000 /* direct disk access hint */ |
1900 | ffa65c3b | bellard | #define TARGET_O_LARGEFILE 0100000 |
1901 | ffa65c3b | bellard | #define TARGET_O_DIRECTORY 0200000 /* must be a directory */ |
1902 | ffa65c3b | bellard | #define TARGET_O_NOFOLLOW 0400000 /* don't follow links */ |
1903 | ffa65c3b | bellard | #endif
|
1904 | ffa65c3b | bellard | |
1905 | 2521d698 | bellard | struct target_flock {
|
1906 | 2521d698 | bellard | short l_type;
|
1907 | 2521d698 | bellard | short l_whence;
|
1908 | 992f48a0 | blueswir1 | abi_ulong l_start; |
1909 | 992f48a0 | blueswir1 | abi_ulong l_len; |
1910 | 2521d698 | bellard | int l_pid;
|
1911 | 2521d698 | bellard | }; |
1912 | 2521d698 | bellard | |
1913 | 2521d698 | bellard | struct target_flock64 {
|
1914 | 2521d698 | bellard | short l_type;
|
1915 | 2521d698 | bellard | short l_whence;
|
1916 | b779e29e | Edgar E. Iglesias | #if defined(TARGET_PPC) || defined(TARGET_X86_64) || defined(TARGET_MIPS) || defined(TARGET_SPARC) || defined(TARGET_HPPA) || defined (TARGET_MICROBLAZE)
|
1917 | ce3f0e2f | aurel32 | int __pad;
|
1918 | ce3f0e2f | aurel32 | #endif
|
1919 | 2521d698 | bellard | unsigned long long l_start; |
1920 | 2521d698 | bellard | unsigned long long l_len; |
1921 | 2521d698 | bellard | int l_pid;
|
1922 | ce4defa0 | pbrook | }__attribute__((packed)); |
1923 | 2521d698 | bellard | |
1924 | ce4defa0 | pbrook | #ifdef TARGET_ARM
|
1925 | ce4defa0 | pbrook | struct target_eabi_flock64 {
|
1926 | ce4defa0 | pbrook | short l_type;
|
1927 | ce4defa0 | pbrook | short l_whence;
|
1928 | ce4defa0 | pbrook | int __pad;
|
1929 | ce4defa0 | pbrook | unsigned long long l_start; |
1930 | ce4defa0 | pbrook | unsigned long long l_len; |
1931 | ce4defa0 | pbrook | int l_pid;
|
1932 | ce4defa0 | pbrook | }__attribute__((packed)); |
1933 | ce4defa0 | pbrook | #endif
|
1934 | 2521d698 | bellard | |
1935 | 2521d698 | bellard | /* soundcard defines */
|
1936 | 2521d698 | bellard | /* XXX: convert them all to arch indepedent entries */
|
1937 | 2521d698 | bellard | #define TARGET_SNDCTL_COPR_HALT TARGET_IOWR('C', 7, int); |
1938 | 2521d698 | bellard | #define TARGET_SNDCTL_COPR_LOAD 0xcfb04301 |
1939 | 2521d698 | bellard | #define TARGET_SNDCTL_COPR_RCODE 0xc0144303 |
1940 | 2521d698 | bellard | #define TARGET_SNDCTL_COPR_RCVMSG 0x8fa44309 |
1941 | 2521d698 | bellard | #define TARGET_SNDCTL_COPR_RDATA 0xc0144302 |
1942 | 2521d698 | bellard | #define TARGET_SNDCTL_COPR_RESET 0x00004300 |
1943 | 2521d698 | bellard | #define TARGET_SNDCTL_COPR_RUN 0xc0144306 |
1944 | 2521d698 | bellard | #define TARGET_SNDCTL_COPR_SENDMSG 0xcfa44308 |
1945 | 2521d698 | bellard | #define TARGET_SNDCTL_COPR_WCODE 0x40144305 |
1946 | 2521d698 | bellard | #define TARGET_SNDCTL_COPR_WDATA 0x40144304 |
1947 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_RESET TARGET_IO('P', 0) |
1948 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_SYNC TARGET_IO('P', 1) |
1949 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_SPEED TARGET_IOWR('P', 2, int) |
1950 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_STEREO TARGET_IOWR('P', 3, int) |
1951 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_GETBLKSIZE TARGET_IOWR('P', 4, int) |
1952 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_SETFMT TARGET_IOWR('P', 5, int) |
1953 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_CHANNELS TARGET_IOWR('P', 6, int) |
1954 | 2521d698 | bellard | #define TARGET_SOUND_PCM_WRITE_FILTER TARGET_IOWR('P', 7, int) |
1955 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_POST TARGET_IO('P', 8) |
1956 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_SUBDIVIDE TARGET_IOWR('P', 9, int) |
1957 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_SETFRAGMENT TARGET_IOWR('P',10, int) |
1958 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_GETFMTS TARGET_IOR('P', 11, int) |
1959 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_GETOSPACE TARGET_IORU('P',12) |
1960 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_GETISPACE TARGET_IORU('P',13) |
1961 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_GETCAPS TARGET_IOR('P', 15, int) |
1962 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_GETTRIGGER TARGET_IOR('P',16, int) |
1963 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_GETIPTR TARGET_IORU('P',17) |
1964 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_GETOPTR TARGET_IORU('P',18) |
1965 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_MAPINBUF 0x80085013 |
1966 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_MAPOUTBUF 0x80085014 |
1967 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_NONBLOCK 0x0000500e |
1968 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_SAMPLESIZE 0xc0045005 |
1969 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_SETDUPLEX 0x00005016 |
1970 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_SETSYNCRO 0x00005015 |
1971 | 2521d698 | bellard | #define TARGET_SNDCTL_DSP_SETTRIGGER 0x40045010 |
1972 | 2521d698 | bellard | #define TARGET_SNDCTL_FM_4OP_ENABLE 0x4004510f |
1973 | 2521d698 | bellard | #define TARGET_SNDCTL_FM_LOAD_INSTR 0x40285107 |
1974 | 2521d698 | bellard | #define TARGET_SNDCTL_MIDI_INFO 0xc074510c |
1975 | 2521d698 | bellard | #define TARGET_SNDCTL_MIDI_MPUCMD 0xc0216d02 |
1976 | 2521d698 | bellard | #define TARGET_SNDCTL_MIDI_MPUMODE 0xc0046d01 |
1977 | 2521d698 | bellard | #define TARGET_SNDCTL_MIDI_PRETIME 0xc0046d00 |
1978 | 2521d698 | bellard | #define TARGET_SNDCTL_PMGR_ACCESS 0xcfb85110 |
1979 | 2521d698 | bellard | #define TARGET_SNDCTL_PMGR_IFACE 0xcfb85001 |
1980 | 2521d698 | bellard | #define TARGET_SNDCTL_SEQ_CTRLRATE 0xc0045103 |
1981 | 2521d698 | bellard | #define TARGET_SNDCTL_SEQ_GETINCOUNT 0x80045105 |
1982 | 2521d698 | bellard | #define TARGET_SNDCTL_SEQ_GETOUTCOUNT 0x80045104 |
1983 | 2521d698 | bellard | #define TARGET_SNDCTL_SEQ_NRMIDIS 0x8004510b |
1984 | 2521d698 | bellard | #define TARGET_SNDCTL_SEQ_NRSYNTHS 0x8004510a |
1985 | 2521d698 | bellard | #define TARGET_SNDCTL_SEQ_OUTOFBAND 0x40085112 |
1986 | 2521d698 | bellard | #define TARGET_SNDCTL_SEQ_PANIC 0x00005111 |
1987 | 2521d698 | bellard | #define TARGET_SNDCTL_SEQ_PERCMODE 0x40045106 |
1988 | 2521d698 | bellard | #define TARGET_SNDCTL_SEQ_RESET 0x00005100 |
1989 | 2521d698 | bellard | #define TARGET_SNDCTL_SEQ_RESETSAMPLES 0x40045109 |
1990 | 2521d698 | bellard | #define TARGET_SNDCTL_SEQ_SYNC 0x00005101 |
1991 | 2521d698 | bellard | #define TARGET_SNDCTL_SEQ_TESTMIDI 0x40045108 |
1992 | 2521d698 | bellard | #define TARGET_SNDCTL_SEQ_THRESHOLD 0x4004510d |
1993 | 2521d698 | bellard | #define TARGET_SNDCTL_SEQ_TRESHOLD 0x4004510d |
1994 | 2521d698 | bellard | #define TARGET_SNDCTL_SYNTH_INFO 0xc08c5102 |
1995 | 2521d698 | bellard | #define TARGET_SNDCTL_SYNTH_MEMAVL 0xc004510e |
1996 | 2521d698 | bellard | #define TARGET_SNDCTL_TMR_CONTINUE 0x00005404 |
1997 | 2521d698 | bellard | #define TARGET_SNDCTL_TMR_METRONOME 0x40045407 |
1998 | 2521d698 | bellard | #define TARGET_SNDCTL_TMR_SELECT 0x40045408 |
1999 | 2521d698 | bellard | #define TARGET_SNDCTL_TMR_SOURCE 0xc0045406 |
2000 | 2521d698 | bellard | #define TARGET_SNDCTL_TMR_START 0x00005402 |
2001 | 2521d698 | bellard | #define TARGET_SNDCTL_TMR_STOP 0x00005403 |
2002 | 2521d698 | bellard | #define TARGET_SNDCTL_TMR_TEMPO 0xc0045405 |
2003 | 2521d698 | bellard | #define TARGET_SNDCTL_TMR_TIMEBASE 0xc0045401 |
2004 | 2521d698 | bellard | #define TARGET_SOUND_PCM_READ_RATE 0x80045002 |
2005 | 2521d698 | bellard | #define TARGET_SOUND_PCM_READ_CHANNELS 0x80045006 |
2006 | 2521d698 | bellard | #define TARGET_SOUND_PCM_READ_BITS 0x80045005 |
2007 | 2521d698 | bellard | #define TARGET_SOUND_PCM_READ_FILTER 0x80045007 |
2008 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_INFO TARGET_IOR ('M', 101, mixer_info) |
2009 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_ACCESS 0xc0804d66 |
2010 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_PRIVATE1 TARGET_IOWR('M', 111, int) |
2011 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_PRIVATE2 TARGET_IOWR('M', 112, int) |
2012 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_PRIVATE3 TARGET_IOWR('M', 113, int) |
2013 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_PRIVATE4 TARGET_IOWR('M', 114, int) |
2014 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_PRIVATE5 TARGET_IOWR('M', 115, int) |
2015 | 2521d698 | bellard | |
2016 | 2521d698 | bellard | #define TARGET_MIXER_READ(dev) TARGET_IOR('M', dev, int) |
2017 | 2521d698 | bellard | |
2018 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_VOLUME TARGET_MIXER_READ(SOUND_MIXER_VOLUME)
|
2019 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_BASS TARGET_MIXER_READ(SOUND_MIXER_BASS)
|
2020 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_TREBLE TARGET_MIXER_READ(SOUND_MIXER_TREBLE)
|
2021 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_SYNTH TARGET_MIXER_READ(SOUND_MIXER_SYNTH)
|
2022 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_PCM TARGET_MIXER_READ(SOUND_MIXER_PCM)
|
2023 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_SPEAKER TARGET_MIXER_READ(SOUND_MIXER_SPEAKER)
|
2024 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_LINE TARGET_MIXER_READ(SOUND_MIXER_LINE)
|
2025 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_MIC TARGET_MIXER_READ(SOUND_MIXER_MIC)
|
2026 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_CD TARGET_MIXER_READ(SOUND_MIXER_CD)
|
2027 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_IMIX TARGET_MIXER_READ(SOUND_MIXER_IMIX)
|
2028 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_ALTPCM TARGET_MIXER_READ(SOUND_MIXER_ALTPCM)
|
2029 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_RECLEV TARGET_MIXER_READ(SOUND_MIXER_RECLEV)
|
2030 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_IGAIN TARGET_MIXER_READ(SOUND_MIXER_IGAIN)
|
2031 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_OGAIN TARGET_MIXER_READ(SOUND_MIXER_OGAIN)
|
2032 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_LINE1 TARGET_MIXER_READ(SOUND_MIXER_LINE1)
|
2033 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_LINE2 TARGET_MIXER_READ(SOUND_MIXER_LINE2)
|
2034 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_LINE3 TARGET_MIXER_READ(SOUND_MIXER_LINE3)
|
2035 | 2521d698 | bellard | |
2036 | 2521d698 | bellard | /* Obsolete macros */
|
2037 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_MUTE TARGET_MIXER_READ(SOUND_MIXER_MUTE)
|
2038 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_ENHANCE TARGET_MIXER_READ(SOUND_MIXER_ENHANCE)
|
2039 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_LOUD TARGET_MIXER_READ(SOUND_MIXER_LOUD)
|
2040 | 2521d698 | bellard | |
2041 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_RECSRC TARGET_MIXER_READ(SOUND_MIXER_RECSRC)
|
2042 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_DEVMASK TARGET_MIXER_READ(SOUND_MIXER_DEVMASK)
|
2043 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_RECMASK TARGET_MIXER_READ(SOUND_MIXER_RECMASK)
|
2044 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_STEREODEVS TARGET_MIXER_READ(SOUND_MIXER_STEREODEVS)
|
2045 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_READ_CAPS TARGET_MIXER_READ(SOUND_MIXER_CAPS)
|
2046 | 2521d698 | bellard | |
2047 | 2521d698 | bellard | #define TARGET_MIXER_WRITE(dev) TARGET_IOWR('M', dev, int) |
2048 | 2521d698 | bellard | |
2049 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_WRITE_VOLUME TARGET_MIXER_WRITE(SOUND_MIXER_VOLUME)
|
2050 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_WRITE_BASS TARGET_MIXER_WRITE(SOUND_MIXER_BASS)
|
2051 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_WRITE_TREBLE TARGET_MIXER_WRITE(SOUND_MIXER_TREBLE)
|
2052 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_WRITE_SYNTH TARGET_MIXER_WRITE(SOUND_MIXER_SYNTH)
|
2053 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_WRITE_PCM TARGET_MIXER_WRITE(SOUND_MIXER_PCM)
|
2054 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_WRITE_SPEAKER TARGET_MIXER_WRITE(SOUND_MIXER_SPEAKER)
|
2055 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_WRITE_LINE TARGET_MIXER_WRITE(SOUND_MIXER_LINE)
|
2056 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_WRITE_MIC TARGET_MIXER_WRITE(SOUND_MIXER_MIC)
|
2057 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_WRITE_CD TARGET_MIXER_WRITE(SOUND_MIXER_CD)
|
2058 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_WRITE_IMIX TARGET_MIXER_WRITE(SOUND_MIXER_IMIX)
|
2059 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_WRITE_ALTPCM TARGET_MIXER_WRITE(SOUND_MIXER_ALTPCM)
|
2060 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_WRITE_RECLEV TARGET_MIXER_WRITE(SOUND_MIXER_RECLEV)
|
2061 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_WRITE_IGAIN TARGET_MIXER_WRITE(SOUND_MIXER_IGAIN)
|
2062 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_WRITE_OGAIN TARGET_MIXER_WRITE(SOUND_MIXER_OGAIN)
|
2063 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_WRITE_LINE1 TARGET_MIXER_WRITE(SOUND_MIXER_LINE1)
|
2064 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_WRITE_LINE2 TARGET_MIXER_WRITE(SOUND_MIXER_LINE2)
|
2065 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_WRITE_LINE3 TARGET_MIXER_WRITE(SOUND_MIXER_LINE3)
|
2066 | 2521d698 | bellard | |
2067 | 2521d698 | bellard | /* Obsolete macros */
|
2068 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_WRITE_MUTE TARGET_MIXER_WRITE(SOUND_MIXER_MUTE)
|
2069 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_WRITE_ENHANCE TARGET_MIXER_WRITE(SOUND_MIXER_ENHANCE)
|
2070 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_WRITE_LOUD TARGET_MIXER_WRITE(SOUND_MIXER_LOUD)
|
2071 | 2521d698 | bellard | |
2072 | 2521d698 | bellard | #define TARGET_SOUND_MIXER_WRITE_RECSRC TARGET_MIXER_WRITE(SOUND_MIXER_RECSRC)
|
2073 | 2521d698 | bellard | |
2074 | 2521d698 | bellard | /* vfat ioctls */
|
2075 | 2521d698 | bellard | #define TARGET_VFAT_IOCTL_READDIR_BOTH TARGET_IORU('r', 1) |
2076 | 2521d698 | bellard | #define TARGET_VFAT_IOCTL_READDIR_SHORT TARGET_IORU('r', 2) |
2077 | a5448a7d | bellard | |
2078 | 8fbd6b52 | balrog | #define TARGET_MTIOCTOP TARGET_IOW('m', 1, struct mtop) |
2079 | 8fbd6b52 | balrog | #define TARGET_MTIOCGET TARGET_IOR('m', 2, struct mtget) |
2080 | 8fbd6b52 | balrog | #define TARGET_MTIOCPOS TARGET_IOR('m', 3, struct mtpos) |
2081 | 8fbd6b52 | balrog | |
2082 | a5448a7d | bellard | struct target_sysinfo {
|
2083 | 992f48a0 | blueswir1 | abi_long uptime; /* Seconds since boot */
|
2084 | 992f48a0 | blueswir1 | abi_ulong loads[3]; /* 1, 5, and 15 minute load averages */ |
2085 | 992f48a0 | blueswir1 | abi_ulong totalram; /* Total usable main memory size */
|
2086 | 992f48a0 | blueswir1 | abi_ulong freeram; /* Available memory size */
|
2087 | 992f48a0 | blueswir1 | abi_ulong sharedram; /* Amount of shared memory */
|
2088 | 992f48a0 | blueswir1 | abi_ulong bufferram; /* Memory used by buffers */
|
2089 | 992f48a0 | blueswir1 | abi_ulong totalswap; /* Total swap space size */
|
2090 | 992f48a0 | blueswir1 | abi_ulong freeswap; /* swap space still available */
|
2091 | a5448a7d | bellard | unsigned short procs; /* Number of current processes */ |
2092 | a5448a7d | bellard | unsigned short pad; /* explicit padding for m68k */ |
2093 | 992f48a0 | blueswir1 | abi_ulong totalhigh; /* Total high memory size */
|
2094 | 992f48a0 | blueswir1 | abi_ulong freehigh; /* Available high memory size */
|
2095 | a5448a7d | bellard | unsigned int mem_unit; /* Memory unit size in bytes */ |
2096 | 992f48a0 | blueswir1 | char _f[20-2*sizeof(abi_long)-sizeof(int)]; /* Padding: libc5 uses this.. */ |
2097 | a5448a7d | bellard | }; |
2098 | 3532fa74 | bellard | |
2099 | 6556a833 | aurel32 | struct linux_dirent {
|
2100 | 6556a833 | aurel32 | long d_ino;
|
2101 | 6556a833 | aurel32 | unsigned long d_off; |
2102 | 6556a833 | aurel32 | unsigned short d_reclen; |
2103 | 6556a833 | aurel32 | char d_name[256]; /* We must not include limits.h! */ |
2104 | 6556a833 | aurel32 | }; |
2105 | 6556a833 | aurel32 | |
2106 | 6556a833 | aurel32 | struct linux_dirent64 {
|
2107 | 6556a833 | aurel32 | uint64_t d_ino; |
2108 | 6556a833 | aurel32 | int64_t d_off; |
2109 | 6556a833 | aurel32 | unsigned short d_reclen; |
2110 | 6556a833 | aurel32 | unsigned char d_type; |
2111 | 6556a833 | aurel32 | char d_name[256]; |
2112 | 6556a833 | aurel32 | }; |
2113 | 6556a833 | aurel32 | |
2114 | 24e1003a | aurel32 | struct target_mq_attr {
|
2115 | 24e1003a | aurel32 | abi_long mq_flags; |
2116 | 24e1003a | aurel32 | abi_long mq_maxmsg; |
2117 | 24e1003a | aurel32 | abi_long mq_msgsize; |
2118 | 24e1003a | aurel32 | abi_long mq_curmsgs; |
2119 | 24e1003a | aurel32 | }; |
2120 | 24e1003a | aurel32 | |
2121 | 3532fa74 | bellard | #include "socket.h" |
2122 | 637947f1 | ths | |
2123 | 637947f1 | ths | #include "errno_defs.h" |
2124 | 03dfe9f8 | Riku Voipio | |
2125 | 03dfe9f8 | Riku Voipio | #define FUTEX_WAIT 0 |
2126 | 03dfe9f8 | Riku Voipio | #define FUTEX_WAKE 1 |
2127 | 03dfe9f8 | Riku Voipio | #define FUTEX_FD 2 |
2128 | 03dfe9f8 | Riku Voipio | #define FUTEX_REQUEUE 3 |
2129 | 03dfe9f8 | Riku Voipio | #define FUTEX_CMP_REQUEUE 4 |
2130 | 03dfe9f8 | Riku Voipio | #define FUTEX_WAKE_OP 5 |
2131 | 03dfe9f8 | Riku Voipio | #define FUTEX_LOCK_PI 6 |
2132 | 03dfe9f8 | Riku Voipio | #define FUTEX_UNLOCK_PI 7 |
2133 | 03dfe9f8 | Riku Voipio | #define FUTEX_TRYLOCK_PI 8 |
2134 | 03dfe9f8 | Riku Voipio | #define FUTEX_WAIT_BITSET 9 |
2135 | 03dfe9f8 | Riku Voipio | #define FUTEX_WAKE_BITSET 10 |
2136 | 03dfe9f8 | Riku Voipio | |
2137 | 03dfe9f8 | Riku Voipio | #define FUTEX_PRIVATE_FLAG 128 |
2138 | 03dfe9f8 | Riku Voipio | #define FUTEX_CLOCK_REALTIME 256 |
2139 | 03dfe9f8 | Riku Voipio | #define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME)
|