Go to the documentation of this file. 1 #ifndef _ALPHA_TERMIOS_H
2 #define _ALPHA_TERMIOS_H
4 #include <asm/ioctls.h>
5 #include <asm/termbits.h>
76 #define INIT_C_CC "\004\000\000\177\027\025\022\000\003\034\032\000\021\023\026\025\001\000"
82 #define user_termio_to_kernel_termios(a_termios, u_termio) \
84 struct ktermios *k_termios = (a_termios); \
85 struct termio k_termio; \
88 ret = copy_from_user(&k_termio, u_termio, sizeof(k_termio)); \
91 *(unsigned short *)&k_termios->c_iflag = k_termio.c_iflag; \
92 *(unsigned short *)&k_termios->c_oflag = k_termio.c_oflag; \
93 *(unsigned short *)&k_termios->c_cflag = k_termio.c_cflag; \
94 *(unsigned short *)&k_termios->c_lflag = k_termio.c_lflag; \
95 canon = k_termio.c_lflag & ICANON; \
97 k_termios->c_cc[VINTR] = k_termio.c_cc[_VINTR]; \
98 k_termios->c_cc[VQUIT] = k_termio.c_cc[_VQUIT]; \
99 k_termios->c_cc[VERASE] = k_termio.c_cc[_VERASE]; \
100 k_termios->c_cc[VKILL] = k_termio.c_cc[_VKILL]; \
101 k_termios->c_cc[VEOL2] = k_termio.c_cc[_VEOL2]; \
102 k_termios->c_cc[VSWTC] = k_termio.c_cc[_VSWTC]; \
103 k_termios->c_cc[canon ? VEOF : VMIN] = k_termio.c_cc[_VEOF]; \
104 k_termios->c_cc[canon ? VEOL : VTIME] = k_termio.c_cc[_VEOL]; \
114 #define kernel_termios_to_user_termio(u_termio, a_termios) \
116 struct ktermios *k_termios = (a_termios); \
117 struct termio k_termio; \
120 k_termio.c_iflag = k_termios->c_iflag; \
121 k_termio.c_oflag = k_termios->c_oflag; \
122 k_termio.c_cflag = k_termios->c_cflag; \
123 canon = (k_termio.c_lflag = k_termios->c_lflag) & ICANON; \
125 k_termio.c_line = k_termios->c_line; \
126 k_termio.c_cc[_VINTR] = k_termios->c_cc[VINTR]; \
127 k_termio.c_cc[_VQUIT] = k_termios->c_cc[VQUIT]; \
128 k_termio.c_cc[_VERASE] = k_termios->c_cc[VERASE]; \
129 k_termio.c_cc[_VKILL] = k_termios->c_cc[VKILL]; \
130 k_termio.c_cc[_VEOF] = k_termios->c_cc[canon ? VEOF : VMIN]; \
131 k_termio.c_cc[_VEOL] = k_termios->c_cc[canon ? VEOL : VTIME]; \
132 k_termio.c_cc[_VEOL2] = k_termios->c_cc[VEOL2]; \
133 k_termio.c_cc[_VSWTC] = k_termios->c_cc[VSWTC]; \
135 copy_to_user(u_termio, &k_termio, sizeof(k_termio)); \
138 #define user_termios_to_kernel_termios(k, u) \
139 copy_from_user(k, u, sizeof(struct termios))
141 #define kernel_termios_to_user_termios(u, k) \
142 copy_to_user(u, k, sizeof(struct termios))