Files
FoundryOS/kernel/src/std/debug.rs
T
2025-03-05 22:21:38 +00:00

22 lines
500 B
Rust

use crate::prelude::{_print_log, _serial_write};
use core::fmt;
use x86_64::instructions::interrupts;
#[macro_export]
macro_rules! debugln {
() => ($crate::print_log!("\n"));
($($arg:tt)*) => ($crate::debug!("{}\n", format_args!($($arg)*)));
}
#[macro_export]
macro_rules! debug {
($($arg:tt)*) => ($crate::prelude::_debug(format_args!($($arg)*)));
}
pub fn _debug(args: fmt::Arguments) {
interrupts::without_interrupts(|| {
_print_log(args);
_serial_write(args);
});
}