|
@@ -4,6 +4,7 @@ use alloc::{string::String, sync::Arc, vec::Vec};
|
|
use system_error::SystemError;
|
|
use system_error::SystemError;
|
|
|
|
|
|
use crate::{
|
|
use crate::{
|
|
|
|
+ driver::serial::serial8250::send_to_default_serial8250_port,
|
|
libs::{
|
|
libs::{
|
|
rwlock::{RwLock, RwLockReadGuard, RwLockUpgradableGuard, RwLockWriteGuard},
|
|
rwlock::{RwLock, RwLockReadGuard, RwLockUpgradableGuard, RwLockWriteGuard},
|
|
spinlock::{SpinLock, SpinLockGuard},
|
|
spinlock::{SpinLock, SpinLockGuard},
|
|
@@ -72,6 +73,13 @@ impl TtyCore {
|
|
self.line_discipline.clone()
|
|
self.line_discipline.clone()
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ pub fn write_without_serial(&self, buf: &[u8], nr: usize) -> Result<usize, SystemError> {
|
|
|
|
+ self.core
|
|
|
|
+ .driver()
|
|
|
|
+ .driver_funcs()
|
|
|
|
+ .write(self.core(), buf, nr)
|
|
|
|
+ }
|
|
|
|
+
|
|
pub fn reopen(&self) -> Result<(), SystemError> {
|
|
pub fn reopen(&self) -> Result<(), SystemError> {
|
|
let tty_core = self.core();
|
|
let tty_core = self.core();
|
|
let driver = tty_core.driver();
|
|
let driver = tty_core.driver();
|
|
@@ -404,6 +412,7 @@ impl TtyOperation for TtyCore {
|
|
|
|
|
|
#[inline]
|
|
#[inline]
|
|
fn write(&self, tty: &TtyCoreData, buf: &[u8], nr: usize) -> Result<usize, SystemError> {
|
|
fn write(&self, tty: &TtyCoreData, buf: &[u8], nr: usize) -> Result<usize, SystemError> {
|
|
|
|
+ send_to_default_serial8250_port(buf);
|
|
return self.core().tty_driver.driver_funcs().write(tty, buf, nr);
|
|
return self.core().tty_driver.driver_funcs().write(tty, buf, nr);
|
|
}
|
|
}
|
|
|
|
|