termbits.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _ALPHA_TERMBITS_H
  3. #define _ALPHA_TERMBITS_H
  4. #include <linux/posix_types.h>
  5. typedef unsigned char cc_t;
  6. typedef unsigned int speed_t;
  7. typedef unsigned int tcflag_t;
  8. /*
  9. * termios type and macro definitions. Be careful about adding stuff
  10. * to this file since it's used in GNU libc and there are strict rules
  11. * concerning namespace pollution.
  12. */
  13. #define NCCS 19
  14. struct termios {
  15. tcflag_t c_iflag; /* input mode flags */
  16. tcflag_t c_oflag; /* output mode flags */
  17. tcflag_t c_cflag; /* control mode flags */
  18. tcflag_t c_lflag; /* local mode flags */
  19. cc_t c_cc[NCCS]; /* control characters */
  20. cc_t c_line; /* line discipline (== c_cc[19]) */
  21. speed_t c_ispeed; /* input speed */
  22. speed_t c_ospeed; /* output speed */
  23. };
  24. /* Alpha has identical termios and termios2 */
  25. struct termios2 {
  26. tcflag_t c_iflag; /* input mode flags */
  27. tcflag_t c_oflag; /* output mode flags */
  28. tcflag_t c_cflag; /* control mode flags */
  29. tcflag_t c_lflag; /* local mode flags */
  30. cc_t c_cc[NCCS]; /* control characters */
  31. cc_t c_line; /* line discipline (== c_cc[19]) */
  32. speed_t c_ispeed; /* input speed */
  33. speed_t c_ospeed; /* output speed */
  34. };
  35. /* Alpha has matching termios and ktermios */
  36. struct ktermios {
  37. tcflag_t c_iflag; /* input mode flags */
  38. tcflag_t c_oflag; /* output mode flags */
  39. tcflag_t c_cflag; /* control mode flags */
  40. tcflag_t c_lflag; /* local mode flags */
  41. cc_t c_cc[NCCS]; /* control characters */
  42. cc_t c_line; /* line discipline (== c_cc[19]) */
  43. speed_t c_ispeed; /* input speed */
  44. speed_t c_ospeed; /* output speed */
  45. };
  46. /* c_cc characters */
  47. #define VEOF 0
  48. #define VEOL 1
  49. #define VEOL2 2
  50. #define VERASE 3
  51. #define VWERASE 4
  52. #define VKILL 5
  53. #define VREPRINT 6
  54. #define VSWTC 7
  55. #define VINTR 8
  56. #define VQUIT 9
  57. #define VSUSP 10
  58. #define VSTART 12
  59. #define VSTOP 13
  60. #define VLNEXT 14
  61. #define VDISCARD 15
  62. #define VMIN 16
  63. #define VTIME 17
  64. /* c_iflag bits */
  65. #define IGNBRK 0000001
  66. #define BRKINT 0000002
  67. #define IGNPAR 0000004
  68. #define PARMRK 0000010
  69. #define INPCK 0000020
  70. #define ISTRIP 0000040
  71. #define INLCR 0000100
  72. #define IGNCR 0000200
  73. #define ICRNL 0000400
  74. #define IXON 0001000
  75. #define IXOFF 0002000
  76. #define IXANY 0004000
  77. #define IUCLC 0010000
  78. #define IMAXBEL 0020000
  79. #define IUTF8 0040000
  80. /* c_oflag bits */
  81. #define OPOST 0000001
  82. #define ONLCR 0000002
  83. #define OLCUC 0000004
  84. #define OCRNL 0000010
  85. #define ONOCR 0000020
  86. #define ONLRET 0000040
  87. #define OFILL 00000100
  88. #define OFDEL 00000200
  89. #define NLDLY 00001400
  90. #define NL0 00000000
  91. #define NL1 00000400
  92. #define NL2 00001000
  93. #define NL3 00001400
  94. #define TABDLY 00006000
  95. #define TAB0 00000000
  96. #define TAB1 00002000
  97. #define TAB2 00004000
  98. #define TAB3 00006000
  99. #define CRDLY 00030000
  100. #define CR0 00000000
  101. #define CR1 00010000
  102. #define CR2 00020000
  103. #define CR3 00030000
  104. #define FFDLY 00040000
  105. #define FF0 00000000
  106. #define FF1 00040000
  107. #define BSDLY 00100000
  108. #define BS0 00000000
  109. #define BS1 00100000
  110. #define VTDLY 00200000
  111. #define VT0 00000000
  112. #define VT1 00200000
  113. /*
  114. * Should be equivalent to TAB3, see description of TAB3 in
  115. * POSIX.1-2008, Ch. 11.2.3 "Output Modes"
  116. */
  117. #define XTABS TAB3
  118. /* c_cflag bit meaning */
  119. #define CBAUD 0000037
  120. #define B0 0000000 /* hang up */
  121. #define B50 0000001
  122. #define B75 0000002
  123. #define B110 0000003
  124. #define B134 0000004
  125. #define B150 0000005
  126. #define B200 0000006
  127. #define B300 0000007
  128. #define B600 0000010
  129. #define B1200 0000011
  130. #define B1800 0000012
  131. #define B2400 0000013
  132. #define B4800 0000014
  133. #define B9600 0000015
  134. #define B19200 0000016
  135. #define B38400 0000017
  136. #define EXTA B19200
  137. #define EXTB B38400
  138. #define CBAUDEX 0000000
  139. #define B57600 00020
  140. #define B115200 00021
  141. #define B230400 00022
  142. #define B460800 00023
  143. #define B500000 00024
  144. #define B576000 00025
  145. #define B921600 00026
  146. #define B1000000 00027
  147. #define B1152000 00030
  148. #define B1500000 00031
  149. #define B2000000 00032
  150. #define B2500000 00033
  151. #define B3000000 00034
  152. #define B3500000 00035
  153. #define B4000000 00036
  154. #define BOTHER 00037
  155. #define CSIZE 00001400
  156. #define CS5 00000000
  157. #define CS6 00000400
  158. #define CS7 00001000
  159. #define CS8 00001400
  160. #define CSTOPB 00002000
  161. #define CREAD 00004000
  162. #define PARENB 00010000
  163. #define PARODD 00020000
  164. #define HUPCL 00040000
  165. #define CLOCAL 00100000
  166. #define CMSPAR 010000000000 /* mark or space (stick) parity */
  167. #define CRTSCTS 020000000000 /* flow control */
  168. #define CIBAUD 07600000
  169. #define IBSHIFT 16
  170. /* c_lflag bits */
  171. #define ISIG 0x00000080
  172. #define ICANON 0x00000100
  173. #define XCASE 0x00004000
  174. #define ECHO 0x00000008
  175. #define ECHOE 0x00000002
  176. #define ECHOK 0x00000004
  177. #define ECHONL 0x00000010
  178. #define NOFLSH 0x80000000
  179. #define TOSTOP 0x00400000
  180. #define ECHOCTL 0x00000040
  181. #define ECHOPRT 0x00000020
  182. #define ECHOKE 0x00000001
  183. #define FLUSHO 0x00800000
  184. #define PENDIN 0x20000000
  185. #define IEXTEN 0x00000400
  186. #define EXTPROC 0x10000000
  187. /* Values for the ACTION argument to `tcflow'. */
  188. #define TCOOFF 0
  189. #define TCOON 1
  190. #define TCIOFF 2
  191. #define TCION 3
  192. /* Values for the QUEUE_SELECTOR argument to `tcflush'. */
  193. #define TCIFLUSH 0
  194. #define TCOFLUSH 1
  195. #define TCIOFLUSH 2
  196. /* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */
  197. #define TCSANOW 0
  198. #define TCSADRAIN 1
  199. #define TCSAFLUSH 2
  200. #endif /* _ALPHA_TERMBITS_H */