mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-22 23:43:24 +00:00
修改CFSqueue从Vec变成红黑树 (#229)
使用了由tickbh编写的rbtree: https://github.com/tickbh/rbtree-rs/blob/master/src/lib.rs Co-authored-by: tickbh <tickdream125@hotmail.com>
This commit is contained in:
@ -6,6 +6,7 @@ use core::{arch::asm, sync::atomic::compiler_fence};
|
||||
#[inline]
|
||||
pub fn current_pcb() -> &'static mut process_control_block {
|
||||
let ret: Option<&mut process_control_block>;
|
||||
|
||||
unsafe {
|
||||
let mut tmp: u64 = !(32767u64);
|
||||
compiler_fence(core::sync::atomic::Ordering::SeqCst);
|
||||
|
@ -14,6 +14,7 @@ struct process_control_block *get_current_pcb()
|
||||
: "=r"(current)
|
||||
: "0"(~32767UL));
|
||||
barrier();
|
||||
|
||||
return current;
|
||||
};
|
||||
#define current_pcb get_current_pcb()
|
||||
|
Reference in New Issue
Block a user