History

termbits.h: create termbits-common.h for identical bits

Some defines are the same across all archs. Move the most obvious intersection to termbits-common.h.

Ilpo Järvinen committed 4 years ago

Commit 0b46ac41 parent 135c5797 files · +76 −306Browse files

Showing the changes to include/uapi (2 of 7 files). Show all

Unified · Split

2 files
  1. include/uapi/asm-generic/termbits-common.h +65 −0
  2. include/uapi/asm-generic/termbits.h +2 −51
include/uapi/asm-generic/termbits-common.h+65−0
@@ -0,0 +1,65 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_GENERIC_TERMBITS_COMMON_H
3#define __ASM_GENERIC_TERMBITS_COMMON_H
4
5typedef unsigned char cc_t;
6typedef unsigned int speed_t;
7
8/* c_iflag bits */
9#define IGNBRK 0x001 /* Ignore break condition */
10#define BRKINT 0x002 /* Signal interrupt on break */
11#define IGNPAR 0x004 /* Ignore characters with parity errors */
12#define PARMRK 0x008 /* Mark parity and framing errors */
13#define INPCK 0x010 /* Enable input parity check */
14#define ISTRIP 0x020 /* Strip 8th bit off characters */
15#define INLCR 0x040 /* Map NL to CR on input */
16#define IGNCR 0x080 /* Ignore CR */
17#define ICRNL 0x100 /* Map CR to NL on input */
18#define IXANY 0x800 /* Any character will restart after stop */
19
20/* c_oflag bits */
21#define OPOST 0x01 /* Perform output processing */
22#define OCRNL 0x08
23#define ONOCR 0x10
24#define ONLRET 0x20
25#define OFILL 0x40
26#define OFDEL 0x80
27
28/* c_cflag bit meaning */
29/* Common CBAUD rates */
30#define B0 0x00000000 /* hang up */
31#define B50 0x00000001
32#define B75 0x00000002
33#define B110 0x00000003
34#define B134 0x00000004
35#define B150 0x00000005
36#define B200 0x00000006
37#define B300 0x00000007
38#define B600 0x00000008
39#define B1200 0x00000009
40#define B1800 0x0000000a
41#define B2400 0x0000000b
42#define B4800 0x0000000c
43#define B9600 0x0000000d
44#define B19200 0x0000000e
45#define B38400 0x0000000f
46#define EXTA B19200
47#define EXTB B38400
48
49#define CMSPAR 0x40000000 /* mark or space (stick) parity */
50#define CRTSCTS 0x80000000 /* flow control */
51
52#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
53
54/* tcflow() ACTION argument and TCXONC use these */
55#define TCOOFF 0 /* Suspend output */
56#define TCOON 1 /* Restart suspended output */
57#define TCIOFF 2 /* Send a STOP character */
58#define TCION 3 /* Send a START character */
59
60/* tcflush() QUEUE_SELECTOR argument and TCFLSH use these */
61#define TCIFLUSH 0 /* Discard data received but not yet read */
62#define TCOFLUSH 1 /* Discard data written but not yet sent */
63#define TCIOFLUSH 2 /* Discard all pending data */
64
65#endif /* __ASM_GENERIC_TERMBITS_COMMON_H */
include/uapi/asm-generic/termbits.h+2−51
@@ -4,8 +4,8 @@ · 3 unmodified lines
4 4
5#include <linux/posix_types.h>5#include <linux/posix_types.h>
6 6
7typedef unsigned char cc_t;7#include <asm-generic/termbits-common.h>
8typedef unsigned int speed_t;8
9typedef unsigned int tcflag_t;9typedef unsigned int tcflag_t;
10 10
11#define NCCS 1911#define NCCS 19
@@ -60,31 +60,15 @@ struct ktermios { · 48 unmodified lines
60#define VEOL2 1660#define VEOL2 16
61 61
62/* c_iflag bits */62/* c_iflag bits */
63#define IGNBRK 0x00001
64#define BRKINT 0x00002
65#define IGNPAR 0x00004
66#define PARMRK 0x00008
67#define INPCK 0x00010
68#define ISTRIP 0x00020
69#define INLCR 0x00040
70#define IGNCR 0x00080
71#define ICRNL 0x00100
72#define IUCLC 0x0020063#define IUCLC 0x00200
73#define IXON 0x0040064#define IXON 0x00400
74#define IXANY 0x00800
75#define IXOFF 0x0100065#define IXOFF 0x01000
76#define IMAXBEL 0x0200066#define IMAXBEL 0x02000
77#define IUTF8 0x0400067#define IUTF8 0x04000
78 68
79/* c_oflag bits */69/* c_oflag bits */
80#define OPOST 0x00001
81#define OLCUC 0x0000270#define OLCUC 0x00002
82#define ONLCR 0x0000471#define ONLCR 0x00004
83#define OCRNL 0x00008
84#define ONOCR 0x00010
85#define ONLRET 0x00020
86#define OFILL 0x00040
87#define OFDEL 0x00080
88#define NLDLY 0x0010072#define NLDLY 0x00100
89#define NL0 0x0000073#define NL0 0x00000
90#define NL1 0x0010074#define NL1 0x00100
@@ -111,24 +95,6 @@ struct ktermios { · 20 unmodified lines
111 95
112/* c_cflag bit meaning */96/* c_cflag bit meaning */
113#define CBAUD 0x0000100f97#define CBAUD 0x0000100f
114#define B0 0x00000000 /* hang up */
115#define B50 0x00000001
116#define B75 0x00000002
117#define B110 0x00000003
118#define B134 0x00000004
119#define B150 0x00000005
120#define B200 0x00000006
121#define B300 0x00000007
122#define B600 0x00000008
123#define B1200 0x00000009
124#define B1800 0x0000000a
125#define B2400 0x0000000b
126#define B4800 0x0000000c
127#define B9600 0x0000000d
128#define B19200 0x0000000e
129#define B38400 0x0000000f
130#define EXTA B19200
131#define EXTB B38400
132#define CSIZE 0x0000003098#define CSIZE 0x00000030
133#define CS5 0x0000000099#define CS5 0x00000000
134#define CS6 0x00000010100#define CS6 0x00000010
@@ -158,10 +124,6 @@ struct ktermios { · 23 unmodified lines
158#define B3500000 0x0000100e124#define B3500000 0x0000100e
159#define B4000000 0x0000100f125#define B4000000 0x0000100f
160#define CIBAUD 0x100f0000 /* input baud rate */126#define CIBAUD 0x100f0000 /* input baud rate */
161#define CMSPAR 0x40000000 /* mark or space (stick) parity */
162#define CRTSCTS 0x80000000 /* flow control */
163
164#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
165 127
166/* c_lflag bits */128/* c_lflag bits */
167#define ISIG 0x00001129#define ISIG 0x00001
@@ -181,17 +143,6 @@ struct ktermios { · 13 unmodified lines
181#define IEXTEN 0x08000143#define IEXTEN 0x08000
182#define EXTPROC 0x10000144#define EXTPROC 0x10000
183 145
184/* tcflow() and TCXONC use these */
185#define TCOOFF 0
186#define TCOON 1
187#define TCIOFF 2
188#define TCION 3
189
190/* tcflush() and TCFLSH use these */
191#define TCIFLUSH 0
192#define TCOFLUSH 1
193#define TCIOFLUSH 2
194
195/* tcsetattr uses these */146/* tcsetattr uses these */
196#define TCSANOW 0147#define TCSANOW 0
197#define TCSADRAIN 1148#define TCSADRAIN 1