Commit d16436e686949a17b3bcfff2d688c97354b599aa
Committed by
David S. Miller
1 parent
483772469d
Exists in
master
and in
7 other branches
[SPARC]: remove duplicate TIOCPKT_ definitions
The TIOCPKT_ macros are defined by all other architectures in asm/ioctls.h and so does sparc and sparc64, so reomve the duplicates in asm/termios.h. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 2 changed files with 0 additions and 18 deletions Inline Diff
include/asm-sparc/termios.h
1 | /* $Id: termios.h,v 1.32 2001/06/01 08:12:11 davem Exp $ */ | 1 | /* $Id: termios.h,v 1.32 2001/06/01 08:12:11 davem Exp $ */ |
2 | #ifndef _SPARC_TERMIOS_H | 2 | #ifndef _SPARC_TERMIOS_H |
3 | #define _SPARC_TERMIOS_H | 3 | #define _SPARC_TERMIOS_H |
4 | 4 | ||
5 | #include <asm/ioctls.h> | 5 | #include <asm/ioctls.h> |
6 | #include <asm/termbits.h> | 6 | #include <asm/termbits.h> |
7 | 7 | ||
8 | #if defined(__KERNEL__) || defined(__DEFINE_BSD_TERMIOS) | 8 | #if defined(__KERNEL__) || defined(__DEFINE_BSD_TERMIOS) |
9 | struct sgttyb { | 9 | struct sgttyb { |
10 | char sg_ispeed; | 10 | char sg_ispeed; |
11 | char sg_ospeed; | 11 | char sg_ospeed; |
12 | char sg_erase; | 12 | char sg_erase; |
13 | char sg_kill; | 13 | char sg_kill; |
14 | short sg_flags; | 14 | short sg_flags; |
15 | }; | 15 | }; |
16 | 16 | ||
17 | struct tchars { | 17 | struct tchars { |
18 | char t_intrc; | 18 | char t_intrc; |
19 | char t_quitc; | 19 | char t_quitc; |
20 | char t_startc; | 20 | char t_startc; |
21 | char t_stopc; | 21 | char t_stopc; |
22 | char t_eofc; | 22 | char t_eofc; |
23 | char t_brkc; | 23 | char t_brkc; |
24 | }; | 24 | }; |
25 | 25 | ||
26 | struct ltchars { | 26 | struct ltchars { |
27 | char t_suspc; | 27 | char t_suspc; |
28 | char t_dsuspc; | 28 | char t_dsuspc; |
29 | char t_rprntc; | 29 | char t_rprntc; |
30 | char t_flushc; | 30 | char t_flushc; |
31 | char t_werasc; | 31 | char t_werasc; |
32 | char t_lnextc; | 32 | char t_lnextc; |
33 | }; | 33 | }; |
34 | #endif /* __KERNEL__ */ | 34 | #endif /* __KERNEL__ */ |
35 | 35 | ||
36 | struct sunos_ttysize { | 36 | struct sunos_ttysize { |
37 | int st_lines; /* Lines on the terminal */ | 37 | int st_lines; /* Lines on the terminal */ |
38 | int st_columns; /* Columns on the terminal */ | 38 | int st_columns; /* Columns on the terminal */ |
39 | }; | 39 | }; |
40 | 40 | ||
41 | /* Used for packet mode */ | ||
42 | #define TIOCPKT_DATA 0 | ||
43 | #define TIOCPKT_FLUSHREAD 1 | ||
44 | #define TIOCPKT_FLUSHWRITE 2 | ||
45 | #define TIOCPKT_STOP 4 | ||
46 | #define TIOCPKT_START 8 | ||
47 | #define TIOCPKT_NOSTOP 16 | ||
48 | #define TIOCPKT_DOSTOP 32 | ||
49 | |||
50 | struct winsize { | 41 | struct winsize { |
51 | unsigned short ws_row; | 42 | unsigned short ws_row; |
52 | unsigned short ws_col; | 43 | unsigned short ws_col; |
53 | unsigned short ws_xpixel; | 44 | unsigned short ws_xpixel; |
54 | unsigned short ws_ypixel; | 45 | unsigned short ws_ypixel; |
55 | }; | 46 | }; |
56 | 47 | ||
57 | /* line disciplines */ | 48 | /* line disciplines */ |
58 | #define N_TTY 0 | 49 | #define N_TTY 0 |
59 | #define N_SLIP 1 | 50 | #define N_SLIP 1 |
60 | #define N_MOUSE 2 | 51 | #define N_MOUSE 2 |
61 | #define N_PPP 3 | 52 | #define N_PPP 3 |
62 | #define N_STRIP 4 | 53 | #define N_STRIP 4 |
63 | #define N_AX25 5 | 54 | #define N_AX25 5 |
64 | #define N_X25 6 | 55 | #define N_X25 6 |
65 | #define N_6PACK 7 | 56 | #define N_6PACK 7 |
66 | #define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */ | 57 | #define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */ |
67 | #define N_R3964 9 /* Reserved for Simatic R3964 module */ | 58 | #define N_R3964 9 /* Reserved for Simatic R3964 module */ |
68 | #define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */ | 59 | #define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */ |
69 | #define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */ | 60 | #define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */ |
70 | #define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */ | 61 | #define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */ |
71 | #define N_HDLC 13 /* synchronous HDLC */ | 62 | #define N_HDLC 13 /* synchronous HDLC */ |
72 | #define N_SYNC_PPP 14 /* synchronous PPP */ | 63 | #define N_SYNC_PPP 14 /* synchronous PPP */ |
73 | #define N_HCI 15 /* Bluetooth HCI UART */ | 64 | #define N_HCI 15 /* Bluetooth HCI UART */ |
74 | 65 | ||
75 | #ifdef __KERNEL__ | 66 | #ifdef __KERNEL__ |
76 | #include <linux/module.h> | 67 | #include <linux/module.h> |
77 | 68 | ||
78 | /* | 69 | /* |
79 | * c_cc characters in the termio structure. Oh, how I love being | 70 | * c_cc characters in the termio structure. Oh, how I love being |
80 | * backwardly compatible. Notice that character 4 and 5 are | 71 | * backwardly compatible. Notice that character 4 and 5 are |
81 | * interpreted differently depending on whether ICANON is set in | 72 | * interpreted differently depending on whether ICANON is set in |
82 | * c_lflag. If it's set, they are used as _VEOF and _VEOL, otherwise | 73 | * c_lflag. If it's set, they are used as _VEOF and _VEOL, otherwise |
83 | * as _VMIN and V_TIME. This is for compatibility with OSF/1 (which | 74 | * as _VMIN and V_TIME. This is for compatibility with OSF/1 (which |
84 | * is compatible with sysV)... | 75 | * is compatible with sysV)... |
85 | */ | 76 | */ |
86 | #define _VMIN 4 | 77 | #define _VMIN 4 |
87 | #define _VTIME 5 | 78 | #define _VTIME 5 |
88 | 79 | ||
89 | 80 | ||
90 | /* intr=^C quit=^\ erase=del kill=^U | 81 | /* intr=^C quit=^\ erase=del kill=^U |
91 | eof=^D eol=\0 eol2=\0 sxtc=\0 | 82 | eof=^D eol=\0 eol2=\0 sxtc=\0 |
92 | start=^Q stop=^S susp=^Z dsusp=^Y | 83 | start=^Q stop=^S susp=^Z dsusp=^Y |
93 | reprint=^R discard=^U werase=^W lnext=^V | 84 | reprint=^R discard=^U werase=^W lnext=^V |
94 | vmin=\1 vtime=\0 | 85 | vmin=\1 vtime=\0 |
95 | */ | 86 | */ |
96 | #define INIT_C_CC "\003\034\177\025\004\000\000\000\021\023\032\031\022\025\027\026\001" | 87 | #define INIT_C_CC "\003\034\177\025\004\000\000\000\021\023\032\031\022\025\027\026\001" |
97 | 88 | ||
98 | /* | 89 | /* |
99 | * Translate a "termio" structure into a "termios". Ugh. | 90 | * Translate a "termio" structure into a "termios". Ugh. |
100 | */ | 91 | */ |
101 | #define user_termio_to_kernel_termios(termios, termio) \ | 92 | #define user_termio_to_kernel_termios(termios, termio) \ |
102 | ({ \ | 93 | ({ \ |
103 | unsigned short tmp; \ | 94 | unsigned short tmp; \ |
104 | get_user(tmp, &(termio)->c_iflag); \ | 95 | get_user(tmp, &(termio)->c_iflag); \ |
105 | (termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \ | 96 | (termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \ |
106 | get_user(tmp, &(termio)->c_oflag); \ | 97 | get_user(tmp, &(termio)->c_oflag); \ |
107 | (termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \ | 98 | (termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \ |
108 | get_user(tmp, &(termio)->c_cflag); \ | 99 | get_user(tmp, &(termio)->c_cflag); \ |
109 | (termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \ | 100 | (termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \ |
110 | get_user(tmp, &(termio)->c_lflag); \ | 101 | get_user(tmp, &(termio)->c_lflag); \ |
111 | (termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \ | 102 | (termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \ |
112 | copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ | 103 | copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ |
113 | 0; \ | 104 | 0; \ |
114 | }) | 105 | }) |
115 | 106 | ||
116 | /* | 107 | /* |
117 | * Translate a "termios" structure into a "termio". Ugh. | 108 | * Translate a "termios" structure into a "termio". Ugh. |
118 | * | 109 | * |
119 | * Note the "fun" _VMIN overloading. | 110 | * Note the "fun" _VMIN overloading. |
120 | */ | 111 | */ |
121 | #define kernel_termios_to_user_termio(termio, termios) \ | 112 | #define kernel_termios_to_user_termio(termio, termios) \ |
122 | ({ \ | 113 | ({ \ |
123 | put_user((termios)->c_iflag, &(termio)->c_iflag); \ | 114 | put_user((termios)->c_iflag, &(termio)->c_iflag); \ |
124 | put_user((termios)->c_oflag, &(termio)->c_oflag); \ | 115 | put_user((termios)->c_oflag, &(termio)->c_oflag); \ |
125 | put_user((termios)->c_cflag, &(termio)->c_cflag); \ | 116 | put_user((termios)->c_cflag, &(termio)->c_cflag); \ |
126 | put_user((termios)->c_lflag, &(termio)->c_lflag); \ | 117 | put_user((termios)->c_lflag, &(termio)->c_lflag); \ |
127 | put_user((termios)->c_line, &(termio)->c_line); \ | 118 | put_user((termios)->c_line, &(termio)->c_line); \ |
128 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ | 119 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ |
129 | if (!((termios)->c_lflag & ICANON)) { \ | 120 | if (!((termios)->c_lflag & ICANON)) { \ |
130 | put_user((termios)->c_cc[VMIN], &(termio)->c_cc[_VMIN]); \ | 121 | put_user((termios)->c_cc[VMIN], &(termio)->c_cc[_VMIN]); \ |
131 | put_user((termios)->c_cc[VTIME], &(termio)->c_cc[_VTIME]); \ | 122 | put_user((termios)->c_cc[VTIME], &(termio)->c_cc[_VTIME]); \ |
132 | } \ | 123 | } \ |
133 | 0; \ | 124 | 0; \ |
134 | }) | 125 | }) |
135 | 126 | ||
136 | #define user_termios_to_kernel_termios(k, u) \ | 127 | #define user_termios_to_kernel_termios(k, u) \ |
137 | ({ \ | 128 | ({ \ |
138 | get_user((k)->c_iflag, &(u)->c_iflag); \ | 129 | get_user((k)->c_iflag, &(u)->c_iflag); \ |
139 | get_user((k)->c_oflag, &(u)->c_oflag); \ | 130 | get_user((k)->c_oflag, &(u)->c_oflag); \ |
140 | get_user((k)->c_cflag, &(u)->c_cflag); \ | 131 | get_user((k)->c_cflag, &(u)->c_cflag); \ |
141 | get_user((k)->c_lflag, &(u)->c_lflag); \ | 132 | get_user((k)->c_lflag, &(u)->c_lflag); \ |
142 | get_user((k)->c_line, &(u)->c_line); \ | 133 | get_user((k)->c_line, &(u)->c_line); \ |
143 | copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \ | 134 | copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \ |
144 | if((k)->c_lflag & ICANON) { \ | 135 | if((k)->c_lflag & ICANON) { \ |
145 | get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ | 136 | get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ |
146 | get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ | 137 | get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ |
147 | } else { \ | 138 | } else { \ |
148 | get_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ | 139 | get_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ |
149 | get_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ | 140 | get_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ |
150 | } \ | 141 | } \ |
151 | 0; \ | 142 | 0; \ |
152 | }) | 143 | }) |
153 | 144 | ||
154 | #define kernel_termios_to_user_termios(u, k) \ | 145 | #define kernel_termios_to_user_termios(u, k) \ |
155 | ({ \ | 146 | ({ \ |
156 | put_user((k)->c_iflag, &(u)->c_iflag); \ | 147 | put_user((k)->c_iflag, &(u)->c_iflag); \ |
157 | put_user((k)->c_oflag, &(u)->c_oflag); \ | 148 | put_user((k)->c_oflag, &(u)->c_oflag); \ |
158 | put_user((k)->c_cflag, &(u)->c_cflag); \ | 149 | put_user((k)->c_cflag, &(u)->c_cflag); \ |
159 | put_user((k)->c_lflag, &(u)->c_lflag); \ | 150 | put_user((k)->c_lflag, &(u)->c_lflag); \ |
160 | put_user((k)->c_line, &(u)->c_line); \ | 151 | put_user((k)->c_line, &(u)->c_line); \ |
161 | copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \ | 152 | copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \ |
162 | if(!((k)->c_lflag & ICANON)) { \ | 153 | if(!((k)->c_lflag & ICANON)) { \ |
163 | put_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ | 154 | put_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ |
164 | put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ | 155 | put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ |
165 | } else { \ | 156 | } else { \ |
166 | put_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ | 157 | put_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ |
167 | put_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ | 158 | put_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ |
168 | } \ | 159 | } \ |
169 | 0; \ | 160 | 0; \ |
170 | }) | 161 | }) |
171 | 162 | ||
172 | #endif /* __KERNEL__ */ | 163 | #endif /* __KERNEL__ */ |
173 | 164 | ||
174 | #endif /* _SPARC_TERMIOS_H */ | 165 | #endif /* _SPARC_TERMIOS_H */ |
175 | 166 |
include/asm-sparc64/termios.h
1 | /* $Id: termios.h,v 1.11 2001/06/01 08:12:11 davem Exp $ */ | 1 | /* $Id: termios.h,v 1.11 2001/06/01 08:12:11 davem Exp $ */ |
2 | #ifndef _SPARC64_TERMIOS_H | 2 | #ifndef _SPARC64_TERMIOS_H |
3 | #define _SPARC64_TERMIOS_H | 3 | #define _SPARC64_TERMIOS_H |
4 | 4 | ||
5 | #include <asm/ioctls.h> | 5 | #include <asm/ioctls.h> |
6 | #include <asm/termbits.h> | 6 | #include <asm/termbits.h> |
7 | 7 | ||
8 | #if defined(__KERNEL__) || defined(__DEFINE_BSD_TERMIOS) | 8 | #if defined(__KERNEL__) || defined(__DEFINE_BSD_TERMIOS) |
9 | struct sgttyb { | 9 | struct sgttyb { |
10 | char sg_ispeed; | 10 | char sg_ispeed; |
11 | char sg_ospeed; | 11 | char sg_ospeed; |
12 | char sg_erase; | 12 | char sg_erase; |
13 | char sg_kill; | 13 | char sg_kill; |
14 | short sg_flags; | 14 | short sg_flags; |
15 | }; | 15 | }; |
16 | 16 | ||
17 | struct tchars { | 17 | struct tchars { |
18 | char t_intrc; | 18 | char t_intrc; |
19 | char t_quitc; | 19 | char t_quitc; |
20 | char t_startc; | 20 | char t_startc; |
21 | char t_stopc; | 21 | char t_stopc; |
22 | char t_eofc; | 22 | char t_eofc; |
23 | char t_brkc; | 23 | char t_brkc; |
24 | }; | 24 | }; |
25 | 25 | ||
26 | struct ltchars { | 26 | struct ltchars { |
27 | char t_suspc; | 27 | char t_suspc; |
28 | char t_dsuspc; | 28 | char t_dsuspc; |
29 | char t_rprntc; | 29 | char t_rprntc; |
30 | char t_flushc; | 30 | char t_flushc; |
31 | char t_werasc; | 31 | char t_werasc; |
32 | char t_lnextc; | 32 | char t_lnextc; |
33 | }; | 33 | }; |
34 | #endif /* __KERNEL__ */ | 34 | #endif /* __KERNEL__ */ |
35 | 35 | ||
36 | struct sunos_ttysize { | 36 | struct sunos_ttysize { |
37 | int st_lines; /* Lines on the terminal */ | 37 | int st_lines; /* Lines on the terminal */ |
38 | int st_columns; /* Columns on the terminal */ | 38 | int st_columns; /* Columns on the terminal */ |
39 | }; | 39 | }; |
40 | 40 | ||
41 | /* Used for packet mode */ | ||
42 | #define TIOCPKT_DATA 0 | ||
43 | #define TIOCPKT_FLUSHREAD 1 | ||
44 | #define TIOCPKT_FLUSHWRITE 2 | ||
45 | #define TIOCPKT_STOP 4 | ||
46 | #define TIOCPKT_START 8 | ||
47 | #define TIOCPKT_NOSTOP 16 | ||
48 | #define TIOCPKT_DOSTOP 32 | ||
49 | |||
50 | struct winsize { | 41 | struct winsize { |
51 | unsigned short ws_row; | 42 | unsigned short ws_row; |
52 | unsigned short ws_col; | 43 | unsigned short ws_col; |
53 | unsigned short ws_xpixel; | 44 | unsigned short ws_xpixel; |
54 | unsigned short ws_ypixel; | 45 | unsigned short ws_ypixel; |
55 | }; | 46 | }; |
56 | 47 | ||
57 | /* line disciplines */ | 48 | /* line disciplines */ |
58 | #define N_TTY 0 | 49 | #define N_TTY 0 |
59 | #define N_SLIP 1 | 50 | #define N_SLIP 1 |
60 | #define N_MOUSE 2 | 51 | #define N_MOUSE 2 |
61 | #define N_PPP 3 | 52 | #define N_PPP 3 |
62 | #define N_STRIP 4 | 53 | #define N_STRIP 4 |
63 | #define N_AX25 5 | 54 | #define N_AX25 5 |
64 | #define N_X25 6 | 55 | #define N_X25 6 |
65 | #define N_6PACK 7 | 56 | #define N_6PACK 7 |
66 | #define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */ | 57 | #define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */ |
67 | #define N_R3964 9 /* Reserved for Simatic R3964 module */ | 58 | #define N_R3964 9 /* Reserved for Simatic R3964 module */ |
68 | #define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */ | 59 | #define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */ |
69 | #define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */ | 60 | #define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */ |
70 | #define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */ | 61 | #define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */ |
71 | #define N_HDLC 13 /* synchronous HDLC */ | 62 | #define N_HDLC 13 /* synchronous HDLC */ |
72 | #define N_SYNC_PPP 14 /* synchronous PPP */ | 63 | #define N_SYNC_PPP 14 /* synchronous PPP */ |
73 | #define N_HCI 15 /* Bluetooth HCI UART */ | 64 | #define N_HCI 15 /* Bluetooth HCI UART */ |
74 | 65 | ||
75 | #ifdef __KERNEL__ | 66 | #ifdef __KERNEL__ |
76 | #include <linux/module.h> | 67 | #include <linux/module.h> |
77 | 68 | ||
78 | /* | 69 | /* |
79 | * c_cc characters in the termio structure. Oh, how I love being | 70 | * c_cc characters in the termio structure. Oh, how I love being |
80 | * backwardly compatible. Notice that character 4 and 5 are | 71 | * backwardly compatible. Notice that character 4 and 5 are |
81 | * interpreted differently depending on whether ICANON is set in | 72 | * interpreted differently depending on whether ICANON is set in |
82 | * c_lflag. If it's set, they are used as _VEOF and _VEOL, otherwise | 73 | * c_lflag. If it's set, they are used as _VEOF and _VEOL, otherwise |
83 | * as _VMIN and V_TIME. This is for compatibility with OSF/1 (which | 74 | * as _VMIN and V_TIME. This is for compatibility with OSF/1 (which |
84 | * is compatible with sysV)... | 75 | * is compatible with sysV)... |
85 | */ | 76 | */ |
86 | #define _VMIN 4 | 77 | #define _VMIN 4 |
87 | #define _VTIME 5 | 78 | #define _VTIME 5 |
88 | 79 | ||
89 | /* intr=^C quit=^\ erase=del kill=^U | 80 | /* intr=^C quit=^\ erase=del kill=^U |
90 | eof=^D eol=\0 eol2=\0 sxtc=\0 | 81 | eof=^D eol=\0 eol2=\0 sxtc=\0 |
91 | start=^Q stop=^S susp=^Z dsusp=^Y | 82 | start=^Q stop=^S susp=^Z dsusp=^Y |
92 | reprint=^R discard=^U werase=^W lnext=^V | 83 | reprint=^R discard=^U werase=^W lnext=^V |
93 | vmin=\1 vtime=\0 | 84 | vmin=\1 vtime=\0 |
94 | */ | 85 | */ |
95 | #define INIT_C_CC "\003\034\177\025\004\000\000\000\021\023\032\031\022\025\027\026\001" | 86 | #define INIT_C_CC "\003\034\177\025\004\000\000\000\021\023\032\031\022\025\027\026\001" |
96 | 87 | ||
97 | /* | 88 | /* |
98 | * Translate a "termio" structure into a "termios". Ugh. | 89 | * Translate a "termio" structure into a "termios". Ugh. |
99 | */ | 90 | */ |
100 | #define user_termio_to_kernel_termios(termios, termio) \ | 91 | #define user_termio_to_kernel_termios(termios, termio) \ |
101 | ({ \ | 92 | ({ \ |
102 | unsigned short tmp; \ | 93 | unsigned short tmp; \ |
103 | int err; \ | 94 | int err; \ |
104 | err = get_user(tmp, &(termio)->c_iflag); \ | 95 | err = get_user(tmp, &(termio)->c_iflag); \ |
105 | (termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \ | 96 | (termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \ |
106 | err |= get_user(tmp, &(termio)->c_oflag); \ | 97 | err |= get_user(tmp, &(termio)->c_oflag); \ |
107 | (termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \ | 98 | (termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \ |
108 | err |= get_user(tmp, &(termio)->c_cflag); \ | 99 | err |= get_user(tmp, &(termio)->c_cflag); \ |
109 | (termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \ | 100 | (termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \ |
110 | err |= get_user(tmp, &(termio)->c_lflag); \ | 101 | err |= get_user(tmp, &(termio)->c_lflag); \ |
111 | (termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \ | 102 | (termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \ |
112 | err |= copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ | 103 | err |= copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ |
113 | err; \ | 104 | err; \ |
114 | }) | 105 | }) |
115 | 106 | ||
116 | /* | 107 | /* |
117 | * Translate a "termios" structure into a "termio". Ugh. | 108 | * Translate a "termios" structure into a "termio". Ugh. |
118 | * | 109 | * |
119 | * Note the "fun" _VMIN overloading. | 110 | * Note the "fun" _VMIN overloading. |
120 | */ | 111 | */ |
121 | #define kernel_termios_to_user_termio(termio, termios) \ | 112 | #define kernel_termios_to_user_termio(termio, termios) \ |
122 | ({ \ | 113 | ({ \ |
123 | int err; \ | 114 | int err; \ |
124 | err = put_user((termios)->c_iflag, &(termio)->c_iflag); \ | 115 | err = put_user((termios)->c_iflag, &(termio)->c_iflag); \ |
125 | err |= put_user((termios)->c_oflag, &(termio)->c_oflag); \ | 116 | err |= put_user((termios)->c_oflag, &(termio)->c_oflag); \ |
126 | err |= put_user((termios)->c_cflag, &(termio)->c_cflag); \ | 117 | err |= put_user((termios)->c_cflag, &(termio)->c_cflag); \ |
127 | err |= put_user((termios)->c_lflag, &(termio)->c_lflag); \ | 118 | err |= put_user((termios)->c_lflag, &(termio)->c_lflag); \ |
128 | err |= put_user((termios)->c_line, &(termio)->c_line); \ | 119 | err |= put_user((termios)->c_line, &(termio)->c_line); \ |
129 | err |= copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ | 120 | err |= copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ |
130 | if (!((termios)->c_lflag & ICANON)) { \ | 121 | if (!((termios)->c_lflag & ICANON)) { \ |
131 | err |= put_user((termios)->c_cc[VMIN], &(termio)->c_cc[_VMIN]); \ | 122 | err |= put_user((termios)->c_cc[VMIN], &(termio)->c_cc[_VMIN]); \ |
132 | err |= put_user((termios)->c_cc[VTIME], &(termio)->c_cc[_VTIME]); \ | 123 | err |= put_user((termios)->c_cc[VTIME], &(termio)->c_cc[_VTIME]); \ |
133 | } \ | 124 | } \ |
134 | err; \ | 125 | err; \ |
135 | }) | 126 | }) |
136 | 127 | ||
137 | #define user_termios_to_kernel_termios(k, u) \ | 128 | #define user_termios_to_kernel_termios(k, u) \ |
138 | ({ \ | 129 | ({ \ |
139 | int err; \ | 130 | int err; \ |
140 | err = get_user((k)->c_iflag, &(u)->c_iflag); \ | 131 | err = get_user((k)->c_iflag, &(u)->c_iflag); \ |
141 | err |= get_user((k)->c_oflag, &(u)->c_oflag); \ | 132 | err |= get_user((k)->c_oflag, &(u)->c_oflag); \ |
142 | err |= get_user((k)->c_cflag, &(u)->c_cflag); \ | 133 | err |= get_user((k)->c_cflag, &(u)->c_cflag); \ |
143 | err |= get_user((k)->c_lflag, &(u)->c_lflag); \ | 134 | err |= get_user((k)->c_lflag, &(u)->c_lflag); \ |
144 | err |= get_user((k)->c_line, &(u)->c_line); \ | 135 | err |= get_user((k)->c_line, &(u)->c_line); \ |
145 | err |= copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \ | 136 | err |= copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \ |
146 | if((k)->c_lflag & ICANON) { \ | 137 | if((k)->c_lflag & ICANON) { \ |
147 | err |= get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ | 138 | err |= get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ |
148 | err |= get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ | 139 | err |= get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ |
149 | } else { \ | 140 | } else { \ |
150 | err |= get_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ | 141 | err |= get_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ |
151 | err |= get_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ | 142 | err |= get_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ |
152 | } \ | 143 | } \ |
153 | err; \ | 144 | err; \ |
154 | }) | 145 | }) |
155 | 146 | ||
156 | #define kernel_termios_to_user_termios(u, k) \ | 147 | #define kernel_termios_to_user_termios(u, k) \ |
157 | ({ \ | 148 | ({ \ |
158 | int err; \ | 149 | int err; \ |
159 | err = put_user((k)->c_iflag, &(u)->c_iflag); \ | 150 | err = put_user((k)->c_iflag, &(u)->c_iflag); \ |
160 | err |= put_user((k)->c_oflag, &(u)->c_oflag); \ | 151 | err |= put_user((k)->c_oflag, &(u)->c_oflag); \ |
161 | err |= put_user((k)->c_cflag, &(u)->c_cflag); \ | 152 | err |= put_user((k)->c_cflag, &(u)->c_cflag); \ |
162 | err |= put_user((k)->c_lflag, &(u)->c_lflag); \ | 153 | err |= put_user((k)->c_lflag, &(u)->c_lflag); \ |
163 | err |= put_user((k)->c_line, &(u)->c_line); \ | 154 | err |= put_user((k)->c_line, &(u)->c_line); \ |
164 | err |= copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \ | 155 | err |= copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \ |
165 | if(!((k)->c_lflag & ICANON)) { \ | 156 | if(!((k)->c_lflag & ICANON)) { \ |
166 | err |= put_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ | 157 | err |= put_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ |
167 | err |= put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ | 158 | err |= put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ |
168 | } else { \ | 159 | } else { \ |
169 | err |= put_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ | 160 | err |= put_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ |
170 | err |= put_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ | 161 | err |= put_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ |
171 | } \ | 162 | } \ |
172 | err; \ | 163 | err; \ |
173 | }) | 164 | }) |
174 | 165 | ||
175 | #endif /* __KERNEL__ */ | 166 | #endif /* __KERNEL__ */ |
176 | 167 | ||
177 | #endif /* _SPARC64_TERMIOS_H */ | 168 | #endif /* _SPARC64_TERMIOS_H */ |
178 | 169 |