termbits.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _ALPHA_TERMBITS_H
  3. #define _ALPHA_TERMBITS_H
  4. #include <asm-generic/termbits-common.h>
  5. typedef unsigned int tcflag_t;
  6. /*
  7. * termios type and macro definitions. Be careful about adding stuff
  8. * to this file since it's used in GNU libc and there are strict rules
  9. * concerning namespace pollution.
  10. */
  11. #define NCCS 19
  12. struct termios {
  13. tcflag_t c_iflag; /* input mode flags */
  14. tcflag_t c_oflag; /* output mode flags */
  15. tcflag_t c_cflag; /* control mode flags */
  16. tcflag_t c_lflag; /* local mode flags */
  17. cc_t c_cc[NCCS]; /* control characters */
  18. cc_t c_line; /* line discipline (== c_cc[19]) */
  19. speed_t c_ispeed; /* input speed */
  20. speed_t c_ospeed; /* output speed */
  21. };
  22. /* Alpha has identical termios and termios2 */
  23. struct termios2 {
  24. tcflag_t c_iflag; /* input mode flags */
  25. tcflag_t c_oflag; /* output mode flags */
  26. tcflag_t c_cflag; /* control mode flags */
  27. tcflag_t c_lflag; /* local mode flags */
  28. cc_t c_cc[NCCS]; /* control characters */
  29. cc_t c_line; /* line discipline (== c_cc[19]) */
  30. speed_t c_ispeed; /* input speed */
  31. speed_t c_ospeed; /* output speed */
  32. };
  33. /* Alpha has matching termios and ktermios */
  34. struct ktermios {
  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_cc[NCCS]; /* control characters */
  40. cc_t c_line; /* line discipline (== c_cc[19]) */
  41. speed_t c_ispeed; /* input speed */
  42. speed_t c_ospeed; /* output speed */
  43. };
  44. /* c_cc characters */
  45. #define VEOF 0
  46. #define VEOL 1
  47. #define VEOL2 2
  48. #define VERASE 3
  49. #define VWERASE 4
  50. #define VKILL 5
  51. #define VREPRINT 6
  52. #define VSWTC 7
  53. #define VINTR 8
  54. #define VQUIT 9
  55. #define VSUSP 10
  56. #define VSTART 12
  57. #define VSTOP 13
  58. #define VLNEXT 14
  59. #define VDISCARD 15
  60. #define VMIN 16
  61. #define VTIME 17
  62. /* c_iflag bits */
  63. #define IXON 0x0200
  64. #define IXOFF 0x0400
  65. #define IUCLC 0x1000
  66. #define IMAXBEL 0x2000
  67. #define IUTF8 0x4000
  68. /* c_oflag bits */
  69. #define ONLCR 0x00002
  70. #define OLCUC 0x00004
  71. #define NLDLY 0x00300
  72. #define NL0 0x00000
  73. #define NL1 0x00100
  74. #define NL2 0x00200
  75. #define NL3 0x00300
  76. #define TABDLY 0x00c00
  77. #define TAB0 0x00000
  78. #define TAB1 0x00400
  79. #define TAB2 0x00800
  80. #define TAB3 0x00c00
  81. #define CRDLY 0x03000
  82. #define CR0 0x00000
  83. #define CR1 0x01000
  84. #define CR2 0x02000
  85. #define CR3 0x03000
  86. #define FFDLY 0x04000
  87. #define FF0 0x00000
  88. #define FF1 0x04000
  89. #define BSDLY 0x08000
  90. #define BS0 0x00000
  91. #define BS1 0x08000
  92. #define VTDLY 0x10000
  93. #define VT0 0x00000
  94. #define VT1 0x10000
  95. /*
  96. * Should be equivalent to TAB3, see description of TAB3 in
  97. * POSIX.1-2008, Ch. 11.2.3 "Output Modes"
  98. */
  99. #define XTABS TAB3
  100. /* c_cflag bit meaning */
  101. #define CBAUD 0x0000001f
  102. #define CBAUDEX 0x00000000
  103. #define BOTHER 0x0000001f
  104. #define B57600 0x00000010
  105. #define B115200 0x00000011
  106. #define B230400 0x00000012
  107. #define B460800 0x00000013
  108. #define B500000 0x00000014
  109. #define B576000 0x00000015
  110. #define B921600 0x00000016
  111. #define B1000000 0x00000017
  112. #define B1152000 0x00000018
  113. #define B1500000 0x00000019
  114. #define B2000000 0x0000001a
  115. #define B2500000 0x0000001b
  116. #define B3000000 0x0000001c
  117. #define B3500000 0x0000001d
  118. #define B4000000 0x0000001e
  119. #define CSIZE 0x00000300
  120. #define CS5 0x00000000
  121. #define CS6 0x00000100
  122. #define CS7 0x00000200
  123. #define CS8 0x00000300
  124. #define CSTOPB 0x00000400
  125. #define CREAD 0x00000800
  126. #define PARENB 0x00001000
  127. #define PARODD 0x00002000
  128. #define HUPCL 0x00004000
  129. #define CLOCAL 0x00008000
  130. #define CIBAUD 0x001f0000
  131. /* c_lflag bits */
  132. #define ISIG 0x00000080
  133. #define ICANON 0x00000100
  134. #define XCASE 0x00004000
  135. #define ECHO 0x00000008
  136. #define ECHOE 0x00000002
  137. #define ECHOK 0x00000004
  138. #define ECHONL 0x00000010
  139. #define NOFLSH 0x80000000
  140. #define TOSTOP 0x00400000
  141. #define ECHOCTL 0x00000040
  142. #define ECHOPRT 0x00000020
  143. #define ECHOKE 0x00000001
  144. #define FLUSHO 0x00800000
  145. #define PENDIN 0x20000000
  146. #define IEXTEN 0x00000400
  147. #define EXTPROC 0x10000000
  148. /* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */
  149. #define TCSANOW 0
  150. #define TCSADRAIN 1
  151. #define TCSAFLUSH 2
  152. #endif /* _ALPHA_TERMBITS_H */