diff options
Diffstat (limited to 'include/asm-s390/termios.h')
-rw-r--r-- | include/asm-s390/termios.h | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/include/asm-s390/termios.h b/include/asm-s390/termios.h index d1e29cca54c9..62b23caf370e 100644 --- a/include/asm-s390/termios.h +++ b/include/asm-s390/termios.h | |||
@@ -75,39 +75,7 @@ struct termio { | |||
75 | */ | 75 | */ |
76 | #define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" | 76 | #define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" |
77 | 77 | ||
78 | /* | 78 | #include <asm-generic/termios.h> |
79 | * Translate a "termio" structure into a "termios". Ugh. | ||
80 | */ | ||
81 | #define SET_LOW_TERMIOS_BITS(termios, termio, x) { \ | ||
82 | unsigned short __tmp; \ | ||
83 | get_user(__tmp,&(termio)->x); \ | ||
84 | (termios)->x = (0xffff0000 & ((termios)->x)) | __tmp; \ | ||
85 | } | ||
86 | |||
87 | #define user_termio_to_kernel_termios(termios, termio) \ | ||
88 | ({ \ | ||
89 | SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \ | ||
90 | SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \ | ||
91 | SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \ | ||
92 | SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \ | ||
93 | copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ | ||
94 | }) | ||
95 | |||
96 | /* | ||
97 | * Translate a "termios" structure into a "termio". Ugh. | ||
98 | */ | ||
99 | #define kernel_termios_to_user_termio(termio, termios) \ | ||
100 | ({ \ | ||
101 | put_user((termios)->c_iflag, &(termio)->c_iflag); \ | ||
102 | put_user((termios)->c_oflag, &(termio)->c_oflag); \ | ||
103 | put_user((termios)->c_cflag, &(termio)->c_cflag); \ | ||
104 | put_user((termios)->c_lflag, &(termio)->c_lflag); \ | ||
105 | put_user((termios)->c_line, &(termio)->c_line); \ | ||
106 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ | ||
107 | }) | ||
108 | |||
109 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) | ||
110 | #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) | ||
111 | 79 | ||
112 | #endif /* __KERNEL__ */ | 80 | #endif /* __KERNEL__ */ |
113 | 81 | ||