mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-30 00:33:24 +00:00
Patch sched rust (#139)
* update * 添加rt调度器的rust初步实现 * 完善rt调度逻辑 * 调试rt调度器 * 修改sched的返回值 * cargo fmt 格式化 * 删除无用代码,修补rt bug * 删除无用的代码,和重复的逻辑 * 软中断bugfix * 删除一些代码 * 添加kthread_run_rt文档 * 解决sphinix警告_static目录不存在的问题 Co-authored-by: longjin <longjin@RinGoTek.cn>
This commit is contained in:
@ -2,7 +2,7 @@ use core::arch::x86_64::_popcnt64;
|
||||
|
||||
/// @brief ffz - 寻找u64中的第一个0所在的位(从第0位开始寻找)
|
||||
/// 请注意,如果x中没有0,那么结果将是未定义的。请确保传入的x至少存在1个0
|
||||
///
|
||||
///
|
||||
/// @param x 目标u64
|
||||
/// @return i32 bit-number(0..63) of the first (least significant) zero bit.
|
||||
#[inline]
|
||||
|
@ -1,6 +1,6 @@
|
||||
pub mod irqflags;
|
||||
#[macro_use]
|
||||
pub mod current;
|
||||
pub mod ptrace;
|
||||
pub mod bitops;
|
||||
pub mod cmpxchg;
|
||||
pub mod cmpxchg;
|
||||
pub mod ptrace;
|
||||
|
@ -3,10 +3,10 @@ use crate::include::bindings::bindings::pt_regs;
|
||||
|
||||
/// @brief 判断给定的栈帧是否来自用户态
|
||||
/// 判断方法为:根据代码段选择子是否具有ring3的访问权限(低2bit均为1)
|
||||
pub fn user_mode(regs: *const pt_regs)->bool{
|
||||
if (unsafe{(*regs).cs} & 0x3) != 0{
|
||||
pub fn user_mode(regs: *const pt_regs) -> bool {
|
||||
if (unsafe { (*regs).cs } & 0x3) != 0 {
|
||||
return true;
|
||||
}else {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user