1997-07-12 23:32:57 +00:00
|
|
|
/* termios type and macro definitions. Linux/MIPS version.
|
2019-01-01 00:11:28 +00:00
|
|
|
Copyright (C) 1993-2019 Free Software Foundation, Inc.
|
1997-07-12 23:32:57 +00:00
|
|
|
This file is part of the GNU C Library.
|
|
|
|
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
2001-07-06 04:56:23 +00:00
|
|
|
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.
|
1997-07-12 23:32:57 +00:00
|
|
|
|
|
|
|
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
|
2001-07-06 04:56:23 +00:00
|
|
|
Lesser General Public License for more details.
|
1997-07-12 23:32:57 +00:00
|
|
|
|
2001-07-06 04:56:23 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2012-03-09 23:56:38 +00:00
|
|
|
License along with the GNU C Library. If not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
1997-07-12 23:32:57 +00:00
|
|
|
|
1997-11-26 04:14:44 +00:00
|
|
|
#ifndef _TERMIOS_H
|
|
|
|
# error "Never include <bits/termios.h> directly; use <termios.h> instead."
|
|
|
|
#endif
|
1997-07-12 23:32:57 +00:00
|
|
|
|
|
|
|
typedef unsigned char cc_t;
|
|
|
|
typedef unsigned int speed_t;
|
|
|
|
typedef unsigned int tcflag_t;
|
|
|
|
|
2018-10-09 13:00:14 +00:00
|
|
|
#include <bits/termios-struct.h>
|
termios: Consolidate termios c_cc symbolic constants
This patch consolidates the termios symbolic constants used as subscript
for the array c_cc 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, mips64, sparc64, 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 (sysdeps_headers): Add
termios-cc.h.
* sysdeps/unix/sysv/linux/bits/termios-c_cc.h: Likewise.
* sysdeps/unix/sysv/linux/alpha/bits/termios-c_cc.h: New file.
* sysdeps/unix/sysv/linux/mips/bits/termios-c_cc.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/bits/termios-c_cc.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/termios-c_cc.h: Likewise.
* sysdeps/unix/sysv/linux/bits/termios.h (VINTR, VQUIT, VERASE,
VKILL, VEOF, VTIME, VMIN, VSWTC, VSTART, VSTOP, VSUSP, VEOL,
VREPRINT, VDISCARD, VWERASE, VLNEXT, VEOLF2): Move to termios-cc.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.
2018-10-09 13:26:14 +00:00
|
|
|
#include <bits/termios-c_cc.h>
|
termios: Consolidate Input Modes definitions.
This patch consolidates the termios symbolic constants used for input
modes with c_iflag member 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 (sysdeps_headers): Add
termios-c_iflag.h.
* sysdeps/unix/sysv/linux/bits/termios-c_iflag.h: New file.
* sysdeps/unix/sysv/linux/alpha/bits/termios-c_iflag.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/bits/termios-c_iflag.h: Likewise.
* sysdeps/unix/sysv/linux/bits/termios.h (IGNBRK, BRKINT, IGNPAR, PARMRK,
INPCK, ISTRIP, INLCR, IGNCR, ICRNL, IXON, IXOFF, IXANY, IUCLC, IMAXBEL,
IUTF8): Move to termios-c_iflag.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.
2018-10-09 14:02:40 +00:00
|
|
|
#include <bits/termios-c_iflag.h>
|
termios: Consolidate Output Modes definitions
This patch consolidates the termios symbolic constants used for ouput
modes with c_oflag member 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, powerpc, and sparc).
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_routines): Add
termios-c_oflag.h.
* sysdeps/unix/sysv/linux/bits/termios-c_oflag.h: New file.
* sysdeps/unix/sysv/linux/alpha/bits/termios-c_oflag.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/bits/termios-c_oflag.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/termios-c_oflag.h: Likewise.
* sysdeps/unix/sysv/linux/bits/termios.h (OPOST, OLCUC, ONLCR, OCRNL,
ONOCR, ONLRET, OFILL, OFDEL, VTDLY, VT0, VT1): Move to
termios-c_oflag.h.
[__USE_MISC || __USE_XOPEN] (NLDLY, NL0, NL1, CRDLY, CR0, CR1, CR2,
CR3, TABDLY, TAB0, TAB1, TAB2, TAB3, BSDLY, BS0, BS1, FFDLY, FF0,
FFR1): Likewise.
[USE_MISC] (XTABS): Likewise.
* 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.
2018-10-09 14:56:06 +00:00
|
|
|
#include <bits/termios-c_oflag.h>
|
1997-07-12 23:32:57 +00:00
|
|
|
|
|
|
|
/* c_cflag bit meaning */
|
2001-10-15 11:55:20 +00:00
|
|
|
#ifdef __USE_MISC
|
|
|
|
# define CBAUD 0010017
|
|
|
|
#endif
|
1997-07-12 23:32:57 +00:00
|
|
|
#define B0 0000000 /* hang up */
|
|
|
|
#define B50 0000001
|
|
|
|
#define B75 0000002
|
|
|
|
#define B110 0000003
|
|
|
|
#define B134 0000004
|
|
|
|
#define B150 0000005
|
|
|
|
#define B200 0000006
|
|
|
|
#define B300 0000007
|
|
|
|
#define B600 0000010
|
|
|
|
#define B1200 0000011
|
|
|
|
#define B1800 0000012
|
|
|
|
#define B2400 0000013
|
|
|
|
#define B4800 0000014
|
|
|
|
#define B9600 0000015
|
|
|
|
#define B19200 0000016
|
|
|
|
#define B38400 0000017
|
2001-10-15 11:55:20 +00:00
|
|
|
#ifdef __USE_MISC
|
|
|
|
# define EXTA B19200
|
|
|
|
# define EXTB B38400
|
|
|
|
#endif
|
1997-07-12 23:32:57 +00:00
|
|
|
#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. */
|
2001-10-15 11:55:20 +00:00
|
|
|
#ifdef __USE_MISC
|
1999-01-19 12:24:34 +00:00
|
|
|
# define CBAUDEX 0010000
|
2001-10-15 11:55:20 +00:00
|
|
|
#endif
|
|
|
|
#define B57600 0010001
|
|
|
|
#define B115200 0010002
|
|
|
|
#define B230400 0010003
|
|
|
|
#define B460800 0010004
|
|
|
|
#define B500000 0010005
|
|
|
|
#define B576000 0010006
|
|
|
|
#define B921600 0010007
|
|
|
|
#define B1000000 0010010
|
|
|
|
#define B1152000 0010011
|
|
|
|
#define B1500000 0010012
|
|
|
|
#define B2000000 0010013
|
|
|
|
#define B2500000 0010014
|
|
|
|
#define B3000000 0010015
|
|
|
|
#define B3500000 0010016
|
|
|
|
#define B4000000 0010017
|
|
|
|
#define __MAX_BAUD B4000000
|
|
|
|
#ifdef __USE_MISC
|
1997-11-26 04:14:44 +00:00
|
|
|
# define CIBAUD 002003600000 /* input baud rate (not used) */
|
|
|
|
# define CRTSCTS 020000000000 /* flow control */
|
1997-07-12 23:32:57 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* c_lflag bits */
|
|
|
|
#define ISIG 0000001 /* Enable signals. */
|
|
|
|
#define ICANON 0000002 /* Do erase and kill processing. */
|
2016-04-08 18:16:09 +00:00
|
|
|
#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
|
2001-10-15 11:55:20 +00:00
|
|
|
# define XCASE 0000004
|
|
|
|
#endif
|
1997-07-12 23:32:57 +00:00
|
|
|
#define ECHO 0000010 /* Enable echo. */
|
|
|
|
#define ECHOE 0000020 /* Visual erase for ERASE. */
|
|
|
|
#define ECHOK 0000040 /* Echo NL after KILL. */
|
|
|
|
#define ECHONL 0000100 /* Echo NL even if ECHO is off. */
|
|
|
|
#define NOFLSH 0000200 /* Disable flush after interrupt. */
|
|
|
|
#define IEXTEN 0000400 /* Enable DISCARD and LNEXT. */
|
2001-10-15 11:55:20 +00:00
|
|
|
#ifdef __USE_MISC
|
1997-11-26 04:14:44 +00:00
|
|
|
# define ECHOCTL 0001000 /* Echo control characters as ^X. */
|
|
|
|
# define ECHOPRT 0002000 /* Hardcopy visual erase. */
|
|
|
|
# define ECHOKE 0004000 /* Visual erase for KILL. */
|
2001-10-15 11:55:20 +00:00
|
|
|
# define FLUSHO 0020000
|
1997-11-26 04:14:44 +00:00
|
|
|
# define PENDIN 0040000 /* Retype pending input (state). */
|
1997-07-12 23:32:57 +00:00
|
|
|
#endif
|
|
|
|
#define TOSTOP 0100000 /* Send SIGTTOU for background output. */
|
|
|
|
#define ITOSTOP TOSTOP
|
2014-02-12 23:41:01 +00:00
|
|
|
#ifdef __USE_MISC
|
2010-08-13 16:50:07 +00:00
|
|
|
# define EXTPROC 0200000
|
|
|
|
#endif
|
1997-07-12 23:32:57 +00:00
|
|
|
|
2015-01-02 18:31:41 +00:00
|
|
|
#ifdef __USE_MISC
|
1997-07-12 23:32:57 +00:00
|
|
|
/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
|
2015-01-02 18:31:41 +00:00
|
|
|
# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
|
|
|
|
#endif
|
1997-07-12 23:32:57 +00:00
|
|
|
|
|
|
|
/* tcflow() and TCXONC use these */
|
|
|
|
#define TCOOFF 0 /* Suspend output. */
|
|
|
|
#define TCOON 1 /* Restart suspended output. */
|
|
|
|
#define TCIOFF 2 /* Send a STOP character. */
|
|
|
|
#define TCION 3 /* Send a START character. */
|
|
|
|
|
|
|
|
/* tcflush() and TCFLSH use these */
|
|
|
|
#define TCIFLUSH 0 /* Discard data received but not yet read. */
|
|
|
|
#define TCOFLUSH 1 /* Discard data written but not yet sent. */
|
|
|
|
#define TCIOFLUSH 2 /* Discard all pending data. */
|
|
|
|
|
|
|
|
/* tcsetattr uses these */
|
|
|
|
#define TCSANOW 0x540e /* Same as TCSETS; change immediately. */
|
|
|
|
#define TCSADRAIN 0x540f /* Same as TCSETSW; change when pending output is written. */
|
|
|
|
#define TCSAFLUSH 0x5410 /* Same as TCSETSF; flush pending input before changing. */
|
|
|
|
|
|
|
|
#define _IOT_termios /* Hurd ioctl type field. */ \
|
|
|
|
_IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
|