]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/uclibc/lib/uclibc/ARCH-amd64/include/asm/ioctls.h
update
[l4.git] / l4 / pkg / uclibc / lib / uclibc / ARCH-amd64 / include / asm / ioctls.h
1
2 /*
3  * The following is for compatibility across the various Linux
4  * platforms.  The i386 ioctl numbering scheme doesn't really enforce
5  * a type field.  De facto, however, the top 8 bits of the lower 16
6  * bits are indeed used as a type field, so we might just as well make
7  * this explicit here.  Please be sure to use the decoding macros
8  * below from now on.
9  */
10 #define _IOC_NRBITS     8
11 #define _IOC_TYPEBITS   8
12 #define _IOC_SIZEBITS   14
13 #define _IOC_DIRBITS    2
14
15 #define _IOC_NRMASK     ((1 << _IOC_NRBITS)-1)
16 #define _IOC_TYPEMASK   ((1 << _IOC_TYPEBITS)-1)
17 #define _IOC_SIZEMASK   ((1 << _IOC_SIZEBITS)-1)
18 #define _IOC_DIRMASK    ((1 << _IOC_DIRBITS)-1)
19
20 #define _IOC_NRSHIFT    0
21 #define _IOC_TYPESHIFT  (_IOC_NRSHIFT+_IOC_NRBITS)
22 #define _IOC_SIZESHIFT  (_IOC_TYPESHIFT+_IOC_TYPEBITS)
23 #define _IOC_DIRSHIFT   (_IOC_SIZESHIFT+_IOC_SIZEBITS)
24
25 /*
26  * Direction bits.
27  */
28 #define _IOC_NONE       0U
29 #define _IOC_WRITE      1U
30 #define _IOC_READ       2U
31
32 #define _IOC(dir,type,nr,size) \
33         (((dir)  << _IOC_DIRSHIFT) | \
34          ((type) << _IOC_TYPESHIFT) | \
35          ((nr)   << _IOC_NRSHIFT) | \
36          ((size) << _IOC_SIZESHIFT))
37
38 /* used to create numbers */
39 #define _IO(type,nr)            _IOC(_IOC_NONE,(type),(nr),0)
40 #define _IOR(type,nr,size)      _IOC(_IOC_READ,(type),(nr),sizeof(size))
41 #define _IOW(type,nr,size)      _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
42 #define _IOWR(type,nr,size)     _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
43
44 /* used to decode ioctl numbers.. */
45 #define _IOC_DIR(nr)            (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
46 #define _IOC_TYPE(nr)           (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
47 #define _IOC_NR(nr)             (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
48 #define _IOC_SIZE(nr)           (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
49
50 /* ...and for the drivers/sound files... */
51
52 #define IOC_IN          (_IOC_WRITE << _IOC_DIRSHIFT)
53 #define IOC_OUT         (_IOC_READ << _IOC_DIRSHIFT)
54 #define IOC_INOUT       ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
55 #define IOCSIZE_MASK    (_IOC_SIZEMASK << _IOC_SIZESHIFT)
56 #define IOCSIZE_SHIFT   (_IOC_SIZESHIFT)
57
58 /* 0x54 is just a magic number to make these relatively unique ('T') */
59
60 #define TCGETS          0x5401
61 #define TCSETS          0x5402
62 #define TCSETSW         0x5403
63 #define TCSETSF         0x5404
64 #define TCGETA          0x5405
65 #define TCSETA          0x5406
66 #define TCSETAW         0x5407
67 #define TCSETAF         0x5408
68 #define TCSBRK          0x5409
69 #define TCXONC          0x540A
70 #define TCFLSH          0x540B
71 #define TIOCEXCL        0x540C
72 #define TIOCNXCL        0x540D
73 #define TIOCSCTTY       0x540E
74 #define TIOCGPGRP       0x540F
75 #define TIOCSPGRP       0x5410
76 #define TIOCOUTQ        0x5411
77 #define TIOCSTI         0x5412
78 #define TIOCGWINSZ      0x5413
79 #define TIOCSWINSZ      0x5414
80 #define TIOCMGET        0x5415
81 #define TIOCMBIS        0x5416
82 #define TIOCMBIC        0x5417
83 #define TIOCMSET        0x5418
84 #define TIOCGSOFTCAR    0x5419
85 #define TIOCSSOFTCAR    0x541A
86 #define FIONREAD        0x541B
87 #define TIOCINQ         FIONREAD
88 #define TIOCLINUX       0x541C
89 #define TIOCCONS        0x541D
90 #define TIOCGSERIAL     0x541E
91 #define TIOCSSERIAL     0x541F
92 #define TIOCPKT         0x5420
93 #define FIONBIO         0x5421
94 #define TIOCNOTTY       0x5422
95 #define TIOCSETD        0x5423
96 #define TIOCGETD        0x5424
97 #define TCSBRKP         0x5425  /* Needed for POSIX tcsendbreak() */
98 #define TIOCTTYGSTRUCT  0x5426  /* For debugging only */
99 #define TIOCSBRK        0x5427  /* BSD compatibility */
100 #define TIOCCBRK        0x5428  /* BSD compatibility */
101 #define TIOCGSID        0x5429  /* Return the session ID of FD */
102 #define TIOCGPTN        _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
103 #define TIOCSPTLCK      _IOW('T',0x31, int)  /* Lock/unlock Pty */
104
105 #define FIONCLEX        0x5450  /* these numbers need to be adjusted. */
106 #define FIOCLEX         0x5451
107 #define FIOASYNC        0x5452
108 #define TIOCSERCONFIG   0x5453
109 #define TIOCSERGWILD    0x5454
110 #define TIOCSERSWILD    0x5455
111 #define TIOCGLCKTRMIOS  0x5456
112 #define TIOCSLCKTRMIOS  0x5457
113 #define TIOCSERGSTRUCT  0x5458 /* For debugging only */
114 #define TIOCSERGETLSR   0x5459 /* Get line status register */
115 #define TIOCSERGETMULTI 0x545A /* Get multiport config  */
116 #define TIOCSERSETMULTI 0x545B /* Set multiport config */
117
118 #define TIOCMIWAIT      0x545C  /* wait for a change on serial input line(s) */
119 #define TIOCGICOUNT     0x545D  /* read serial port inline interrupt counts */
120 #define TIOCGHAYESESP   0x545E  /* Get Hayes ESP configuration */
121 #define TIOCSHAYESESP   0x545F  /* Set Hayes ESP configuration */
122 #define FIOQSIZE        0x5460
123
124 /* Used for packet mode */
125 #define TIOCPKT_DATA             0
126 #define TIOCPKT_FLUSHREAD        1
127 #define TIOCPKT_FLUSHWRITE       2
128 #define TIOCPKT_STOP             4
129 #define TIOCPKT_START            8
130 #define TIOCPKT_NOSTOP          16
131 #define TIOCPKT_DOSTOP          32
132
133 #define TIOCSER_TEMT    0x01    /* Transmitter physically empty */
134
135 /* Socket-level I/O control calls. */
136 #define FIOSETOWN       0x8901
137 #define SIOCSPGRP       0x8902
138 #define FIOGETOWN       0x8903
139 #define SIOCGPGRP       0x8904
140 #define SIOCATMARK      0x8905
141 #define SIOCGSTAMP      0x8906          /* Get stamp */