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