spin::Mutex->UPSafeCell

This commit is contained in:
Yifan Wu 2021-07-20 22:10:22 +08:00
parent c82861f205
commit 3c9b6d7d14
26 changed files with 239 additions and 188 deletions

View file

@ -1,9 +1,8 @@
#![no_std]
#![no_main]
#![feature(global_asm)]
#![feature(llvm_asm)]
#![feature(asm)]
#![feature(panic_info_message)]
#![feature(const_in_array_repeat_expressions)]
#![feature(alloc_error_handler)]
extern crate alloc;
@ -21,6 +20,7 @@ mod loader;
mod config;
mod task;
mod timer;
mod sync;
mod mm;
mod fs;
@ -32,9 +32,12 @@ fn clear_bss() {
fn sbss();
fn ebss();
}
(sbss as usize..ebss as usize).for_each(|a| {
unsafe { (a as *mut u8).write_volatile(0) }
});
unsafe {
core::slice::from_raw_parts_mut(
sbss as usize as *mut u8,
ebss as usize - sbss as usize,
).fill(0);
}
}
#[no_mangle]