Statistics
| Branch: | Revision:

root / linux-user / syscall_defs.h @ 32f36bce

History | View | Annotate | Download (18.1 kB)

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