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