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