Move frame allocation to two global functions, locking happens inside them
This commit is contained in:
parent
ebf9766ef5
commit
78432b3875
11 changed files with 97 additions and 140 deletions
|
@ -15,14 +15,17 @@ extern crate bitflags;
|
|||
extern crate spin;
|
||||
extern crate x86;
|
||||
|
||||
use spin::Mutex;
|
||||
|
||||
/// Print to console
|
||||
#[macro_export]
|
||||
macro_rules! print {
|
||||
($($arg:tt)*) => ({
|
||||
use core::fmt::Write;
|
||||
let _ = write!($crate::serial::SerialConsole::new(), $($arg)*);
|
||||
{
|
||||
use core::fmt::Write;
|
||||
//TODO: let mut serial_console = $crate::serial::SERIAL_CONSOLE.lock();
|
||||
let mut serial_console = $crate::serial::SerialConsole::new();
|
||||
let _ = write!(serial_console, $($arg)*);
|
||||
drop(serial_console);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -153,5 +156,3 @@ pub mod start;
|
|||
|
||||
/// Task state segment
|
||||
pub mod tss;
|
||||
|
||||
pub static ALLOCATOR: Mutex<Option<memory::AreaFrameAllocator>> = Mutex::new(None);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue