update `process` crate to 2018 edition

master
WangRunji 6 years ago
parent 12457f10cb
commit 4495622317

@ -2,6 +2,7 @@
name = "ucore-process" name = "ucore-process"
version = "0.1.0" version = "0.1.0"
authors = ["WangRunji <wangrunji0408@163.com>"] authors = ["WangRunji <wangrunji0408@163.com>"]
edition = "2018"
[dependencies] [dependencies]
log = "0.4" log = "0.4"

@ -1,4 +1,4 @@
#![no_std] #![cfg_attr(not(test), no_std)]
#![feature(alloc)] #![feature(alloc)]
#![feature(const_fn)] #![feature(const_fn)]
#![feature(linkage)] #![feature(linkage)]
@ -6,16 +6,9 @@
#![feature(vec_resize_default)] #![feature(vec_resize_default)]
#![feature(asm)] #![feature(asm)]
#![feature(exact_size_is_empty)] #![feature(exact_size_is_empty)]
#![feature(extern_crate_item_prelude)]
extern crate alloc; extern crate alloc;
#[macro_use]
extern crate log;
extern crate spin;
// To use `println!` in test
#[cfg(test)]
#[macro_use]
extern crate std;
mod process_manager; mod process_manager;
mod processor; mod processor;
@ -24,5 +17,5 @@ pub mod thread;
mod event_hub; mod event_hub;
mod interrupt; mod interrupt;
pub use process_manager::*; pub use crate::process_manager::*;
pub use processor::Processor; pub use crate::processor::Processor;

@ -1,10 +1,11 @@
use alloc::boxed::Box; use alloc::boxed::Box;
use alloc::sync::Arc; use alloc::sync::Arc;
use alloc::vec::Vec;
use spin::Mutex; use spin::Mutex;
use scheduler::Scheduler; use log::*;
use core::cell::UnsafeCell; use core::cell::UnsafeCell;
use alloc::vec::Vec; use crate::scheduler::Scheduler;
use event_hub::EventHub; use crate::event_hub::EventHub;
struct Process { struct Process {
id: Pid, id: Pid,

@ -1,9 +1,10 @@
use alloc::boxed::Box; use alloc::boxed::Box;
use alloc::sync::Arc; use alloc::sync::Arc;
use spin::Mutex; use spin::Mutex;
use log::*;
use core::cell::UnsafeCell; use core::cell::UnsafeCell;
use process_manager::*; use crate::process_manager::*;
use interrupt; use crate::interrupt;
/// Process executor /// Process executor
/// ///

@ -1,4 +1,5 @@
use alloc::{collections::BinaryHeap, vec::Vec}; use alloc::{collections::BinaryHeap, vec::Vec};
use log::*;
type Pid = usize; type Pid = usize;

@ -11,9 +11,10 @@ use alloc::collections::BTreeMap;
use core::marker::PhantomData; use core::marker::PhantomData;
use core::ptr; use core::ptr;
use core::time::Duration; use core::time::Duration;
use processor::*; use log::*;
use process_manager::*; use crate::processor::*;
use scheduler::Scheduler; use crate::process_manager::*;
use crate::scheduler::Scheduler;
#[linkage = "weak"] #[linkage = "weak"]
#[no_mangle] #[no_mangle]

Loading…
Cancel
Save