1
0
mirror of https://github.com/sgmarz/osblog.git synced 2024-11-23 18:06:20 +04:00

Add descriptor elements and add yield

This commit is contained in:
Stephen Marz 2020-06-04 18:06:42 -04:00
parent 69ef3475dd
commit 2163f68177

View File

@ -12,7 +12,7 @@ use crate::{cpu::{get_mtime,
unmap,
zalloc,
Table},
syscall::syscall_exit};
syscall::{syscall_exit, syscall_yield}};
use alloc::{string::String, collections::{vec_deque::VecDeque, BTreeMap}};
use core::ptr::null_mut;
use crate::lock::Mutex;
@ -169,7 +169,7 @@ fn init_process() {
// scheduler will loop until it finds a process to run. Since
// the scheduler is called in an interrupt context, nothing else
// can happen until a process becomes available.
unsafe { llvm_asm!("wfi") };
syscall_yield();
}
}
@ -416,6 +416,9 @@ impl Drop for Process {
pub enum FileDescriptor {
File(Inode),
Device(usize),
Framebuffer(usize),
ButtonEvents,
AbsoluteEvents,
Network,
Unknown,
}