aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sparc/termios.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-18 17:39:44 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-18 17:39:44 -0400
commit9cf52b2921fbe62566b6b2ee79f71203749c9e5e (patch)
tree5705ab0af0adfb7043407b5a4ffbf43fcbff42bd /include/asm-sparc/termios.h
parent952184304fbf030f0133d8b66a91b2847dce729e (diff)
parent5c45708352a040f19caceb683c78bc86aad466f6 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6: [SPARC/64]: Consolidate of_register_driver [SPARC] Videopix Frame Grabber: Convert device_lock_sem to mutex [SPARC]: Support for new termios. [SPARC64]: Check of_get_property() return in pci_determine_mem_io_space(). [SPARC64]: Fix boot failures due to bootmem. [SPARC64]: Implement atomic backoff.
Diffstat (limited to 'include/asm-sparc/termios.h')
-rw-r--r--include/asm-sparc/termios.h48
1 files changed, 45 insertions, 3 deletions
diff --git a/include/asm-sparc/termios.h b/include/asm-sparc/termios.h
index d767f206ab33..4333232abb9f 100644
--- a/include/asm-sparc/termios.h
+++ b/include/asm-sparc/termios.h
@@ -108,13 +108,55 @@ struct winsize {
108 108
109#define user_termios_to_kernel_termios(k, u) \ 109#define user_termios_to_kernel_termios(k, u) \
110({ \ 110({ \
111 int err; \
112 err = get_user((k)->c_iflag, &(u)->c_iflag); \
113 err |= get_user((k)->c_oflag, &(u)->c_oflag); \
114 err |= get_user((k)->c_cflag, &(u)->c_cflag); \
115 err |= get_user((k)->c_lflag, &(u)->c_lflag); \
116 err |= get_user((k)->c_line, &(u)->c_line); \
117 err |= copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \
118 if ((k)->c_lflag & ICANON) { \
119 err |= get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \
120 err |= get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \
121 } else { \
122 err |= get_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \
123 err |= get_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \
124 } \
125 err |= get_user((k)->c_ispeed, &(u)->c_ispeed); \
126 err |= get_user((k)->c_ospeed, &(u)->c_ospeed); \
127 err; \
128})
129
130#define kernel_termios_to_user_termios(u, k) \
131({ \
132 int err; \
133 err = put_user((k)->c_iflag, &(u)->c_iflag); \
134 err |= put_user((k)->c_oflag, &(u)->c_oflag); \
135 err |= put_user((k)->c_cflag, &(u)->c_cflag); \
136 err |= put_user((k)->c_lflag, &(u)->c_lflag); \
137 err |= put_user((k)->c_line, &(u)->c_line); \
138 err |= copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \
139 if (!((k)->c_lflag & ICANON)) { \
140 err |= put_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \
141 err |= put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \
142 } else { \
143 err |= put_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \
144 err |= put_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \
145 } \
146 err |= put_user((k)->c_ispeed, &(u)->c_ispeed); \
147 err |= put_user((k)->c_ospeed, &(u)->c_ospeed); \
148 err; \
149})
150
151#define user_termios_to_kernel_termios_1(k, u) \
152({ \
111 get_user((k)->c_iflag, &(u)->c_iflag); \ 153 get_user((k)->c_iflag, &(u)->c_iflag); \
112 get_user((k)->c_oflag, &(u)->c_oflag); \ 154 get_user((k)->c_oflag, &(u)->c_oflag); \
113 get_user((k)->c_cflag, &(u)->c_cflag); \ 155 get_user((k)->c_cflag, &(u)->c_cflag); \
114 get_user((k)->c_lflag, &(u)->c_lflag); \ 156 get_user((k)->c_lflag, &(u)->c_lflag); \
115 get_user((k)->c_line, &(u)->c_line); \ 157 get_user((k)->c_line, &(u)->c_line); \
116 copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \ 158 copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \
117 if((k)->c_lflag & ICANON) { \ 159 if ((k)->c_lflag & ICANON) { \
118 get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ 160 get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \
119 get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ 161 get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \
120 } else { \ 162 } else { \
@@ -124,7 +166,7 @@ struct winsize {
124 0; \ 166 0; \
125}) 167})
126 168
127#define kernel_termios_to_user_termios(u, k) \ 169#define kernel_termios_to_user_termios_1(u, k) \
128({ \ 170({ \
129 put_user((k)->c_iflag, &(u)->c_iflag); \ 171 put_user((k)->c_iflag, &(u)->c_iflag); \
130 put_user((k)->c_oflag, &(u)->c_oflag); \ 172 put_user((k)->c_oflag, &(u)->c_oflag); \
@@ -132,7 +174,7 @@ struct winsize {
132 put_user((k)->c_lflag, &(u)->c_lflag); \ 174 put_user((k)->c_lflag, &(u)->c_lflag); \
133 put_user((k)->c_line, &(u)->c_line); \ 175 put_user((k)->c_line, &(u)->c_line); \
134 copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \ 176 copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \
135 if(!((k)->c_lflag & ICANON)) { \ 177 if (!((k)->c_lflag & ICANON)) { \
136 put_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ 178 put_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \
137 put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ 179 put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \
138 } else { \ 180 } else { \