diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2005-10-31 22:26:41 -0500 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2005-10-31 22:36:55 -0500 |
commit | 3c4cf5ee5a9224a800a74b5dfcb435550ed30737 (patch) | |
tree | 14ad9a7d6f9807352187de7947cd8f803ac696a9 | |
parent | 870c6ff2ac0cb708697c2c06f3e5eddf9e3b38cb (diff) |
powerpc: use asm-generic/termios.h
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
-rw-r--r-- | include/asm-powerpc/termios.h | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/include/asm-powerpc/termios.h b/include/asm-powerpc/termios.h index 27a012cfcb4e..7f80a019b6a0 100644 --- a/include/asm-powerpc/termios.h +++ b/include/asm-powerpc/termios.h | |||
@@ -96,39 +96,7 @@ struct termio { | |||
96 | 96 | ||
97 | #ifdef __KERNEL__ | 97 | #ifdef __KERNEL__ |
98 | 98 | ||
99 | /* | 99 | #include <asm-generic/termios.h> |
100 | * Translate a "termio" structure into a "termios". Ugh. | ||
101 | */ | ||
102 | #define SET_LOW_TERMIOS_BITS(termios, termio, x) { \ | ||
103 | unsigned short __tmp; \ | ||
104 | get_user(__tmp,&(termio)->x); \ | ||
105 | (termios)->x = (0xffff0000 & (termios)->x) | __tmp; \ | ||
106 | } | ||
107 | |||
108 | #define user_termio_to_kernel_termios(termios, termio) \ | ||
109 | ({ \ | ||
110 | SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \ | ||
111 | SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \ | ||
112 | SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \ | ||
113 | SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \ | ||
114 | copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ | ||
115 | }) | ||
116 | |||
117 | /* | ||
118 | * Translate a "termios" structure into a "termio". Ugh. | ||
119 | */ | ||
120 | #define kernel_termios_to_user_termio(termio, termios) \ | ||
121 | ({ \ | ||
122 | put_user((termios)->c_iflag, &(termio)->c_iflag); \ | ||
123 | put_user((termios)->c_oflag, &(termio)->c_oflag); \ | ||
124 | put_user((termios)->c_cflag, &(termio)->c_cflag); \ | ||
125 | put_user((termios)->c_lflag, &(termio)->c_lflag); \ | ||
126 | put_user((termios)->c_line, &(termio)->c_line); \ | ||
127 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ | ||
128 | }) | ||
129 | |||
130 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) | ||
131 | #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) | ||
132 | 100 | ||
133 | #endif /* __KERNEL__ */ | 101 | #endif /* __KERNEL__ */ |
134 | 102 | ||