root / linux-user / syscall_defs.h @ 1a9353d2
History | View | Annotate | Download (14.6 kB)
1 |
|
---|---|
2 |
/* common syscall defines for all architectures */
|
3 |
|
4 |
#define SOCKOP_socket 1 |
5 |
#define SOCKOP_bind 2 |
6 |
#define SOCKOP_connect 3 |
7 |
#define SOCKOP_listen 4 |
8 |
#define SOCKOP_accept 5 |
9 |
#define SOCKOP_getsockname 6 |
10 |
#define SOCKOP_getpeername 7 |
11 |
#define SOCKOP_socketpair 8 |
12 |
#define SOCKOP_send 9 |
13 |
#define SOCKOP_recv 10 |
14 |
#define SOCKOP_sendto 11 |
15 |
#define SOCKOP_recvfrom 12 |
16 |
#define SOCKOP_shutdown 13 |
17 |
#define SOCKOP_setsockopt 14 |
18 |
#define SOCKOP_getsockopt 15 |
19 |
#define SOCKOP_sendmsg 16 |
20 |
#define SOCKOP_recvmsg 17 |
21 |
|
22 |
struct target_timeval {
|
23 |
target_long tv_sec; |
24 |
target_long tv_usec; |
25 |
}; |
26 |
|
27 |
struct target_iovec {
|
28 |
target_long iov_base; /* Starting address */
|
29 |
target_long iov_len; /* Number of bytes */
|
30 |
}; |
31 |
|
32 |
struct target_msghdr {
|
33 |
target_long msg_name; /* Socket name */
|
34 |
int msg_namelen; /* Length of name */ |
35 |
target_long msg_iov; /* Data blocks */
|
36 |
target_long msg_iovlen; /* Number of blocks */
|
37 |
target_long msg_control; /* Per protocol magic (eg BSD file descriptor passing) */
|
38 |
target_long msg_controllen; /* Length of cmsg list */
|
39 |
unsigned int msg_flags; |
40 |
}; |
41 |
|
42 |
struct target_rusage {
|
43 |
struct target_timeval ru_utime; /* user time used */ |
44 |
struct target_timeval ru_stime; /* system time used */ |
45 |
target_long ru_maxrss; /* maximum resident set size */
|
46 |
target_long ru_ixrss; /* integral shared memory size */
|
47 |
target_long ru_idrss; /* integral unshared data size */
|
48 |
target_long ru_isrss; /* integral unshared stack size */
|
49 |
target_long ru_minflt; /* page reclaims */
|
50 |
target_long ru_majflt; /* page faults */
|
51 |
target_long ru_nswap; /* swaps */
|
52 |
target_long ru_inblock; /* block input operations */
|
53 |
target_long ru_oublock; /* block output operations */
|
54 |
target_long ru_msgsnd; /* messages sent */
|
55 |
target_long ru_msgrcv; /* messages received */
|
56 |
target_long ru_nsignals; /* signals received */
|
57 |
target_long ru_nvcsw; /* voluntary context switches */
|
58 |
target_long ru_nivcsw; /* involuntary " */
|
59 |
}; |
60 |
|
61 |
typedef struct { |
62 |
int val[2]; |
63 |
} kernel_fsid_t; |
64 |
|
65 |
struct kernel_statfs {
|
66 |
int f_type;
|
67 |
int f_bsize;
|
68 |
int f_blocks;
|
69 |
int f_bfree;
|
70 |
int f_bavail;
|
71 |
int f_files;
|
72 |
int f_ffree;
|
73 |
kernel_fsid_t f_fsid; |
74 |
int f_namelen;
|
75 |
int f_spare[6]; |
76 |
}; |
77 |
|
78 |
/* mostly generic signal stuff */
|
79 |
#define TARGET_SIG_DFL ((target_long)0) /* default signal handling */ |
80 |
#define TARGET_SIG_IGN ((target_long)1) /* ignore signal */ |
81 |
#define TARGET_SIG_ERR ((target_long)-1) /* error return from signal */ |
82 |
|
83 |
#ifdef TARGET_MIPS
|
84 |
#define TARGET_NSIG 128 |
85 |
#else
|
86 |
#define TARGET_NSIG 64 |
87 |
#endif
|
88 |
#define TARGET_NSIG_BPW TARGET_LONG_BITS
|
89 |
#define TARGET_NSIG_WORDS (TARGET_NSIG / TARGET_NSIG_BPW)
|
90 |
|
91 |
typedef struct { |
92 |
target_ulong sig[TARGET_NSIG_WORDS]; |
93 |
} target_sigset_t; |
94 |
|
95 |
/* Networking ioctls */
|
96 |
#define TARGET_SIOCADDRT 0x890B /* add routing table entry */ |
97 |
#define TARGET_SIOCDELRT 0x890C /* delete routing table entry */ |
98 |
#define TARGET_SIOCGIFNAME 0x8910 /* get iface name */ |
99 |
#define TARGET_SIOCSIFLINK 0x8911 /* set iface channel */ |
100 |
#define TARGET_SIOCGIFCONF 0x8912 /* get iface list */ |
101 |
#define TARGET_SIOCGIFFLAGS 0x8913 /* get flags */ |
102 |
#define TARGET_SIOCSIFFLAGS 0x8914 /* set flags */ |
103 |
#define TARGET_SIOCGIFADDR 0x8915 /* get PA address */ |
104 |
#define TARGET_SIOCSIFADDR 0x8916 /* set PA address */ |
105 |
#define TARGET_SIOCGIFDSTADDR 0x8917 /* get remote PA address */ |
106 |
#define TARGET_SIOCSIFDSTADDR 0x8918 /* set remote PA address */ |
107 |
#define TARGET_SIOCGIFBRDADDR 0x8919 /* get broadcast PA address */ |
108 |
#define TARGET_SIOCSIFBRDADDR 0x891a /* set broadcast PA address */ |
109 |
#define TARGET_SIOCGIFNETMASK 0x891b /* get network PA mask */ |
110 |
#define TARGET_SIOCSIFNETMASK 0x891c /* set network PA mask */ |
111 |
#define TARGET_SIOCGIFMETRIC 0x891d /* get metric */ |
112 |
#define TARGET_SIOCSIFMETRIC 0x891e /* set metric */ |
113 |
#define TARGET_SIOCGIFMEM 0x891f /* get memory address (BSD) */ |
114 |
#define TARGET_SIOCSIFMEM 0x8920 /* set memory address (BSD) */ |
115 |
#define TARGET_SIOCGIFMTU 0x8921 /* get MTU size */ |
116 |
#define TARGET_SIOCSIFMTU 0x8922 /* set MTU size */ |
117 |
#define TARGET_SIOCSIFHWADDR 0x8924 /* set hardware address (NI) */ |
118 |
#define TARGET_SIOCGIFENCAP 0x8925 /* get/set slip encapsulation */ |
119 |
#define TARGET_SIOCSIFENCAP 0x8926 |
120 |
#define TARGET_SIOCGIFHWADDR 0x8927 /* Get hardware address */ |
121 |
#define TARGET_SIOCGIFSLAVE 0x8929 /* Driver slaving support */ |
122 |
#define TARGET_SIOCSIFSLAVE 0x8930 |
123 |
#define TARGET_SIOCADDMULTI 0x8931 /* Multicast address lists */ |
124 |
#define TARGET_SIOCDELMULTI 0x8932 |
125 |
|
126 |
/* Bridging control calls */
|
127 |
#define TARGET_SIOCGIFBR 0x8940 /* Bridging support */ |
128 |
#define TARGET_SIOCSIFBR 0x8941 /* Set bridging options */ |
129 |
|
130 |
#define TARGET_SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */ |
131 |
#define TARGET_SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */ |
132 |
|
133 |
/* ARP cache control calls. */
|
134 |
#define TARGET_OLD_SIOCDARP 0x8950 /* old delete ARP table entry */ |
135 |
#define TARGET_OLD_SIOCGARP 0x8951 /* old get ARP table entry */ |
136 |
#define TARGET_OLD_SIOCSARP 0x8952 /* old set ARP table entry */ |
137 |
#define TARGET_SIOCDARP 0x8953 /* delete ARP table entry */ |
138 |
#define TARGET_SIOCGARP 0x8954 /* get ARP table entry */ |
139 |
#define TARGET_SIOCSARP 0x8955 /* set ARP table entry */ |
140 |
|
141 |
/* RARP cache control calls. */
|
142 |
#define TARGET_SIOCDRARP 0x8960 /* delete RARP table entry */ |
143 |
#define TARGET_SIOCGRARP 0x8961 /* get RARP table entry */ |
144 |
#define TARGET_SIOCSRARP 0x8962 /* set RARP table entry */ |
145 |
|
146 |
/* Driver configuration calls */
|
147 |
#define TARGET_SIOCGIFMAP 0x8970 /* Get device parameters */ |
148 |
#define TARGET_SIOCSIFMAP 0x8971 /* Set device parameters */ |
149 |
|
150 |
/* DLCI configuration calls */
|
151 |
#define TARGET_SIOCADDDLCI 0x8980 /* Create new DLCI device */ |
152 |
#define TARGET_SIOCDELDLCI 0x8981 /* Delete DLCI device */ |
153 |
|
154 |
|
155 |
/* From <linux/fs.h> */
|
156 |
|
157 |
#define TARGET_BLKROSET TARGET_IO(0x12,93) /* set device read-only (0 = read-write) */ |
158 |
#define TARGET_BLKROGET TARGET_IO(0x12,94) /* get read-only status (0 = read_write) */ |
159 |
#define TARGET_BLKRRPART TARGET_IO(0x12,95) /* re-read partition table */ |
160 |
#define TARGET_BLKGETSIZE TARGET_IO(0x12,96) /* return device size /512 (long *arg) */ |
161 |
#define TARGET_BLKFLSBUF TARGET_IO(0x12,97) /* flush buffer cache */ |
162 |
#define TARGET_BLKRASET TARGET_IO(0x12,98) /* Set read ahead for block device */ |
163 |
#define TARGET_BLKRAGET TARGET_IO(0x12,99) /* get current read ahead setting */ |
164 |
#define TARGET_BLKFRASET TARGET_IO(0x12,100)/* set filesystem (mm/filemap.c) read-ahead */ |
165 |
#define TARGET_BLKFRAGET TARGET_IO(0x12,101)/* get filesystem (mm/filemap.c) read-ahead */ |
166 |
#define TARGET_BLKSECTSET TARGET_IO(0x12,102)/* set max sectors per request (ll_rw_blk.c) */ |
167 |
#define TARGET_BLKSECTGET TARGET_IO(0x12,103)/* get max sectors per request (ll_rw_blk.c) */ |
168 |
#define TARGET_BLKSSZGET TARGET_IO(0x12,104)/* get block device sector size */ |
169 |
/* A jump here: 108-111 have been used for various private purposes. */
|
170 |
#define TARGET_BLKBSZGET TARGET_IOR(0x12,112,sizeof(int)) |
171 |
#define TARGET_BLKBSZSET TARGET_IOW(0x12,113,sizeof(int)) |
172 |
#define TARGET_BLKGETSIZE64 TARGET_IOR(0x12,114,sizeof(uint64_t)) /* return device size in bytes (u64 *arg) */ |
173 |
#define TARGET_FIBMAP TARGET_IO(0x00,1) /* bmap access */ |
174 |
#define TARGET_FIGETBSZ TARGET_IO(0x00,2) /* get the block size used for bmap */ |
175 |
|
176 |
/* cdrom commands */
|
177 |
#define TARGET_CDROMPAUSE 0x5301 /* Pause Audio Operation */ |
178 |
#define TARGET_CDROMRESUME 0x5302 /* Resume paused Audio Operation */ |
179 |
#define TARGET_CDROMPLAYMSF 0x5303 /* Play Audio MSF (struct cdrom_msf) */ |
180 |
#define TARGET_CDROMPLAYTRKIND 0x5304 /* Play Audio Track/index |
181 |
(struct cdrom_ti) */
|
182 |
#define TARGET_CDROMREADTOCHDR 0x5305 /* Read TOC header |
183 |
(struct cdrom_tochdr) */
|
184 |
#define TARGET_CDROMREADTOCENTRY 0x5306 /* Read TOC entry |
185 |
(struct cdrom_tocentry) */
|
186 |
#define TARGET_CDROMSTOP 0x5307 /* Stop the cdrom drive */ |
187 |
#define TARGET_CDROMSTART 0x5308 /* Start the cdrom drive */ |
188 |
#define TARGET_CDROMEJECT 0x5309 /* Ejects the cdrom media */ |
189 |
#define TARGET_CDROMVOLCTRL 0x530a /* Control output volume |
190 |
(struct cdrom_volctrl) */
|
191 |
#define TARGET_CDROMSUBCHNL 0x530b /* Read subchannel data |
192 |
(struct cdrom_subchnl) */
|
193 |
#define TARGET_CDROMREADMODE2 0x530c /* Read TARGET_CDROM mode 2 data (2336 Bytes) |
194 |
(struct cdrom_read) */
|
195 |
#define TARGET_CDROMREADMODE1 0x530d /* Read TARGET_CDROM mode 1 data (2048 Bytes) |
196 |
(struct cdrom_read) */
|
197 |
#define TARGET_CDROMREADAUDIO 0x530e /* (struct cdrom_read_audio) */ |
198 |
#define TARGET_CDROMEJECT_SW 0x530f /* enable(1)/disable(0) auto-ejecting */ |
199 |
#define TARGET_CDROMMULTISESSION 0x5310 /* Obtain the start-of-last-session |
200 |
address of multi session disks
|
201 |
(struct cdrom_multisession) */
|
202 |
#define TARGET_CDROM_GET_MCN 0x5311 /* Obtain the "Universal Product Code" |
203 |
if available (struct cdrom_mcn) */
|
204 |
#define TARGET_CDROM_GET_UPC TARGET_CDROM_GET_MCN /* This one is depricated, |
205 |
but here anyway for compatability */
|
206 |
#define TARGET_CDROMRESET 0x5312 /* hard-reset the drive */ |
207 |
#define TARGET_CDROMVOLREAD 0x5313 /* Get the drive's volume setting |
208 |
(struct cdrom_volctrl) */
|
209 |
#define TARGET_CDROMREADRAW 0x5314 /* read data in raw mode (2352 Bytes) |
210 |
(struct cdrom_read) */
|
211 |
/*
|
212 |
* These ioctls are used only used in aztcd.c and optcd.c
|
213 |
*/
|
214 |
#define TARGET_CDROMREADCOOKED 0x5315 /* read data in cooked mode */ |
215 |
#define TARGET_CDROMSEEK 0x5316 /* seek msf address */ |
216 |
|
217 |
/*
|
218 |
* This ioctl is only used by the scsi-cd driver.
|
219 |
It is for playing audio in logical block addressing mode.
|
220 |
*/
|
221 |
#define TARGET_CDROMPLAYBLK 0x5317 /* (struct cdrom_blk) */ |
222 |
|
223 |
/*
|
224 |
* These ioctls are only used in optcd.c
|
225 |
*/
|
226 |
#define TARGET_CDROMREADALL 0x5318 /* read all 2646 bytes */ |
227 |
|
228 |
/*
|
229 |
* These ioctls are (now) only in ide-cd.c for controlling
|
230 |
* drive spindown time. They should be implemented in the
|
231 |
* Uniform driver, via generic packet commands, GPCMD_MODE_SELECT_10,
|
232 |
* GPCMD_MODE_SENSE_10 and the GPMODE_POWER_PAGE...
|
233 |
* -Erik
|
234 |
*/
|
235 |
#define TARGET_CDROMGETSPINDOWN 0x531d |
236 |
#define TARGET_CDROMSETSPINDOWN 0x531e |
237 |
|
238 |
/*
|
239 |
* These ioctls are implemented through the uniform CD-ROM driver
|
240 |
* They _will_ be adopted by all CD-ROM drivers, when all the CD-ROM
|
241 |
* drivers are eventually ported to the uniform CD-ROM driver interface.
|
242 |
*/
|
243 |
#define TARGET_CDROMCLOSETRAY 0x5319 /* pendant of CDROMEJECT */ |
244 |
#define TARGET_CDROM_SET_OPTIONS 0x5320 /* Set behavior options */ |
245 |
#define TARGET_CDROM_CLEAR_OPTIONS 0x5321 /* Clear behavior options */ |
246 |
#define TARGET_CDROM_SELECT_SPEED 0x5322 /* Set the CD-ROM speed */ |
247 |
#define TARGET_CDROM_SELECT_DISC 0x5323 /* Select disc (for juke-boxes) */ |
248 |
#define TARGET_CDROM_MEDIA_CHANGED 0x5325 /* Check is media changed */ |
249 |
#define TARGET_CDROM_DRIVE_STATUS 0x5326 /* Get tray position, etc. */ |
250 |
#define TARGET_CDROM_DISC_STATUS 0x5327 /* Get disc type, etc. */ |
251 |
#define TARGET_CDROM_CHANGER_NSLOTS 0x5328 /* Get number of slots */ |
252 |
#define TARGET_CDROM_LOCKDOOR 0x5329 /* lock or unlock door */ |
253 |
#define TARGET_CDROM_DEBUG 0x5330 /* Turn debug messages on/off */ |
254 |
#define TARGET_CDROM_GET_CAPABILITY 0x5331 /* get capabilities */ |
255 |
|
256 |
/* Note that scsi/scsi_ioctl.h also uses 0x5382 - 0x5386.
|
257 |
* Future CDROM ioctls should be kept below 0x537F
|
258 |
*/
|
259 |
|
260 |
/* This ioctl is only used by sbpcd at the moment */
|
261 |
#define TARGET_CDROMAUDIOBUFSIZ 0x5382 /* set the audio buffer size */ |
262 |
/* conflict with SCSI_IOCTL_GET_IDLUN */
|
263 |
|
264 |
/* DVD-ROM Specific ioctls */
|
265 |
#define TARGET_DVD_READ_STRUCT 0x5390 /* Read structure */ |
266 |
#define TARGET_DVD_WRITE_STRUCT 0x5391 /* Write structure */ |
267 |
#define TARGET_DVD_AUTH 0x5392 /* Authentication */ |
268 |
|
269 |
#define TARGET_CDROM_SEND_PACKET 0x5393 /* send a packet to the drive */ |
270 |
#define TARGET_CDROM_NEXT_WRITABLE 0x5394 /* get next writable block */ |
271 |
#define TARGET_CDROM_LAST_WRITTEN 0x5395 /* get last block written on disc */ |
272 |
|
273 |
/* HD commands */
|
274 |
|
275 |
/* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x030n/0x031n */
|
276 |
#define TARGET_HDIO_GETGEO 0x0301 /* get device geometry */ |
277 |
#define TARGET_HDIO_GET_UNMASKINTR 0x0302 /* get current unmask setting */ |
278 |
#define TARGET_HDIO_GET_MULTCOUNT 0x0304 /* get current IDE blockmode setting */ |
279 |
#define TARGET_HDIO_GET_IDENTITY 0x0307 /* get IDE identification info */ |
280 |
#define TARGET_HDIO_GET_KEEPSETTINGS 0x0308 /* get keep-settings-on-reset flag */ |
281 |
#define TARGET_HDIO_GET_32BIT 0x0309 /* get current io_32bit setting */ |
282 |
#define TARGET_HDIO_GET_NOWERR 0x030a /* get ignore-write-error flag */ |
283 |
#define TARGET_HDIO_GET_DMA 0x030b /* get use-dma flag */ |
284 |
#define TARGET_HDIO_DRIVE_CMD 0x031f /* execute a special drive command */ |
285 |
|
286 |
/* hd/ide ctl's that pass (arg) non-ptr values are numbered 0x032n/0x033n */
|
287 |
#define TARGET_HDIO_SET_MULTCOUNT 0x0321 /* change IDE blockmode */ |
288 |
#define TARGET_HDIO_SET_UNMASKINTR 0x0322 /* permit other irqs during I/O */ |
289 |
#define TARGET_HDIO_SET_KEEPSETTINGS 0x0323 /* keep ioctl settings on reset */ |
290 |
#define TARGET_HDIO_SET_32BIT 0x0324 /* change io_32bit flags */ |
291 |
#define TARGET_HDIO_SET_NOWERR 0x0325 /* change ignore-write-error flag */ |
292 |
#define TARGET_HDIO_SET_DMA 0x0326 /* change use-dma flag */ |
293 |
#define TARGET_HDIO_SET_PIO_MODE 0x0327 /* reconfig interface to new speed */ |