From e83717b454722b8c61844686377c2ac58f18454f Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Tue, 23 Aug 2022 20:56:57 -0700 Subject: Migrate the processor-independent code Due to the similarity with my ARM-based OS ghOSt, I am migrating similar code out to a common crate Not all has been moved out yet --- src/serial/buffer.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/serial/buffer.rs') diff --git a/src/serial/buffer.rs b/src/serial/buffer.rs index b0f704e..b52728a 100644 --- a/src/serial/buffer.rs +++ b/src/serial/buffer.rs @@ -12,13 +12,11 @@ impl Serial { } } -impl NullLock { - pub fn init(&self) { - self.lock(|serial| { - let mut serial_port = unsafe { SerialPort::new(0x3F8) }; - serial_port.init(); - serial.buffer = Some(serial_port); - }); +impl crate::sync::interface::Initializable for Serial { + fn init(&mut self) { + let mut serial_port = unsafe { SerialPort::new(0x3F8) }; + serial_port.init(); + self.buffer = Some(serial_port); } } -- cgit v1.2.1