Converting scheme ids into a new type SchemeId

Keeping scheme ids (and pids, and file handles, ...) as usize is a
footgun. Let's remove it.
This commit is contained in:
David Teller 2016-11-04 13:49:44 +01:00
parent 9f7c20bacf
commit d16515ea12
10 changed files with 40 additions and 28 deletions

View file

@ -1,16 +1,16 @@
use alloc::arc::Arc;
use alloc::boxed::Box;
use collections::BTreeMap;
use core::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
use core::sync::atomic::{AtomicUsize, Ordering};
use spin::RwLock;
use context;
use syscall::error::*;
use syscall::scheme::Scheme;
use scheme;
use scheme::{self, AtomicSchemeId, ATOMIC_SCHEMEID_INIT};
use scheme::user::{UserInner, UserScheme};
pub static ROOT_SCHEME_ID: AtomicUsize = ATOMIC_USIZE_INIT;
pub static ROOT_SCHEME_ID: AtomicSchemeId = ATOMIC_SCHEMEID_INIT;
pub struct RootScheme {
next_id: AtomicUsize,