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