termbits.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. /* from asm/termbits.h */
  2. #ifndef LINUX_USER_SPARC64_TERMBITS_H
  3. #define LINUX_USER_SPARC64_TERMBITS_H
  4. #define TARGET_NCCS 19
  5. struct target_termios {
  6. unsigned int c_iflag; /* input mode flags */
  7. unsigned int c_oflag; /* output mode flags */
  8. unsigned int c_cflag; /* control mode flags */
  9. unsigned int c_lflag; /* local mode flags */
  10. unsigned char c_line; /* line discipline */
  11. unsigned char c_cc[TARGET_NCCS]; /* control characters */
  12. };
  13. /* c_cc characters */
  14. #define TARGET_VINTR 0
  15. #define TARGET_VQUIT 1
  16. #define TARGET_VERASE 2
  17. #define TARGET_VKILL 3
  18. #define TARGET_VEOF 4
  19. #define TARGET_VEOL 5
  20. #define TARGET_VEOL2 6
  21. #define TARGET_VSWTC 7
  22. #define TARGET_VSTART 8
  23. #define TARGET_VSTOP 9
  24. #define TARGET_VSUSP 10
  25. #define TARGET_VDSUSP 11 /* SunOS POSIX nicety I do believe... */
  26. #define TARGET_VREPRINT 12
  27. #define TARGET_VDISCARD 13
  28. #define TARGET_VWERASE 14
  29. #define TARGET_VLNEXT 15
  30. /* Kernel keeps vmin/vtime separated, user apps assume vmin/vtime is
  31. * shared with eof/eol
  32. */
  33. #define TARGET_VMIN TARGET_VEOF
  34. #define TARGET_VTIME TARGET_VEOL
  35. /* c_iflag bits */
  36. #define TARGET_IGNBRK 0x00000001
  37. #define TARGET_BRKINT 0x00000002
  38. #define TARGET_IGNPAR 0x00000004
  39. #define TARGET_PARMRK 0x00000008
  40. #define TARGET_INPCK 0x00000010
  41. #define TARGET_ISTRIP 0x00000020
  42. #define TARGET_INLCR 0x00000040
  43. #define TARGET_IGNCR 0x00000080
  44. #define TARGET_ICRNL 0x00000100
  45. #define TARGET_IUCLC 0x00000200
  46. #define TARGET_IXON 0x00000400
  47. #define TARGET_IXANY 0x00000800
  48. #define TARGET_IXOFF 0x00001000
  49. #define TARGET_IMAXBEL 0x00002000
  50. #define TARGET_IUTF8 0x00004000
  51. /* c_oflag bits */
  52. #define TARGET_OPOST 0x00000001
  53. #define TARGET_OLCUC 0x00000002
  54. #define TARGET_ONLCR 0x00000004
  55. #define TARGET_OCRNL 0x00000008
  56. #define TARGET_ONOCR 0x00000010
  57. #define TARGET_ONLRET 0x00000020
  58. #define TARGET_OFILL 0x00000040
  59. #define TARGET_OFDEL 0x00000080
  60. #define TARGET_NLDLY 0x00000100
  61. #define TARGET_NL0 0x00000000
  62. #define TARGET_NL1 0x00000100
  63. #define TARGET_CRDLY 0x00000600
  64. #define TARGET_CR0 0x00000000
  65. #define TARGET_CR1 0x00000200
  66. #define TARGET_CR2 0x00000400
  67. #define TARGET_CR3 0x00000600
  68. #define TARGET_TABDLY 0x00001800
  69. #define TARGET_TAB0 0x00000000
  70. #define TARGET_TAB1 0x00000800
  71. #define TARGET_TAB2 0x00001000
  72. #define TARGET_TAB3 0x00001800
  73. #define TARGET_XTABS 0x00001800
  74. #define TARGET_BSDLY 0x00002000
  75. #define TARGET_BS0 0x00000000
  76. #define TARGET_BS1 0x00002000
  77. #define TARGET_VTDLY 0x00004000
  78. #define TARGET_VT0 0x00000000
  79. #define TARGET_VT1 0x00004000
  80. #define TARGET_FFDLY 0x00008000
  81. #define TARGET_FF0 0x00000000
  82. #define TARGET_FF1 0x00008000
  83. #define TARGET_PAGEOUT 0x00010000 /* SUNOS specific */
  84. #define TARGET_WRAP 0x00020000 /* SUNOS specific */
  85. /* c_cflag bit meaning */
  86. #define TARGET_CBAUD 0x0000100f
  87. #define TARGET_B0 0x00000000 /* hang up */
  88. #define TARGET_B50 0x00000001
  89. #define TARGET_B75 0x00000002
  90. #define TARGET_B110 0x00000003
  91. #define TARGET_B134 0x00000004
  92. #define TARGET_B150 0x00000005
  93. #define TARGET_B200 0x00000006
  94. #define TARGET_B300 0x00000007
  95. #define TARGET_B600 0x00000008
  96. #define TARGET_B1200 0x00000009
  97. #define TARGET_B1800 0x0000000a
  98. #define TARGET_B2400 0x0000000b
  99. #define TARGET_B4800 0x0000000c
  100. #define TARGET_B9600 0x0000000d
  101. #define TARGET_B19200 0x0000000e
  102. #define TARGET_B38400 0x0000000f
  103. #define TARGET_EXTA B19200
  104. #define TARGET_EXTB B38400
  105. #define TARGET_CSIZE 0x00000030
  106. #define TARGET_CS5 0x00000000
  107. #define TARGET_CS6 0x00000010
  108. #define TARGET_CS7 0x00000020
  109. #define TARGET_CS8 0x00000030
  110. #define TARGET_CSTOPB 0x00000040
  111. #define TARGET_CREAD 0x00000080
  112. #define TARGET_PARENB 0x00000100
  113. #define TARGET_PARODD 0x00000200
  114. #define TARGET_HUPCL 0x00000400
  115. #define TARGET_CLOCAL 0x00000800
  116. #define TARGET_CBAUDEX 0x00001000
  117. /* We'll never see these speeds with the Zilogs, but for completeness... */
  118. #define TARGET_B57600 0x00001001
  119. #define TARGET_B115200 0x00001002
  120. #define TARGET_B230400 0x00001003
  121. #define TARGET_B460800 0x00001004
  122. /* This is what we can do with the Zilogs. */
  123. #define TARGET_B76800 0x00001005
  124. /* This is what we can do with the SAB82532. */
  125. #define TARGET_B153600 0x00001006
  126. #define TARGET_B307200 0x00001007
  127. #define TARGET_B614400 0x00001008
  128. #define TARGET_B921600 0x00001009
  129. /* And these are the rest... */
  130. #define TARGET_B500000 0x0000100a
  131. #define TARGET_B576000 0x0000100b
  132. #define TARGET_B1000000 0x0000100c
  133. #define TARGET_B1152000 0x0000100d
  134. #define TARGET_B1500000 0x0000100e
  135. #define TARGET_B2000000 0x0000100f
  136. /* These have totally bogus values and nobody uses them
  137. so far. Later on we'd have to use say 0x10000x and
  138. adjust CBAUD constant and drivers accordingly.
  139. #define B2500000 0x00001010
  140. #define B3000000 0x00001011
  141. #define B3500000 0x00001012
  142. #define B4000000 0x00001013 */
  143. #define TARGET_CIBAUD 0x100f0000 /* input baud rate (not used) */
  144. #define TARGET_CMSPAR 0x40000000 /* mark or space (stick) parity */
  145. #define TARGET_CRTSCTS 0x80000000 /* flow control */
  146. /* c_lflag bits */
  147. #define TARGET_ISIG 0x00000001
  148. #define TARGET_ICANON 0x00000002
  149. #define TARGET_XCASE 0x00000004
  150. #define TARGET_ECHO 0x00000008
  151. #define TARGET_ECHOE 0x00000010
  152. #define TARGET_ECHOK 0x00000020
  153. #define TARGET_ECHONL 0x00000040
  154. #define TARGET_NOFLSH 0x00000080
  155. #define TARGET_TOSTOP 0x00000100
  156. #define TARGET_ECHOCTL 0x00000200
  157. #define TARGET_ECHOPRT 0x00000400
  158. #define TARGET_ECHOKE 0x00000800
  159. #define TARGET_DEFECHO 0x00001000 /* SUNOS thing, what is it? */
  160. #define TARGET_FLUSHO 0x00002000
  161. #define TARGET_PENDIN 0x00004000
  162. #define TARGET_IEXTEN 0x00008000
  163. /* ioctls */
  164. /* Big T */
  165. #define TARGET_TCGETA TARGET_IOR('T', 1, struct target_termio)
  166. #define TARGET_TCSETA TARGET_IOW('T', 2, struct target_termio)
  167. #define TARGET_TCSETAW TARGET_IOW('T', 3, struct target_termio)
  168. #define TARGET_TCSETAF TARGET_IOW('T', 4, struct target_termio)
  169. #define TARGET_TCSBRK TARGET_IO('T', 5)
  170. #define TARGET_TCXONC TARGET_IO('T', 6)
  171. #define TARGET_TCFLSH TARGET_IO('T', 7)
  172. #define TARGET_TCGETS TARGET_IOR('T', 8, struct target_termios)
  173. #define TARGET_TCSETS TARGET_IOW('T', 9, struct target_termios)
  174. #define TARGET_TCSETSW TARGET_IOW('T', 10, struct target_termios)
  175. #define TARGET_TCSETSF TARGET_IOW('T', 11, struct target_termios)
  176. /* Note that all the ioctls that are not available in Linux have a
  177. * double underscore on the front to: a) avoid some programs to
  178. * thing we support some ioctls under Linux (autoconfiguration stuff)
  179. */
  180. /* Little t */
  181. #define TARGET_TIOCGETD TARGET_IOR('t', 0, int)
  182. #define TARGET_TIOCSETD TARGET_IOW('t', 1, int)
  183. //#define __TIOCHPCL _IO('t', 2) /* SunOS Specific */
  184. //#define __TIOCMODG _IOR('t', 3, int) /* SunOS Specific */
  185. //#define __TIOCMODS _IOW('t', 4, int) /* SunOS Specific */
  186. //#define __TIOCGETP _IOR('t', 8, struct sgttyb) /* SunOS Specific */
  187. //#define __TIOCSETP _IOW('t', 9, struct sgttyb) /* SunOS Specific */
  188. //#define __TIOCSETN _IOW('t', 10, struct sgttyb) /* SunOS Specific */
  189. #define TARGET_TIOCEXCL TARGET_IO('t', 13)
  190. #define TARGET_TIOCNXCL TARGET_IO('t', 14)
  191. //#define __TIOCFLUSH _IOW('t', 16, int) /* SunOS Specific */
  192. //#define __TIOCSETC _IOW('t', 17, struct tchars) /* SunOS Specific */
  193. //#define __TIOCGETC _IOR('t', 18, struct tchars) /* SunOS Specific */
  194. //#define __TIOCTCNTL _IOW('t', 32, int) /* SunOS Specific */
  195. //#define __TIOCSIGNAL _IOW('t', 33, int) /* SunOS Specific */
  196. //#define __TIOCSETX _IOW('t', 34, int) /* SunOS Specific */
  197. //#define __TIOCGETX _IOR('t', 35, int) /* SunOS Specific */
  198. #define TARGET_TIOCCONS TARGET_IO('t', 36)
  199. //#define __TIOCSSIZE _IOW('t', 37, struct sunos_ttysize) /* SunOS Specific */
  200. //#define __TIOCGSIZE _IOR('t', 38, struct sunos_ttysize) /* SunOS Specific */
  201. #define TARGET_TIOCGSOFTCAR TARGET_IOR('t', 100, int)
  202. #define TARGET_TIOCSSOFTCAR TARGET_IOW('t', 101, int)
  203. //#define __TIOCUCNTL _IOW('t', 102, int) /* SunOS Specific */
  204. #define TARGET_TIOCSWINSZ TARGET_IOW('t', 103, struct winsize)
  205. #define TARGET_TIOCGWINSZ TARGET_IOR('t', 104, struct winsize)
  206. //#define __TIOCREMOTE _IOW('t', 105, int) /* SunOS Specific */
  207. #define TARGET_TIOCMGET TARGET_IOR('t', 106, int)
  208. #define TARGET_TIOCMBIC TARGET_IOW('t', 107, int)
  209. #define TARGET_TIOCMBIS TARGET_IOW('t', 108, int)
  210. #define TARGET_TIOCMSET TARGET_IOW('t', 109, int)
  211. #define TARGET_TIOCSTART TARGET_IO('t', 110)
  212. #define TARGET_TIOCSTOP TARGET_IO('t', 111)
  213. #define TARGET_TIOCPKT TARGET_IOW('t', 112, int)
  214. #define TARGET_TIOCNOTTY TARGET_IO('t', 113)
  215. #define TARGET_TIOCSTI TARGET_IOW('t', 114, char)
  216. #define TARGET_TIOCOUTQ TARGET_IOR('t', 115, int)
  217. //#define __TIOCGLTC _IOR('t', 116, struct ltchars) /* SunOS Specific */
  218. //#define __TIOCSLTC _IOW('t', 117, struct ltchars) /* SunOS Specific */
  219. /* 118 is the non-posix setpgrp tty ioctl */
  220. /* 119 is the non-posix getpgrp tty ioctl */
  221. //#define __TIOCCDTR TARGET_IO('t', 120) /* SunOS Specific */
  222. //#define __TIOCSDTR TARGET_IO('t', 121) /* SunOS Specific */
  223. #define TARGET_TIOCCBRK TARGET_IO('t', 122)
  224. #define TARGET_TIOCSBRK TARGET_IO('t', 123)
  225. //#define __TIOCLGET TARGET_IOW('t', 124, int) /* SunOS Specific */
  226. //#define __TIOCLSET TARGET_IOW('t', 125, int) /* SunOS Specific */
  227. //#define __TIOCLBIC TARGET_IOW('t', 126, int) /* SunOS Specific */
  228. //#define __TIOCLBIS TARGET_IOW('t', 127, int) /* SunOS Specific */
  229. //#define __TIOCISPACE TARGET_IOR('t', 128, int) /* SunOS Specific */
  230. //#define __TIOCISIZE TARGET_IOR('t', 129, int) /* SunOS Specific */
  231. #define TARGET_TIOCSPGRP TARGET_IOW('t', 130, int)
  232. #define TARGET_TIOCGPGRP TARGET_IOR('t', 131, int)
  233. #define TARGET_TIOCSCTTY TARGET_IO('t', 132)
  234. #define TARGET_TIOCGSID TARGET_IOR('t', 133, int)
  235. /* Get minor device of a pty master's FD -- Solaris equiv is ISPTM */
  236. #define TARGET_TIOCGPTN TARGET_IOR('t', 134, unsigned int) /* Get Pty Number */
  237. #define TARGET_TIOCSPTLCK TARGET_IOW('t', 135, int) /* Lock/unlock PTY */
  238. #define TARGET_TIOCGPTPEER TARGET_IO('t', 137) /* Safely open the slave */
  239. /* Little f */
  240. #define TARGET_FIOCLEX TARGET_IO('f', 1)
  241. #define TARGET_FIONCLEX TARGET_IO('f', 2)
  242. #define TARGET_FIOASYNC TARGET_IOW('f', 125, int)
  243. #define TARGET_FIONBIO TARGET_IOW('f', 126, int)
  244. #define TARGET_FIONREAD TARGET_IOR('f', 127, int)
  245. #define TARGET_TIOCINQ TARGET_FIONREAD
  246. /* SCARY Rutgers local SunOS kernel hackery, perhaps I will support it
  247. * someday. This is completely bogus, I know...
  248. */
  249. //#define __TCGETSTAT TARGET_IO('T', 200) /* Rutgers specific */
  250. //#define __TCSETSTAT TARGET_IO('T', 201) /* Rutgers specific */
  251. /* Linux specific, no SunOS equivalent. */
  252. #define TARGET_TIOCLINUX 0x541C
  253. #define TARGET_TIOCGSERIAL 0x541E
  254. #define TARGET_TIOCSSERIAL 0x541F
  255. #define TARGET_TCSBRKP 0x5425
  256. #define TARGET_TIOCTTYGSTRUCT 0x5426
  257. #define TARGET_TIOCSERCONFIG 0x5453
  258. #define TARGET_TIOCSERGWILD 0x5454
  259. #define TARGET_TIOCSERSWILD 0x5455
  260. #define TARGET_TIOCGLCKTRMIOS 0x5456
  261. #define TARGET_TIOCSLCKTRMIOS 0x5457
  262. #define TARGET_TIOCSERGSTRUCT 0x5458 /* For debugging only */
  263. #define TARGET_TIOCSERGETLSR 0x5459 /* Get line status register */
  264. #define TARGET_TIOCSERGETMULTI 0x545A /* Get multiport config */
  265. #define TARGET_TIOCSERSETMULTI 0x545B /* Set multiport config */
  266. #define TARGET_TIOCMIWAIT 0x545C /* Wait input */
  267. #define TARGET_TIOCGICOUNT 0x545D /* Read serial port inline interrupt counts */
  268. #endif