Line | Count | Source |
1 | // Copyright (c) 2022 Intel Corporation | |
2 | // | |
3 | // SPDX-License-Identifier: BSD-2-Clause-Patent | |
4 | ||
5 | use spin::Mutex; | |
6 | ||
7 | use crate::arch::serial; | |
8 | ||
9 | pub static CONSOLE: Mutex<Console> = Mutex::new(Console {}); | |
10 | ||
11 | pub struct Console; | |
12 | ||
13 | impl core::fmt::Write for Console { | |
14 | 0 | fn write_str(&mut self, s: &str) -> core::fmt::Result { |
15 | 0 | serial::serial_write_string(s); |
16 | 0 | Ok(()) |
17 | 0 | } |
18 | } |