termbits.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. #ifndef _UAPI_SPARC_TERMBITS_H
  2. #define _UAPI_SPARC_TERMBITS_H
  3. #include <linux/posix_types.h>
  4. typedef unsigned char cc_t;
  5. typedef unsigned int speed_t;
  6. #if defined(__sparc__) && defined(__arch64__)
  7. typedef unsigned int tcflag_t;
  8. #else
  9. typedef unsigned long tcflag_t;
  10. #endif
  11. #define NCC 8
  12. struct termio {
  13. unsigned short c_iflag; /* input mode flags */
  14. unsigned short c_oflag; /* output mode flags */
  15. unsigned short c_cflag; /* control mode flags */
  16. unsigned short c_lflag; /* local mode flags */
  17. unsigned char c_line; /* line discipline */
  18. unsigned char c_cc[NCC]; /* control characters */
  19. };
  20. #define NCCS 17
  21. struct termios {
  22. tcflag_t c_iflag; /* input mode flags */
  23. tcflag_t c_oflag; /* output mode flags */
  24. tcflag_t c_cflag; /* control mode flags */
  25. tcflag_t c_lflag; /* local mode flags */
  26. cc_t c_line; /* line discipline */
  27. #ifndef __KERNEL__
  28. cc_t c_cc[NCCS]; /* control characters */
  29. #else
  30. cc_t c_cc[NCCS+2]; /* kernel needs 2 more to hold vmin/vtime */
  31. #define SIZEOF_USER_TERMIOS sizeof (struct termios) - (2*sizeof (cc_t))
  32. #endif
  33. };
  34. struct termios2 {
  35. tcflag_t c_iflag; /* input mode flags */
  36. tcflag_t c_oflag; /* output mode flags */
  37. tcflag_t c_cflag; /* control mode flags */
  38. tcflag_t c_lflag; /* local mode flags */
  39. cc_t c_line; /* line discipline */
  40. cc_t c_cc[NCCS+2]; /* control characters */
  41. speed_t c_ispeed; /* input speed */
  42. speed_t c_ospeed; /* output speed */
  43. };
  44. struct ktermios {
  45. tcflag_t c_iflag; /* input mode flags */
  46. tcflag_t c_oflag; /* output mode flags */
  47. tcflag_t c_cflag; /* control mode flags */
  48. tcflag_t c_lflag; /* local mode flags */
  49. cc_t c_line; /* line discipline */
  50. cc_t c_cc[NCCS+2]; /* control characters */
  51. speed_t c_ispeed; /* input speed */
  52. speed_t c_ospeed; /* output speed */
  53. };
  54. /* c_cc characters */
  55. #define VINTR 0
  56. #define VQUIT 1
  57. #define VERASE 2
  58. #define VKILL 3
  59. #define VEOF 4
  60. #define VEOL 5
  61. #define VEOL2 6
  62. #define VSWTC 7
  63. #define VSTART 8
  64. #define VSTOP 9
  65. #define VSUSP 10
  66. #define VDSUSP 11 /* SunOS POSIX nicety I do believe... */
  67. #define VREPRINT 12
  68. #define VDISCARD 13
  69. #define VWERASE 14
  70. #define VLNEXT 15
  71. /* Kernel keeps vmin/vtime separated, user apps assume vmin/vtime is
  72. * shared with eof/eol
  73. */
  74. #ifndef __KERNEL__
  75. #define VMIN VEOF
  76. #define VTIME VEOL
  77. #endif
  78. /* c_iflag bits */
  79. #define IGNBRK 0x00000001
  80. #define BRKINT 0x00000002
  81. #define IGNPAR 0x00000004
  82. #define PARMRK 0x00000008
  83. #define INPCK 0x00000010
  84. #define ISTRIP 0x00000020
  85. #define INLCR 0x00000040
  86. #define IGNCR 0x00000080
  87. #define ICRNL 0x00000100
  88. #define IUCLC 0x00000200
  89. #define IXON 0x00000400
  90. #define IXANY 0x00000800
  91. #define IXOFF 0x00001000
  92. #define IMAXBEL 0x00002000
  93. #define IUTF8 0x00004000
  94. /* c_oflag bits */
  95. #define OPOST 0x00000001
  96. #define OLCUC 0x00000002
  97. #define ONLCR 0x00000004
  98. #define OCRNL 0x00000008
  99. #define ONOCR 0x00000010
  100. #define ONLRET 0x00000020
  101. #define OFILL 0x00000040
  102. #define OFDEL 0x00000080
  103. #define NLDLY 0x00000100
  104. #define NL0 0x00000000
  105. #define NL1 0x00000100
  106. #define CRDLY 0x00000600
  107. #define CR0 0x00000000
  108. #define CR1 0x00000200
  109. #define CR2 0x00000400
  110. #define CR3 0x00000600
  111. #define TABDLY 0x00001800
  112. #define TAB0 0x00000000
  113. #define TAB1 0x00000800
  114. #define TAB2 0x00001000
  115. #define TAB3 0x00001800
  116. #define XTABS 0x00001800
  117. #define BSDLY 0x00002000
  118. #define BS0 0x00000000
  119. #define BS1 0x00002000
  120. #define VTDLY 0x00004000
  121. #define VT0 0x00000000
  122. #define VT1 0x00004000
  123. #define FFDLY 0x00008000
  124. #define FF0 0x00000000
  125. #define FF1 0x00008000
  126. #define PAGEOUT 0x00010000 /* SUNOS specific */
  127. #define WRAP 0x00020000 /* SUNOS specific */
  128. /* c_cflag bit meaning */
  129. #define CBAUD 0x0000100f
  130. #define B0 0x00000000 /* hang up */
  131. #define B50 0x00000001
  132. #define B75 0x00000002
  133. #define B110 0x00000003
  134. #define B134 0x00000004
  135. #define B150 0x00000005
  136. #define B200 0x00000006
  137. #define B300 0x00000007
  138. #define B600 0x00000008
  139. #define B1200 0x00000009
  140. #define B1800 0x0000000a
  141. #define B2400 0x0000000b
  142. #define B4800 0x0000000c
  143. #define B9600 0x0000000d
  144. #define B19200 0x0000000e
  145. #define B38400 0x0000000f
  146. #define EXTA B19200
  147. #define EXTB B38400
  148. #define CSIZE 0x00000030
  149. #define CS5 0x00000000
  150. #define CS6 0x00000010
  151. #define CS7 0x00000020
  152. #define CS8 0x00000030
  153. #define CSTOPB 0x00000040
  154. #define CREAD 0x00000080
  155. #define PARENB 0x00000100
  156. #define PARODD 0x00000200
  157. #define HUPCL 0x00000400
  158. #define CLOCAL 0x00000800
  159. #define CBAUDEX 0x00001000
  160. /* We'll never see these speeds with the Zilogs, but for completeness... */
  161. #define BOTHER 0x00001000
  162. #define B57600 0x00001001
  163. #define B115200 0x00001002
  164. #define B230400 0x00001003
  165. #define B460800 0x00001004
  166. /* This is what we can do with the Zilogs. */
  167. #define B76800 0x00001005
  168. /* This is what we can do with the SAB82532. */
  169. #define B153600 0x00001006
  170. #define B307200 0x00001007
  171. #define B614400 0x00001008
  172. #define B921600 0x00001009
  173. /* And these are the rest... */
  174. #define B500000 0x0000100a
  175. #define B576000 0x0000100b
  176. #define B1000000 0x0000100c
  177. #define B1152000 0x0000100d
  178. #define B1500000 0x0000100e
  179. #define B2000000 0x0000100f
  180. /* These have totally bogus values and nobody uses them
  181. so far. Later on we'd have to use say 0x10000x and
  182. adjust CBAUD constant and drivers accordingly.
  183. #define B2500000 0x00001010
  184. #define B3000000 0x00001011
  185. #define B3500000 0x00001012
  186. #define B4000000 0x00001013 */
  187. #define CIBAUD 0x100f0000 /* input baud rate (not used) */
  188. #define CMSPAR 0x40000000 /* mark or space (stick) parity */
  189. #define CRTSCTS 0x80000000 /* flow control */
  190. #define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
  191. /* c_lflag bits */
  192. #define ISIG 0x00000001
  193. #define ICANON 0x00000002
  194. #define XCASE 0x00000004
  195. #define ECHO 0x00000008
  196. #define ECHOE 0x00000010
  197. #define ECHOK 0x00000020
  198. #define ECHONL 0x00000040
  199. #define NOFLSH 0x00000080
  200. #define TOSTOP 0x00000100
  201. #define ECHOCTL 0x00000200
  202. #define ECHOPRT 0x00000400
  203. #define ECHOKE 0x00000800
  204. #define DEFECHO 0x00001000 /* SUNOS thing, what is it? */
  205. #define FLUSHO 0x00002000
  206. #define PENDIN 0x00004000
  207. #define IEXTEN 0x00008000
  208. #define EXTPROC 0x00010000
  209. /* modem lines */
  210. #define TIOCM_LE 0x001
  211. #define TIOCM_DTR 0x002
  212. #define TIOCM_RTS 0x004
  213. #define TIOCM_ST 0x008
  214. #define TIOCM_SR 0x010
  215. #define TIOCM_CTS 0x020
  216. #define TIOCM_CAR 0x040
  217. #define TIOCM_RNG 0x080
  218. #define TIOCM_DSR 0x100
  219. #define TIOCM_CD TIOCM_CAR
  220. #define TIOCM_RI TIOCM_RNG
  221. #define TIOCM_OUT1 0x2000
  222. #define TIOCM_OUT2 0x4000
  223. #define TIOCM_LOOP 0x8000
  224. /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
  225. #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
  226. /* tcflow() and TCXONC use these */
  227. #define TCOOFF 0
  228. #define TCOON 1
  229. #define TCIOFF 2
  230. #define TCION 3
  231. /* tcflush() and TCFLSH use these */
  232. #define TCIFLUSH 0
  233. #define TCOFLUSH 1
  234. #define TCIOFLUSH 2
  235. /* tcsetattr uses these */
  236. #define TCSANOW 0
  237. #define TCSADRAIN 1
  238. #define TCSAFLUSH 2
  239. #endif /* _UAPI_SPARC_TERMBITS_H */