mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-21 22:43:23 +00:00
完善Tty的RawMode (#577)
* 完善rowmode,改掉一部分bug * 增加两个ansi拓展功能功能,以及标记部分函数nerve inline * 修改do_signal和其他中断上下文锁未关中断,以及拓展tty功能,修改tty几个算法bug * 修改两个锁 * 修改syscall_64 * update
This commit is contained in:
@ -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);
|
||||
|
@ -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>> {
|
||||
|
Reference in New Issue
Block a user