Skip to content

Commit 64e7639

Browse files
committed
修改两个锁
1 parent ba94302 commit 64e7639

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

kernel/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,4 @@ debug = true # Controls whether the compiler passes `-g`
8282

8383
# The release profile, used for `cargo build --release`
8484
[profile.release]
85-
debug = true
85+
debug = false

kernel/src/driver/tty/tty_core.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,17 +343,17 @@ impl TtyCoreData {
343343

344344
#[inline]
345345
pub fn termios(&self) -> RwLockReadGuard<'_, Termios> {
346-
self.termios.read()
346+
self.termios.read_irqsave()
347347
}
348348

349349
#[inline]
350350
pub fn termios_write(&self) -> RwLockWriteGuard<Termios> {
351-
self.termios.write()
351+
self.termios.write_irqsave()
352352
}
353353

354354
#[inline]
355355
pub fn set_termios(&self, termios: Termios) {
356-
let mut termios_guard = self.termios.write();
356+
let mut termios_guard = self.termios.write_irqsave();
357357
*termios_guard = termios;
358358
}
359359

kernel/src/driver/tty/tty_device.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ impl IndexNode for TtyDevice {
211211

212212
// 将数据从buf拷贝到writebuf
213213

214-
let ret = ld.write(tty.clone(), buf, size, mode)?;
214+
let ret = ld.write(tty.clone(), &buf[written..], size, mode)?;
215215

216216
written += ret;
217217
count -= ret;

0 commit comments

Comments
 (0)