0005-PowerPC-sync-with-termios-fix-from-glibc.patch 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. From 11d50ce9f44e5d2224ec6a3d8a9225d9164c7c64 Mon Sep 17 00:00:00 2001
  2. From: Vadim Kochan <vadim4j@gmail.com>
  3. Date: Tue, 20 Aug 2019 23:16:18 +0300
  4. Subject: [PATCH] PowerPC: sync with termios fix from glibc
  5. It fixes the following bug:
  6. https://bugzilla.redhat.com/show_bug.cgi?id=1122714
  7. with original glibc's fix:
  8. d4795e4a43e6f0c221bc5 (PowerPC: Fix termios definitions)
  9. https://sourceware.org/git/?p=glibc.git;a=commit;h=d4795e4a43e6f0c221bc5dc64c612206a21a177b
  10. Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
  11. ---
  12. libc/sysdeps/linux/powerpc/bits/ioctl-types.h | 74 +++-
  13. libc/sysdeps/linux/powerpc/bits/termios.h | 320 ------------------
  14. 2 files changed, 73 insertions(+), 321 deletions(-)
  15. delete mode 100644 libc/sysdeps/linux/powerpc/bits/termios.h
  16. diff --git a/libc/sysdeps/linux/powerpc/bits/ioctl-types.h b/libc/sysdeps/linux/powerpc/bits/ioctl-types.h
  17. index 87b8265af..926061fa8 100644
  18. --- a/libc/sysdeps/linux/powerpc/bits/ioctl-types.h
  19. +++ b/libc/sysdeps/linux/powerpc/bits/ioctl-types.h
  20. @@ -1,5 +1,77 @@
  21. +/* Structure types for pre-termios terminal ioctls. Linux/powerpc version.
  22. + Copyright (C) 2014-2019 Free Software Foundation, Inc.
  23. + This file is part of the GNU C Library.
  24. +
  25. + The GNU C Library is free software; you can redistribute it and/or
  26. + modify it under the terms of the GNU Lesser General Public
  27. + License as published by the Free Software Foundation; either
  28. + version 2.1 of the License, or (at your option) any later version.
  29. +
  30. + The GNU C Library is distributed in the hope that it will be useful,
  31. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  32. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  33. + Lesser General Public License for more details.
  34. +
  35. + You should have received a copy of the GNU Lesser General Public
  36. + License along with the GNU C Library; if not, see
  37. + <http://www.gnu.org/licenses/>. */
  38. +
  39. #ifndef _SYS_IOCTL_H
  40. # error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead."
  41. #endif
  42. -#include <termios.h>
  43. +/* Get definition of constants for use with `ioctl'. */
  44. +#include <asm/ioctls.h>
  45. +
  46. +
  47. +struct winsize
  48. + {
  49. + unsigned short int ws_row;
  50. + unsigned short int ws_col;
  51. + unsigned short int ws_xpixel;
  52. + unsigned short int ws_ypixel;
  53. + };
  54. +
  55. +#define NCC 10
  56. +struct termio
  57. + {
  58. + unsigned short int c_iflag; /* input mode flags */
  59. + unsigned short int c_oflag; /* output mode flags */
  60. + unsigned short int c_cflag; /* control mode flags */
  61. + unsigned short int c_lflag; /* local mode flags */
  62. + unsigned char c_line; /* line discipline */
  63. + unsigned char c_cc[NCC]; /* control characters */
  64. +};
  65. +
  66. +/* modem lines */
  67. +#define TIOCM_LE 0x001
  68. +#define TIOCM_DTR 0x002
  69. +#define TIOCM_RTS 0x004
  70. +#define TIOCM_ST 0x008
  71. +#define TIOCM_SR 0x010
  72. +#define TIOCM_CTS 0x020
  73. +#define TIOCM_CAR 0x040
  74. +#define TIOCM_RNG 0x080
  75. +#define TIOCM_DSR 0x100
  76. +#define TIOCM_CD TIOCM_CAR
  77. +#define TIOCM_RI TIOCM_RNG
  78. +
  79. +/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
  80. +
  81. +/* line disciplines */
  82. +#define N_TTY 0
  83. +#define N_SLIP 1
  84. +#define N_MOUSE 2
  85. +#define N_PPP 3
  86. +#define N_STRIP 4
  87. +#define N_AX25 5
  88. +#define N_X25 6 /* X.25 async */
  89. +#define N_6PACK 7
  90. +#define N_MASC 8 /* Mobitex module */
  91. +#define N_R3964 9 /* Simatic R3964 module */
  92. +#define N_PROFIBUS_FDL 10 /* Profibus */
  93. +#define N_IRDA 11 /* Linux IR */
  94. +#define N_SMSBLOCK 12 /* SMS block mode */
  95. +#define N_HDLC 13 /* synchronous HDLC */
  96. +#define N_SYNC_PPP 14 /* synchronous PPP */
  97. +#define N_HCI 15 /* Bluetooth HCI UART */
  98. diff --git a/libc/sysdeps/linux/powerpc/bits/termios.h b/libc/sysdeps/linux/powerpc/bits/termios.h
  99. deleted file mode 100644
  100. index ffd99a5e2..000000000
  101. --- a/libc/sysdeps/linux/powerpc/bits/termios.h
  102. +++ /dev/null
  103. @@ -1,320 +0,0 @@
  104. -/* Copyright (C) 1997,1999,2001,2003,2004,2005 Free Software Foundation, Inc.
  105. - This file is part of the GNU C Library.
  106. -
  107. - The GNU C Library is free software; you can redistribute it and/or
  108. - modify it under the terms of the GNU Lesser General Public
  109. - License as published by the Free Software Foundation; either
  110. - version 2.1 of the License, or (at your option) any later version.
  111. -
  112. - The GNU C Library is distributed in the hope that it will be useful,
  113. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  114. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  115. - Lesser General Public License for more details.
  116. -
  117. - You should have received a copy of the GNU Lesser General Public
  118. - License along with the GNU C Library; if not, see
  119. - <http://www.gnu.org/licenses/>. */
  120. -
  121. -#ifndef _TERMIOS_H
  122. -# error "Never include <bits/termios.h> directly; use <termios.h> instead."
  123. -#endif
  124. -
  125. -typedef unsigned char cc_t;
  126. -typedef unsigned int speed_t;
  127. -typedef unsigned int tcflag_t;
  128. -
  129. -/*
  130. - * termios type and macro definitions. Be careful about adding stuff
  131. - * to this file since it's used in GNU libc and there are strict rules
  132. - * concerning namespace pollution.
  133. - */
  134. -
  135. -#define NCCS 32
  136. -struct termios {
  137. - tcflag_t c_iflag; /* input mode flags */
  138. - tcflag_t c_oflag; /* output mode flags */
  139. - tcflag_t c_cflag; /* control mode flags */
  140. - tcflag_t c_lflag; /* local mode flags */
  141. - cc_t c_line; /* line discipline (== c_cc[19]) */
  142. - cc_t c_cc[NCCS]; /* control characters */
  143. - speed_t c_ispeed; /* input speed */
  144. - speed_t c_ospeed; /* output speed */
  145. -#define _HAVE_STRUCT_TERMIOS_C_ISPEED 1
  146. -#define _HAVE_STRUCT_TERMIOS_C_OSPEED 1
  147. -};
  148. -
  149. -/* c_cc characters */
  150. -#define VINTR 0
  151. -#define VQUIT 1
  152. -#define VERASE 2
  153. -#define VKILL 3
  154. -#define VEOF 4
  155. -#define VMIN 5
  156. -#define VEOL 6
  157. -#define VTIME 7
  158. -#define VEOL2 8
  159. -#define VSWTC 9
  160. -
  161. -#define VWERASE 10
  162. -#define VREPRINT 11
  163. -#define VSUSP 12
  164. -#define VSTART 13
  165. -#define VSTOP 14
  166. -#define VLNEXT 15
  167. -#define VDISCARD 16
  168. -
  169. -/* c_iflag bits */
  170. -#define IGNBRK 0000001
  171. -#define BRKINT 0000002
  172. -#define IGNPAR 0000004
  173. -#define PARMRK 0000010
  174. -#define INPCK 0000020
  175. -#define ISTRIP 0000040
  176. -#define INLCR 0000100
  177. -#define IGNCR 0000200
  178. -#define ICRNL 0000400
  179. -#define IXON 0001000
  180. -#define IXOFF 0002000
  181. -#define IXANY 0004000
  182. -#define IUCLC 0010000
  183. -#define IMAXBEL 0020000
  184. -#define IUTF8 0040000
  185. -
  186. -/* c_oflag bits */
  187. -#define OPOST 0000001
  188. -#define ONLCR 0000002
  189. -#define OLCUC 0000004
  190. -
  191. -#define OCRNL 0000010
  192. -#define ONOCR 0000020
  193. -#define ONLRET 0000040
  194. -
  195. -#define OFILL 00000100
  196. -#define OFDEL 00000200
  197. -#if defined __USE_MISC || defined __USE_XOPEN
  198. -# define NLDLY 00001400
  199. -# define NL0 00000000
  200. -# define NL1 00000400
  201. -# define NL2 00001000
  202. -# define NL3 00001400
  203. -# define TABDLY 00006000
  204. -# define TAB0 00000000
  205. -# define TAB1 00002000
  206. -# define TAB2 00004000
  207. -# define TAB3 00006000
  208. -# define CRDLY 00030000
  209. -# define CR0 00000000
  210. -# define CR1 00010000
  211. -# define CR2 00020000
  212. -# define CR3 00030000
  213. -# define FFDLY 00040000
  214. -# define FF0 00000000
  215. -# define FF1 00040000
  216. -# define BSDLY 00100000
  217. -# define BS0 00000000
  218. -# define BS1 00100000
  219. -#endif
  220. -#define VTDLY 00200000
  221. -#define VT0 00000000
  222. -#define VT1 00200000
  223. -
  224. -#ifdef __USE_MISC
  225. -# define XTABS 00006000
  226. -#endif
  227. -
  228. -/* c_cflag bit meaning */
  229. -#ifdef __USE_MISC
  230. -# define CBAUD 0000377
  231. -#endif
  232. -#define B0 0000000 /* hang up */
  233. -#define B50 0000001
  234. -#define B75 0000002
  235. -#define B110 0000003
  236. -#define B134 0000004
  237. -#define B150 0000005
  238. -#define B200 0000006
  239. -#define B300 0000007
  240. -#define B600 0000010
  241. -#define B1200 0000011
  242. -#define B1800 0000012
  243. -#define B2400 0000013
  244. -#define B4800 0000014
  245. -#define B9600 0000015
  246. -#define B19200 0000016
  247. -#define B38400 0000017
  248. -#ifdef __USE_MISC
  249. -# define EXTA B19200
  250. -# define EXTB B38400
  251. -# define CBAUDEX 0000020
  252. -#endif
  253. -#define B57600 00020
  254. -#define B115200 00021
  255. -#define B230400 00022
  256. -#define B460800 00023
  257. -#define B500000 00024
  258. -#define B576000 00025
  259. -#define B921600 00026
  260. -#define B1000000 00027
  261. -#define B1152000 00030
  262. -#define B1500000 00031
  263. -#define B2000000 00032
  264. -#define B2500000 00033
  265. -#define B3000000 00034
  266. -#define B3500000 00035
  267. -#define B4000000 00036
  268. -#define __MAX_BAUD B4000000
  269. -
  270. -#define CSIZE 00001400
  271. -#define CS5 00000000
  272. -#define CS6 00000400
  273. -#define CS7 00001000
  274. -#define CS8 00001400
  275. -
  276. -#define CSTOPB 00002000
  277. -#define CREAD 00004000
  278. -#define PARENB 00010000
  279. -#define PARODD 00020000
  280. -#define HUPCL 00040000
  281. -
  282. -#define CLOCAL 00100000
  283. -#ifdef __USE_MISC
  284. -# define CMSPAR 010000000000 /* mark or space (stick) parity */
  285. -# define CRTSCTS 020000000000 /* flow control */
  286. -#endif
  287. -
  288. -/* c_lflag bits */
  289. -#define ISIG 0x00000080
  290. -#define ICANON 0x00000100
  291. -#if defined __USE_MISC || defined __USE_XOPEN
  292. -# define XCASE 0x00004000
  293. -#endif
  294. -#define ECHO 0x00000008
  295. -#define ECHOE 0x00000002
  296. -#define ECHOK 0x00000004
  297. -#define ECHONL 0x00000010
  298. -#define NOFLSH 0x80000000
  299. -#define TOSTOP 0x00400000
  300. -#ifdef __USE_MISC
  301. -# define ECHOCTL 0x00000040
  302. -# define ECHOPRT 0x00000020
  303. -# define ECHOKE 0x00000001
  304. -# define FLUSHO 0x00800000
  305. -# define PENDIN 0x20000000
  306. -#endif
  307. -#define IEXTEN 0x00000400
  308. -
  309. -/* Values for the ACTION argument to `tcflow'. */
  310. -#define TCOOFF 0
  311. -#define TCOON 1
  312. -#define TCIOFF 2
  313. -#define TCION 3
  314. -
  315. -/* Values for the QUEUE_SELECTOR argument to `tcflush'. */
  316. -#define TCIFLUSH 0
  317. -#define TCOFLUSH 1
  318. -#define TCIOFLUSH 2
  319. -
  320. -/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */
  321. -#define TCSANOW 0
  322. -#define TCSADRAIN 1
  323. -#define TCSAFLUSH 2
  324. -
  325. -#ifndef __UCLIBC_STRICT_HEADERS__
  326. -struct sgttyb {
  327. - char sg_ispeed;
  328. - char sg_ospeed;
  329. - char sg_erase;
  330. - char sg_kill;
  331. - short sg_flags;
  332. -};
  333. -#endif
  334. -
  335. -struct tchars {
  336. - char t_intrc;
  337. - char t_quitc;
  338. - char t_startc;
  339. - char t_stopc;
  340. - char t_eofc;
  341. - char t_brkc;
  342. -};
  343. -
  344. -struct ltchars {
  345. - char t_suspc;
  346. - char t_dsuspc;
  347. - char t_rprntc;
  348. - char t_flushc;
  349. - char t_werasc;
  350. - char t_lnextc;
  351. -};
  352. -
  353. -/* Used for packet mode */
  354. -#define TIOCPKT_DATA 0
  355. -#define TIOCPKT_FLUSHREAD 1
  356. -#define TIOCPKT_FLUSHWRITE 2
  357. -#define TIOCPKT_STOP 4
  358. -#define TIOCPKT_START 8
  359. -#define TIOCPKT_NOSTOP 16
  360. -#define TIOCPKT_DOSTOP 32
  361. -
  362. -struct winsize {
  363. - unsigned short ws_row;
  364. - unsigned short ws_col;
  365. - unsigned short ws_xpixel;
  366. - unsigned short ws_ypixel;
  367. -};
  368. -
  369. -#define NCC 10
  370. -struct termio {
  371. - unsigned short c_iflag; /* input mode flags */
  372. - unsigned short c_oflag; /* output mode flags */
  373. - unsigned short c_cflag; /* control mode flags */
  374. - unsigned short c_lflag; /* local mode flags */
  375. - unsigned char c_line; /* line discipline */
  376. - unsigned char c_cc[NCC]; /* control characters */
  377. -};
  378. -
  379. -/* c_cc characters */
  380. -#define _VINTR 0
  381. -#define _VQUIT 1
  382. -#define _VERASE 2
  383. -#define _VKILL 3
  384. -#define _VEOF 4
  385. -#define _VMIN 5
  386. -#define _VEOL 6
  387. -#define _VTIME 7
  388. -#define _VEOL2 8
  389. -#define _VSWTC 9
  390. -
  391. -/* modem lines */
  392. -#define TIOCM_LE 0x001
  393. -#define TIOCM_DTR 0x002
  394. -#define TIOCM_RTS 0x004
  395. -#define TIOCM_ST 0x008
  396. -#define TIOCM_SR 0x010
  397. -#define TIOCM_CTS 0x020
  398. -#define TIOCM_CAR 0x040
  399. -#define TIOCM_RNG 0x080
  400. -#define TIOCM_DSR 0x100
  401. -#define TIOCM_CD TIOCM_CAR
  402. -#define TIOCM_RI TIOCM_RNG
  403. -
  404. -/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
  405. -#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
  406. -
  407. -/* line disciplines */
  408. -#define N_TTY 0
  409. -#define N_SLIP 1
  410. -#define N_MOUSE 2
  411. -#define N_PPP 3
  412. -#define N_STRIP 4
  413. -#define N_AX25 5
  414. -#define N_X25 6 /* X.25 async */
  415. -#define N_6PACK 7
  416. -#define N_MASC 8 /* Mobitex module */
  417. -#define N_R3964 9 /* Simatic R3964 module */
  418. -#define N_PROFIBUS_FDL 10 /* Profibus */
  419. -#define N_IRDA 11 /* Linux IR */
  420. -#define N_SMSBLOCK 12 /* SMS block mode */
  421. -#define N_HDLC 13 /* synchronous HDLC */
  422. -#define N_SYNC_PPP 14 /* synchronous PPP */
  423. -#define N_HCI 15 /* Bluetooth HCI UART */
  424. --
  425. 2.22.0