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