完善Tty的RawMode (#577)

* 完善rowmode,改掉一部分bug

* 增加两个ansi拓展功能功能,以及标记部分函数nerve inline

* 修改do_signal和其他中断上下文锁未关中断,以及拓展tty功能,修改tty几个算法bug

* 修改两个锁

* 修改syscall_64

* update
This commit is contained in:
GnoCiYeH
2024-03-11 15:13:37 +08:00
committed by GitHub
parent 840045af94
commit 52bcb59e92
22 changed files with 561 additions and 290 deletions

View File

@ -599,7 +599,7 @@ int printk_color(unsigned int FRcolor, unsigned int BKcolor, const char *fmt, ..
io_mfence();
va_list args;
va_start(args, fmt);
char buf[4096]; // vsprintf()的缓冲区
static char buf[4096]; // vsprintf()的缓冲区
int len = vsprintf(buf, fmt, args);
va_end(args);

View File

@ -218,6 +218,23 @@ impl<T> RwLock<T> {
return r;
} //当架构为arm时,有些代码需要作出调整compare_exchange=>compare_exchange_weak
#[cfg(any(target_arch = "x86_64", target_arch = "riscv64"))]
#[allow(dead_code)]
#[inline]
pub fn try_write_irqsave(&self) -> Option<RwLockWriteGuard<T>> {
ProcessManager::preempt_disable();
let irq_guard = unsafe { CurrentIrqArch::save_and_disable_irq() };
let r = self.inner_try_write().map(|mut g| {
g.irq_guard = Some(irq_guard);
g
});
if r.is_none() {
ProcessManager::preempt_enable();
}
return r;
}
#[cfg(any(target_arch = "x86_64", target_arch = "riscv64"))]
#[allow(dead_code)]
fn inner_try_write(&self) -> Option<RwLockWriteGuard<T>> {