This commit is contained in:
Jeremy Soller 2016-09-23 11:01:53 -06:00
parent 5b3aeb4a9f
commit 94ef9dd14a
7 changed files with 151 additions and 39 deletions

View file

@ -1,6 +1,6 @@
use alloc::arc::Arc;
use alloc::boxed::Box;
use collections::Vec;
use collections::{BTreeMap, Vec};
use spin::Mutex;
use arch;
@ -39,6 +39,8 @@ pub struct Context {
pub grants: Arc<Mutex<Vec<Grant>>>,
/// The current working directory
pub cwd: Arc<Mutex<Vec<u8>>>,
/// The process environment
pub env: Arc<Mutex<BTreeMap<Box<[u8]>, Arc<Mutex<Vec<u8>>>>>>,
/// The open files in the scheme
pub files: Arc<Mutex<Vec<Option<File>>>>
}
@ -58,6 +60,7 @@ impl Context {
stack: None,
grants: Arc::new(Mutex::new(Vec::new())),
cwd: Arc::new(Mutex::new(Vec::new())),
env: Arc::new(Mutex::new(BTreeMap::new())),
files: Arc::new(Mutex::new(Vec::new()))
}
}