mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Run rustfmt
This commit is contained in:
@@ -7,9 +7,9 @@
|
||||
#[macro_use]
|
||||
extern crate blog_os;
|
||||
|
||||
use blog_os::exit_qemu;
|
||||
#[cfg(not(test))]
|
||||
use core::panic::PanicInfo;
|
||||
use blog_os::exit_qemu;
|
||||
|
||||
/// This function is the entry point, since the linker looks for a function
|
||||
/// named `_start_` by default.
|
||||
@@ -18,11 +18,12 @@ use blog_os::exit_qemu;
|
||||
pub extern "C" fn _start() -> ! {
|
||||
serial_println!("ok");
|
||||
|
||||
unsafe { exit_qemu(); }
|
||||
unsafe {
|
||||
exit_qemu();
|
||||
}
|
||||
loop {}
|
||||
}
|
||||
|
||||
|
||||
/// This function is called on panic.
|
||||
#[cfg(not(test))]
|
||||
#[panic_implementation]
|
||||
@@ -32,6 +33,8 @@ pub fn panic(info: &PanicInfo) -> ! {
|
||||
|
||||
serial_println!("{}", info);
|
||||
|
||||
unsafe { exit_qemu(); }
|
||||
unsafe {
|
||||
exit_qemu();
|
||||
}
|
||||
loop {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
#[macro_use]
|
||||
extern crate blog_os;
|
||||
|
||||
use blog_os::exit_qemu;
|
||||
#[cfg(not(test))]
|
||||
use core::panic::PanicInfo;
|
||||
use blog_os::exit_qemu;
|
||||
|
||||
#[cfg(not(test))]
|
||||
#[no_mangle]
|
||||
@@ -22,6 +22,8 @@ pub extern "C" fn _start() -> ! {
|
||||
pub fn panic(_info: &PanicInfo) -> ! {
|
||||
serial_println!("ok");
|
||||
|
||||
unsafe { exit_qemu(); }
|
||||
unsafe {
|
||||
exit_qemu();
|
||||
}
|
||||
loop {}
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@ extern crate array_init;
|
||||
#[cfg(test)]
|
||||
extern crate std;
|
||||
|
||||
pub mod vga_buffer;
|
||||
pub mod serial;
|
||||
pub mod vga_buffer;
|
||||
|
||||
pub unsafe fn exit_qemu() {
|
||||
use x86_64::instructions::port::Port;
|
||||
|
||||
@@ -26,4 +26,4 @@ pub extern "C" fn _start() -> ! {
|
||||
pub fn panic(info: &PanicInfo) -> ! {
|
||||
println!("{}", info);
|
||||
loop {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use uart_16550::SerialPort;
|
||||
use spin::Mutex;
|
||||
use uart_16550::SerialPort;
|
||||
|
||||
lazy_static! {
|
||||
pub static ref SERIAL1: Mutex<SerialPort> = {
|
||||
@@ -11,7 +11,10 @@ lazy_static! {
|
||||
|
||||
pub fn print(args: ::core::fmt::Arguments) {
|
||||
use core::fmt::Write;
|
||||
SERIAL1.lock().write_fmt(args).expect("Printing to serial failed");
|
||||
SERIAL1
|
||||
.lock()
|
||||
.write_fmt(args)
|
||||
.expect("Printing to serial failed");
|
||||
}
|
||||
|
||||
/// Prints to the host through the serial interface.
|
||||
@@ -28,4 +31,4 @@ macro_rules! serial_println {
|
||||
() => (serial_print!("\n"));
|
||||
($fmt:expr) => (serial_print!(concat!($fmt, "\n")));
|
||||
($fmt:expr, $($arg:tt)*) => (serial_print!(concat!($fmt, "\n"), $($arg)*));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user