termbits.h 6.0 KB

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