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