aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64/termios.h
diff options
context:
space:
mode:
authorDavid Miller <davem@davemloft.net>2007-10-17 22:38:10 -0400
committerDavid S. Miller <davem@davemloft.net>2007-10-17 22:38:10 -0400
commit6050afbbb01d1f5a867f7839be6460bac801f5bc (patch)
tree022be422a8b28f7b630cf20e8b7674b2dfcc9cfc /include/asm-sparc64/termios.h
parent4209ab098c61b1a9684bb4d3fc287352fc2438c3 (diff)
[SPARC]: Support for new termios.
[akpm@linux-foundation.org: coding-style tweaks] Signed-off-by: David Miller <davem@davemloft.net> Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/asm-sparc64/termios.h')
-rw-r--r--include/asm-sparc64/termios.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/include/asm-sparc64/termios.h b/include/asm-sparc64/termios.h
index f05d390993d5..ef527211f8a8 100644
--- a/include/asm-sparc64/termios.h
+++ b/include/asm-sparc64/termios.h
@@ -123,6 +123,8 @@ struct winsize {
123 err |= get_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ 123 err |= get_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \
124 err |= get_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ 124 err |= get_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \
125 } \ 125 } \
126 err |= get_user((k)->c_ispeed, &(u)->c_ispeed); \
127 err |= get_user((k)->c_ospeed, &(u)->c_ospeed); \
126 err; \ 128 err; \
127}) 129})
128 130
@@ -142,6 +144,46 @@ struct winsize {
142 err |= put_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ 144 err |= put_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \
143 err |= put_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ 145 err |= put_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \
144 } \ 146 } \
147 err |= put_user((k)->c_ispeed, &(u)->c_ispeed); \
148 err |= put_user((k)->c_ospeed, &(u)->c_ospeed); \
149 err; \
150})
151
152#define user_termios_to_kernel_termios_1(k, u) \
153({ \
154 int err; \
155 err = get_user((k)->c_iflag, &(u)->c_iflag); \
156 err |= get_user((k)->c_oflag, &(u)->c_oflag); \
157 err |= get_user((k)->c_cflag, &(u)->c_cflag); \
158 err |= get_user((k)->c_lflag, &(u)->c_lflag); \
159 err |= get_user((k)->c_line, &(u)->c_line); \
160 err |= copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \
161 if((k)->c_lflag & ICANON) { \
162 err |= get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \
163 err |= get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \
164 } else { \
165 err |= get_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \
166 err |= get_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \
167 } \
168 err; \
169})
170
171#define kernel_termios_to_user_termios_1(u, k) \
172({ \
173 int err; \
174 err = put_user((k)->c_iflag, &(u)->c_iflag); \
175 err |= put_user((k)->c_oflag, &(u)->c_oflag); \
176 err |= put_user((k)->c_cflag, &(u)->c_cflag); \
177 err |= put_user((k)->c_lflag, &(u)->c_lflag); \
178 err |= put_user((k)->c_line, &(u)->c_line); \
179 err |= copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \
180 if(!((k)->c_lflag & ICANON)) { \
181 err |= put_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \
182 err |= put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \
183 } else { \
184 err |= put_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \
185 err |= put_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \
186 } \
145 err; \ 187 err; \
146}) 188})
147 189