This source file includes following definitions.
- trans_from_termio
- trans_to_termio
1 #ifndef _ALPHA_TERMIOS_H
2 #define _ALPHA_TERMIOS_H
3
4 #include <asm/ioctls.h>
5 #include <asm/termbits.h>
6
7 struct sgttyb {
8 char sg_ispeed;
9 char sg_ospeed;
10 char sg_erase;
11 char sg_kill;
12 short sg_flags;
13 };
14
15 struct tchars {
16 char t_intrc;
17 char t_quitc;
18 char t_startc;
19 char t_stopc;
20 char t_eofc;
21 char t_brkc;
22 };
23
24 struct ltchars {
25 char t_suspc;
26 char t_dsuspc;
27 char t_rprntc;
28 char t_flushc;
29 char t_werasc;
30 char t_lnextc;
31 };
32
33 struct winsize {
34 unsigned short ws_row;
35 unsigned short ws_col;
36 unsigned short ws_xpixel;
37 unsigned short ws_ypixel;
38 };
39
40 #define NCC 8
41 struct termio {
42 unsigned short c_iflag;
43 unsigned short c_oflag;
44 unsigned short c_cflag;
45 unsigned short c_lflag;
46 unsigned char c_line;
47 unsigned char c_cc[NCC];
48 };
49
50
51
52
53
54
55
56
57
58 #define _VINTR 0
59 #define _VQUIT 1
60 #define _VERASE 2
61 #define _VKILL 3
62 #define _VEOF 4
63 #define _VMIN 4
64 #define _VEOL 5
65 #define _VTIME 5
66 #define _VEOL2 6
67 #define _VSWTC 7
68
69
70 #define N_TTY 0
71 #define N_SLIP 1
72 #define N_MOUSE 2
73 #define N_PPP 3
74
75 #ifdef __KERNEL__
76
77
78
79
80
81
82 #define INIT_C_CC "\004\000\000\177\027\025\022\000\003\034\032\000\021\023\026\025\001\000"
83
84
85
86
87 extern inline void trans_from_termio(struct termio * termio,
88 struct termios * termios)
89 {
90 #define SET_LOW_BITS(x,y) ((x) = (0xffff0000 & (x)) | (y))
91 SET_LOW_BITS(termios->c_iflag, termio->c_iflag);
92 SET_LOW_BITS(termios->c_oflag, termio->c_oflag);
93 SET_LOW_BITS(termios->c_cflag, termio->c_cflag);
94 SET_LOW_BITS(termios->c_lflag, termio->c_lflag);
95 #undef SET_LOW_BITS
96 termios->c_cc[VINTR] = termio->c_cc[_VINTR];
97 termios->c_cc[VQUIT] = termio->c_cc[_VQUIT];
98 termios->c_cc[VERASE]= termio->c_cc[_VERASE];
99 termios->c_cc[VKILL] = termio->c_cc[_VKILL];
100 termios->c_cc[VEOF] = termio->c_cc[_VEOF];
101 termios->c_cc[VMIN] = termio->c_cc[_VMIN];
102 termios->c_cc[VEOL] = termio->c_cc[_VEOL];
103 termios->c_cc[VTIME] = termio->c_cc[_VTIME];
104 termios->c_cc[VEOL2] = termio->c_cc[_VEOL2];
105 termios->c_cc[VSWTC] = termio->c_cc[_VSWTC];
106 }
107
108
109
110
111
112
113 extern inline void trans_to_termio(struct termios * termios,
114 struct termio * termio)
115 {
116 termio->c_iflag = termios->c_iflag;
117 termio->c_oflag = termios->c_oflag;
118 termio->c_cflag = termios->c_cflag;
119 termio->c_lflag = termios->c_lflag;
120 termio->c_line = termios->c_line;
121 termio->c_cc[_VINTR] = termios->c_cc[VINTR];
122 termio->c_cc[_VQUIT] = termios->c_cc[VQUIT];
123 termio->c_cc[_VERASE]= termios->c_cc[VERASE];
124 termio->c_cc[_VKILL] = termios->c_cc[VKILL];
125 termio->c_cc[_VEOF] = termios->c_cc[VEOF];
126 termio->c_cc[_VEOL] = termios->c_cc[VEOL];
127 termio->c_cc[_VEOL2] = termios->c_cc[VEOL2];
128 termio->c_cc[_VSWTC] = termios->c_cc[VSWTC];
129 if (!(termios->c_lflag & ICANON)) {
130 termio->c_cc[_VMIN] = termios->c_cc[VMIN];
131 termio->c_cc[_VTIME] = termios->c_cc[VTIME];
132 }
133 }
134
135 #endif
136
137 #endif