Implement sched_yield, enable interrupts in userspace
This commit is contained in:
parent
bd7bca30fa
commit
842826c1b0
1 changed files with 21 additions and 6 deletions
|
|
@ -28,3 +28,8 @@ pub fn getpid() -> Result<usize> {
|
|||
let context = context_lock.read();
|
||||
Ok(context.id)
|
||||
}
|
||||
|
||||
pub fn sched_yield() -> Result<usize> {
|
||||
unsafe { context::switch(); }
|
||||
Ok(0)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue