]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
termios: Consolidate control mode definitions
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 9 Oct 2018 18:03:30 +0000 (15:03 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 3 Jan 2019 11:32:12 +0000 (09:32 -0200)
This patch consolidates the termios symbolic constants used for output
mode with c_cflag memver on its own header.  The Linux generic
implementation values match the kernel UAPI and each architecture with
deviate values have their own implementation (in this case alpha and
powerpc).

No semantic change is expected, checked on a build against x86_64-linux-gnu,
alpha-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu.

* sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add
termios-c_cflag.h.
* sysdeps/unix/sysv/linux/bits/termios-c_cflag.h: New file.
* sysdeps/unix/sysv/linux/alpha/bits/termios-c_cflag.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/bits/termios-c_cflag.h: Likewise.
* sysdeps/unix/sysv/linux/bits/termios.h (CSIZE, CS5, CS6, CS7, CS8,
CSTOPB, CREAD, PARENB, PARODD, HUPCL, CLOCAL): Move to
termios-c_cflag.h.
* sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise.
* sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise.

ChangeLog
sysdeps/unix/sysv/linux/Makefile
sysdeps/unix/sysv/linux/alpha/bits/termios-c_cflag.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/alpha/bits/termios.h
sysdeps/unix/sysv/linux/bits/termios-c_cflag.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/bits/termios.h
sysdeps/unix/sysv/linux/mips/bits/termios.h
sysdeps/unix/sysv/linux/powerpc/bits/termios-c_cflag.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/powerpc/bits/termios.h
sysdeps/unix/sysv/linux/sparc/bits/termios.h

index a3a5495fb32039c145a644af13a84d4513888faf..47d1010230a0fdaccc404d40aadabc2ea3ccbad8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2019-01-03  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
+       * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add
+       termios-c_cflag.h.
+       * sysdeps/unix/sysv/linux/bits/termios-c_cflag.h: New file.
+       * sysdeps/unix/sysv/linux/alpha/bits/termios-c_cflag.h: Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/bits/termios-c_cflag.h: Likewise.
+       * sysdeps/unix/sysv/linux/bits/termios.h (CSIZE, CS5, CS6, CS7, CS8,
+       CSTOPB, CREAD, PARENB, PARODD, HUPCL, CLOCAL): Move to
+       termios-c_cflag.h.
+       * sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise.
+       * sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise.
+
        [BZ #23783]
        * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add
        termios-baud.h.
index e1ddbf97871bdce374581e61caec628e0a6635c3..9186e3af963780d3a03ed037609b07ac762af594 100644 (file)
@@ -46,7 +46,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
                  bits/msq-pad.h bits/sem-pad.h bits/shmlba.h bits/shm-pad.h \
                  bits/termios-struct.h bits/termios-c_cc.h \
                  bits/termios-c_iflag.h bits/termios-c_oflag.h \
-                 bits/termios-baud.h
+                 bits/termios-baud.h bits/termios-c_cflag.h
 
 tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
         tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios-c_cflag.h b/sysdeps/unix/sysv/linux/alpha/bits/termios-c_cflag.h
new file mode 100644 (file)
index 0000000..8f97063
--- /dev/null
@@ -0,0 +1,35 @@
+/* termios control mode definitions.  Linux/alpha version.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _TERMIOS_H
+# error "Never include <bits/termios-c_cflag.h> directly; use <termios.h> instead."
+#endif
+
+#define CSIZE  00001400
+#define   CS5  00000000
+#define   CS6  00000400
+#define   CS7  00001000
+#define   CS8  00001400
+
+#define CSTOPB 00002000
+#define CREAD  00004000
+#define PARENB 00010000
+#define PARODD 00020000
+#define HUPCL  00040000
+
+#define CLOCAL 00100000
index 69a436b91e9944a2810711801c0c13c3bf52bfb4..59cb224914edd514356060cc0829c7fb3330a2d4 100644 (file)
@@ -52,19 +52,7 @@ typedef unsigned int tcflag_t;
 #endif
 #include <bits/termios-baud.h>
 
-#define CSIZE  00001400
-#define   CS5  00000000
-#define   CS6  00000400
-#define   CS7  00001000
-#define   CS8  00001400
-
-#define CSTOPB 00002000
-#define CREAD  00004000
-#define PARENB 00010000
-#define PARODD 00020000
-#define HUPCL  00040000
-
-#define CLOCAL 00100000
+#include <bits/termios-c_cflag.h>
 
 /* c_lflag bits */
 #define ISIG   0x00000080
diff --git a/sysdeps/unix/sysv/linux/bits/termios-c_cflag.h b/sysdeps/unix/sysv/linux/bits/termios-c_cflag.h
new file mode 100644 (file)
index 0000000..1da79b7
--- /dev/null
@@ -0,0 +1,34 @@
+/* termios control mode definitions.  Linux/generic version.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _TERMIOS_H
+# error "Never include <bits/termios-c_cflag.h> directly; use <termios.h> instead."
+#endif
+
+/* c_cflag bits.  */
+#define CSIZE  0000060
+#define   CS5  0000000
+#define   CS6  0000020
+#define   CS7  0000040
+#define   CS8  0000060
+#define CSTOPB 0000100
+#define CREAD  0000200
+#define PARENB 0000400
+#define PARODD 0001000
+#define HUPCL  0002000
+#define CLOCAL 0004000
index 2267418864959657b5a7c89549bc741570a2edee..0ec195d44f04fe519bfd548d506b0c9d8002f2aa 100644 (file)
@@ -52,17 +52,7 @@ typedef unsigned int tcflag_t;
 #endif
 #include <bits/termios-baud.h>
 
-#define CSIZE  0000060
-#define   CS5  0000000
-#define   CS6  0000020
-#define   CS7  0000040
-#define   CS8  0000060
-#define CSTOPB 0000100
-#define CREAD  0000200
-#define PARENB 0000400
-#define PARODD 0001000
-#define HUPCL  0002000
-#define CLOCAL 0004000
+#include <bits/termios-c_cflag.h>
 
 /* c_lflag bits */
 #define ISIG   0000001
index ac316ba9242a317f539e8794a89655e7c1abca41..443283f6d3614d21db61eac42f6bd22deacbbfc3 100644 (file)
@@ -52,17 +52,7 @@ typedef unsigned int tcflag_t;
 #endif
 #include <bits/termios-baud.h>
 
-#define CSIZE  0000060         /* Number of bits per byte (mask).  */
-#define   CS5  0000000         /* 5 bits per byte.  */
-#define   CS6  0000020         /* 6 bits per byte.  */
-#define   CS7  0000040         /* 7 bits per byte.  */
-#define   CS8  0000060         /* 8 bits per byte.  */
-#define CSTOPB 0000100         /* Two stop bits instead of one.  */
-#define CREAD  0000200         /* Enable receiver.  */
-#define PARENB 0000400         /* Parity enable.  */
-#define PARODD 0001000         /* Odd parity instead of even.  */
-#define HUPCL  0002000         /* Hang up on last close.  */
-#define CLOCAL 0004000         /* Ignore modem status lines.  */
+#include <bits/termios-c_cflag.h>
 
 /* c_lflag bits */
 #define ISIG   0000001         /* Enable signals.  */
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios-c_cflag.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios-c_cflag.h
new file mode 100644 (file)
index 0000000..5742359
--- /dev/null
@@ -0,0 +1,35 @@
+/* termios control mode definitions.  Linux/powerpc version.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _TERMIOS_H
+# error "Never include <bits/termios-c_cflag.h> directly; use <termios.h> instead."
+#endif
+
+#define CSIZE  00001400
+#define   CS5  00000000
+#define   CS6  00000400
+#define   CS7  00001000
+#define   CS8  00001400
+
+#define CSTOPB 00002000
+#define CREAD  00004000
+#define PARENB 00010000
+#define PARODD 00020000
+#define HUPCL  00040000
+
+#define CLOCAL 00100000
index e35de92529687d1edea9a7ada57cccf43e042d2d..8b6cbf5b2c0a278033e959e7cc23438b26a007f7 100644 (file)
@@ -51,19 +51,7 @@ typedef unsigned int tcflag_t;
 #endif
 #include <bits/termios-baud.h>
 
-#define CSIZE  00001400
-#define   CS5  00000000
-#define   CS6  00000400
-#define   CS7  00001000
-#define   CS8  00001400
-
-#define CSTOPB 00002000
-#define CREAD  00004000
-#define PARENB 00010000
-#define PARODD 00020000
-#define HUPCL  00040000
-
-#define CLOCAL 00100000
+#include <bits/termios-c_cflag.h>
 
 /* c_lflag bits */
 #define ISIG   0x00000080
index 38128e7c6a0c8dfa70d623187ba098a4c6640027..32d942426378222a3aa81a643f68f37b33ef86aa 100644 (file)
@@ -52,17 +52,7 @@ typedef unsigned int tcflag_t;
 #endif
 #include <bits/termios-baud.h>
 
-#define  CSIZE  0x00000030
-#define   CS5  0x00000000
-#define   CS6  0x00000010
-#define   CS7  0x00000020
-#define   CS8  0x00000030
-#define CSTOPB 0x00000040
-#define CREAD  0x00000080
-#define PARENB 0x00000100
-#define PARODD 0x00000200
-#define HUPCL  0x00000400
-#define CLOCAL 0x00000800
+#include <bits/termios-c_cflag.h>
 
 /* c_lflag bits */
 #define ISIG   0x00000001