From 2163f68177213582f5b4cbcd66387ca8c2451c56 Mon Sep 17 00:00:00 2001 From: Stephen Marz Date: Thu, 4 Jun 2020 18:06:42 -0400 Subject: [PATCH] Add descriptor elements and add yield --- risc_v/src/process.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/risc_v/src/process.rs b/risc_v/src/process.rs index 5526a66..5a8a488 100644 --- a/risc_v/src/process.rs +++ b/risc_v/src/process.rs @@ -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, }