Skip to content

Commit 685e88a

Browse files
committed
fix termios type
1 parent 7c59771 commit 685e88a

1 file changed

Lines changed: 25 additions & 22 deletions

File tree

tee/kernel/src/user/syscall/args.rs

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,7 +1977,7 @@ pub struct Termios {
19771977
impl Default for Termios {
19781978
fn default() -> Self {
19791979
Self {
1980-
input_modes: InputMode::CRNL | InputMode::UTF8,
1980+
input_modes: InputMode::CRNL | InputMode::XON,
19811981
output_modes: OutputMode::POST | OutputMode::NLCR,
19821982
control_modes: ControlMode::B38400 | ControlMode::S8 | ControlMode::READ,
19831983
local_modes: LocalMode::ISIG
@@ -1989,6 +1989,7 @@ impl Default for Termios {
19891989
| LocalMode::ECHOKE
19901990
| LocalMode::IEXTEN,
19911991
special_characters: SpecialCharacters {
1992+
line: 0x00,
19921993
intr: 0x03,
19931994
quit: 0x1c,
19941995
erase: 0x7f,
@@ -2006,7 +2007,7 @@ impl Default for Termios {
20062007
werase: 0x17,
20072008
lnext: 0x16,
20082009
eol2: 0x00,
2009-
padding: [0x00, 0x00, 0x00],
2010+
padding: [0x00, 0x00],
20102011
},
20112012
}
20122013
}
@@ -2147,6 +2148,7 @@ bitflags::bitflags! {
21472148

21482149
#[derive(Debug, Clone, Copy)]
21492150
pub struct SpecialCharacters {
2151+
pub line: u8,
21502152
pub intr: u8,
21512153
pub quit: u8,
21522154
pub erase: u8,
@@ -2164,12 +2166,13 @@ pub struct SpecialCharacters {
21642166
pub werase: u8,
21652167
pub lnext: u8,
21662168
pub eol2: u8,
2167-
padding: [u8; 3],
2169+
padding: [u8; 2],
21682170
}
21692171

21702172
impl From<SpecialCharacters> for [u8; 20] {
21712173
fn from(value: SpecialCharacters) -> Self {
21722174
[
2175+
value.line,
21732176
value.intr,
21742177
value.quit,
21752178
value.erase,
@@ -2189,32 +2192,32 @@ impl From<SpecialCharacters> for [u8; 20] {
21892192
value.eol2,
21902193
value.padding[0],
21912194
value.padding[1],
2192-
value.padding[2],
21932195
]
21942196
}
21952197
}
21962198

21972199
impl From<[u8; 20]> for SpecialCharacters {
21982200
fn from(value: [u8; 20]) -> Self {
21992201
Self {
2200-
intr: value[0],
2201-
quit: value[1],
2202-
erase: value[2],
2203-
kill: value[3],
2204-
eof: value[4],
2205-
time: value[5],
2206-
min: value[6],
2207-
swtc: value[7],
2208-
start: value[8],
2209-
stop: value[9],
2210-
susp: value[10],
2211-
eol: value[11],
2212-
reprint: value[12],
2213-
discard: value[13],
2214-
werase: value[14],
2215-
lnext: value[15],
2216-
eol2: value[16],
2217-
padding: [value[17], value[18], value[19]],
2202+
line: value[0],
2203+
intr: value[1],
2204+
quit: value[2],
2205+
erase: value[3],
2206+
kill: value[4],
2207+
eof: value[5],
2208+
time: value[6],
2209+
min: value[7],
2210+
swtc: value[8],
2211+
start: value[9],
2212+
stop: value[10],
2213+
susp: value[11],
2214+
eol: value[12],
2215+
reprint: value[13],
2216+
discard: value[14],
2217+
werase: value[15],
2218+
lnext: value[16],
2219+
eol2: value[17],
2220+
padding: [value[18], value[19]],
22182221
}
22192222
}
22202223
}

0 commit comments

Comments
 (0)