mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-20 10:06:31 +00:00
完成中断管理模块重构 (#554)
- 支持中断共享 - 把现有驱动程序移植到新的irq模块 - 使用`ProcessorId`标识处理器id - 尚未实现threaded_irq 性能上,edge irq flow handler里面,对于锁的使用,可能有点问题。为了获取/修改common data还有其他几个结构体的状态,进行了多次加锁和放锁,导致性能降低。这是接下来需要优化的点。
This commit is contained in:
@ -8,6 +8,22 @@ use crate::{
|
||||
process::{Pid, ProcessManager},
|
||||
};
|
||||
|
||||
use super::{ProcessFlags, __PROCESS_MANAGEMENT_INIT_DONE};
|
||||
|
||||
pub fn current_pcb_flags() -> ProcessFlags {
|
||||
if unsafe { !__PROCESS_MANAGEMENT_INIT_DONE } {
|
||||
return ProcessFlags::empty();
|
||||
}
|
||||
return ProcessManager::current_pcb().flags().clone();
|
||||
}
|
||||
|
||||
pub fn current_pcb_preempt_count() -> usize {
|
||||
if unsafe { !__PROCESS_MANAGEMENT_INIT_DONE } {
|
||||
return 0;
|
||||
}
|
||||
return ProcessManager::current_pcb().preempt_count();
|
||||
}
|
||||
|
||||
/// @brief 初始化pid=1的进程的stdio
|
||||
pub fn stdio_init() -> Result<(), SystemError> {
|
||||
if ProcessManager::current_pcb().pid() != Pid(1) {
|
||||
|
Reference in New Issue
Block a user