// Copyright (c) 2025 shibedrill
// SPDX-License-Identifier: MIT

use crate::{SERIAL_3F8, log::*};
use crate::{format, log_error, memory::alloc::string::String};

pub fn double_fault(info: String) -> ! {
    panic!("Double fault: {}", info);
}

pub fn page_fault_fatal(addr: usize, info: String) -> ! {
    panic!("Fatal page fault at 0x{:x}: {}", addr, info);
}

pub fn gen_prot_fault(info: String) {
    SERIAL_3F8.lock().log_writeln("Ohhhhh shit double fault");
    log_error!("General protection fault: {}", info);
}
