Implement sched_yield, enable interrupts in userspace
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user