Move frame allocation to two global functions, locking happens inside them
This commit is contained in:
parent
ebf9766ef5
commit
78432b3875
1 changed files with 97 additions and 140 deletions
|
|
@ -1,13 +1,17 @@
|
|||
use core::fmt;
|
||||
use spin::Mutex;
|
||||
|
||||
use super::io::{Io, Pio};
|
||||
|
||||
pub static SERIAL_CONSOLE: Mutex<SerialConsole> = Mutex::new(SerialConsole::new());
|
||||
|
||||
pub struct SerialConsole {
|
||||
status: Pio<u8>,
|
||||
data: Pio<u8>
|
||||
}
|
||||
|
||||
impl SerialConsole {
|
||||
pub fn new() -> SerialConsole {
|
||||
pub const fn new() -> SerialConsole {
|
||||
SerialConsole {
|
||||
status: Pio::new(0x3F8 + 5),
|
||||
data: Pio::new(0x3F8)
|
||||
|
|
|
|||
Loading…
Reference in a new issue