lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | /* Copyright (C) 1997 Free Software Foundation, Inc. |
| 2 | This file is part of the GNU C Library. |
| 3 | |
| 4 | The GNU C Library is free software; you can redistribute it and/or |
| 5 | modify it under the terms of the GNU Lesser General Public |
| 6 | License as published by the Free Software Foundation; either |
| 7 | version 2.1 of the License, or (at your option) any later version. |
| 8 | |
| 9 | The GNU C Library is distributed in the hope that it will be useful, |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | Lesser General Public License for more details. |
| 13 | |
| 14 | You should have received a copy of the GNU Lesser General Public |
| 15 | License along with the GNU C Library; if not, write to the Free |
| 16 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
| 17 | 02111-1307 USA. */ |
| 18 | |
| 19 | #ifndef _KERNEL_TERMIOS_H |
| 20 | #define _KERNEL_TERMIOS_H 1 |
| 21 | |
| 22 | /* We need the definition of tcflag_t, cc_t, and speed_t. */ |
| 23 | #include <termios.h> |
| 24 | |
| 25 | /* The following corresponds to the values from the Linux 2.1.20 kernel. */ |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | #if defined( __sparc__ ) |
| 31 | |
| 32 | |
| 33 | #define __KERNEL_NCCS 17 |
| 34 | struct __kernel_termios |
| 35 | { |
| 36 | tcflag_t c_iflag; /* input mode flags */ |
| 37 | tcflag_t c_oflag; /* output mode flags */ |
| 38 | tcflag_t c_cflag; /* control mode flags */ |
| 39 | tcflag_t c_lflag; /* local mode flags */ |
| 40 | cc_t c_line; /* line discipline */ |
| 41 | cc_t c_cc[__KERNEL_NCCS]; /* control characters */ |
| 42 | }; |
| 43 | |
| 44 | |
| 45 | |
| 46 | #elif defined(__powerpc__) |
| 47 | |
| 48 | |
| 49 | |
| 50 | #define __KERNEL_NCCS 19 |
| 51 | struct __kernel_termios |
| 52 | { |
| 53 | tcflag_t c_iflag; /* input mode flags */ |
| 54 | tcflag_t c_oflag; /* output mode flags */ |
| 55 | tcflag_t c_cflag; /* control mode flags */ |
| 56 | tcflag_t c_lflag; /* local mode flags */ |
| 57 | cc_t c_cc[__KERNEL_NCCS]; /* control characters */ |
| 58 | cc_t c_line; /* line discipline */ |
| 59 | speed_t c_ispeed; /* input speed */ |
| 60 | speed_t c_ospeed; /* output speed */ |
| 61 | }; |
| 62 | |
| 63 | #define _HAVE_C_ISPEED 1 |
| 64 | #define _HAVE_C_OSPEED 1 |
| 65 | |
| 66 | /* We have the kernel termios structure, so we can presume this code knows |
| 67 | what it's doing... */ |
| 68 | #undef TCGETS |
| 69 | #undef TCSETS |
| 70 | #undef TCSETSW |
| 71 | #undef TCSETSF |
| 72 | #define TCGETS _IOR ('t', 19, struct __kernel_termios) |
| 73 | #define TCSETS _IOW ('t', 20, struct __kernel_termios) |
| 74 | #define TCSETSW _IOW ('t', 21, struct __kernel_termios) |
| 75 | #define TCSETSF _IOW ('t', 22, struct __kernel_termios) |
| 76 | |
| 77 | |
| 78 | |
| 79 | #elif defined(__mips__) |
| 80 | |
| 81 | |
| 82 | |
| 83 | #define __KERNEL_NCCS 23 |
| 84 | struct __kernel_termios |
| 85 | { |
| 86 | tcflag_t c_iflag; /* input mode flags */ |
| 87 | tcflag_t c_oflag; /* output mode flags */ |
| 88 | tcflag_t c_cflag; /* control mode flags */ |
| 89 | tcflag_t c_lflag; /* local mode flags */ |
| 90 | cc_t c_line; /* line discipline */ |
| 91 | cc_t c_cc[__KERNEL_NCCS]; /* control characters */ |
| 92 | }; |
| 93 | |
| 94 | |
| 95 | |
| 96 | #elif defined(__alpha__) |
| 97 | |
| 98 | |
| 99 | |
| 100 | #define __KERNEL_NCCS 19 |
| 101 | struct __kernel_termios |
| 102 | { |
| 103 | tcflag_t c_iflag; /* input mode flags */ |
| 104 | tcflag_t c_oflag; /* output mode flags */ |
| 105 | tcflag_t c_cflag; /* control mode flags */ |
| 106 | tcflag_t c_lflag; /* local mode flags */ |
| 107 | cc_t c_cc[__KERNEL_NCCS]; /* control characters */ |
| 108 | cc_t c_line; /* line discipline */ |
| 109 | speed_t c_ispeed; /* input speed */ |
| 110 | speed_t c_ospeed; /* output speed */ |
| 111 | }; |
| 112 | |
| 113 | #define _HAVE_C_ISPEED 1 |
| 114 | #define _HAVE_C_OSPEED 1 |
| 115 | |
| 116 | |
| 117 | |
| 118 | #else /* None of the above */ |
| 119 | |
| 120 | |
| 121 | |
| 122 | #define __KERNEL_NCCS 19 |
| 123 | struct __kernel_termios |
| 124 | { |
| 125 | tcflag_t c_iflag; /* input mode flags */ |
| 126 | tcflag_t c_oflag; /* output mode flags */ |
| 127 | tcflag_t c_cflag; /* control mode flags */ |
| 128 | tcflag_t c_lflag; /* local mode flags */ |
| 129 | cc_t c_line; /* line discipline */ |
| 130 | cc_t c_cc[__KERNEL_NCCS]; /* control characters */ |
| 131 | }; |
| 132 | |
| 133 | #endif |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | #endif /* kernel_termios.h */ |
| 139 | |