parent
96d8af8034
commit
7b4cc6d772
@ -1,45 +0,0 @@
|
||||
// FIXME: merge to x86_64 io
|
||||
|
||||
use core::fmt;
|
||||
|
||||
macro_rules! print {
|
||||
($($arg:tt)*) => ({
|
||||
$crate::io::print(format_args!($($arg)*));
|
||||
});
|
||||
}
|
||||
|
||||
macro_rules! println {
|
||||
($fmt:expr) => (print!(concat!($fmt, "\n")));
|
||||
($fmt:expr, $($arg:tt)*) => (print!(concat!($fmt, "\n"), $($arg)*));
|
||||
}
|
||||
|
||||
macro_rules! trace {
|
||||
($fmt:expr) => (print!(concat!("[trace] ", $fmt, "\n")));
|
||||
($fmt:expr, $($arg:tt)*) => (print!(concat!("[trace] ", $fmt, "\n"), $($arg)*));
|
||||
}
|
||||
|
||||
macro_rules! debug {
|
||||
($fmt:expr) => (print!(concat!("[debug] ", $fmt, "\n")));
|
||||
($fmt:expr, $($arg:tt)*) => (print!(concat!("[debug] ", $fmt, "\n"), $($arg)*));
|
||||
}
|
||||
|
||||
macro_rules! info {
|
||||
($fmt:expr) => (print!(concat!("[ info] ", $fmt, "\n")));
|
||||
($fmt:expr, $($arg:tt)*) => (print!(concat!("[ info] ", $fmt, "\n"), $($arg)*));
|
||||
}
|
||||
|
||||
macro_rules! warn {
|
||||
($fmt:expr) => (print!(concat!("[ warn] ", $fmt, "\n")));
|
||||
($fmt:expr, $($arg:tt)*) => (print!(concat!("[ warn] ", $fmt, "\n"), $($arg)*));
|
||||
}
|
||||
|
||||
macro_rules! error {
|
||||
($fmt:expr) => (print!(concat!("[error] ", $fmt, "\n")));
|
||||
($fmt:expr, $($arg:tt)*) => (print!(concat!("[error] ", $fmt, "\n"), $($arg)*));
|
||||
}
|
||||
|
||||
pub fn print(args: fmt::Arguments) {
|
||||
use arch::serial::SerialPort;
|
||||
use core::fmt::Write;
|
||||
SerialPort.write_fmt(args).unwrap();
|
||||
}
|
Loading…
Reference in new issue