qemu_i486_q35/
io.rs

1// Licensed under the Apache License, Version 2.0 or the MIT License.
2// SPDX-License-Identifier: Apache-2.0 OR MIT
3// Copyright Tock Contributors 2024.
4
5use core::panic::PanicInfo;
6use core::ptr;
7
8use kernel::debug;
9
10use x86_q35::serial::{BlockingSerialPort, COM1_BASE};
11
12use crate::{CHIP, PROCESSES, PROCESS_PRINTER};
13
14/// Panic handler.
15#[cfg(not(test))]
16#[panic_handler]
17unsafe fn panic_handler(pi: &PanicInfo) -> ! {
18    let mut com1 = BlockingSerialPort::new(COM1_BASE);
19
20    debug::panic_print(
21        &mut com1,
22        pi,
23        &x86::support::nop,
24        &*ptr::addr_of!(PROCESSES),
25        &*ptr::addr_of!(CHIP),
26        &*ptr::addr_of!(PROCESS_PRINTER),
27    );
28
29    loop {}
30}