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