You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
440 B
Rust
20 lines
440 B
Rust
5 years ago
|
// SPDX-License-Identifier: MIT OR Apache-2.0
|
||
5 years ago
|
//
|
||
3 years ago
|
// Copyright (c) 2018-2021 Andre Richter <andre.o.richter@gmail.com>
|
||
5 years ago
|
|
||
|
//! A panic handler that infinitely waits.
|
||
|
|
||
4 years ago
|
use crate::{cpu, println};
|
||
5 years ago
|
use core::panic::PanicInfo;
|
||
|
|
||
|
#[panic_handler]
|
||
|
fn panic(info: &PanicInfo) -> ! {
|
||
|
if let Some(args) = info.message() {
|
||
4 years ago
|
println!("\nKernel panic: {}", args);
|
||
5 years ago
|
} else {
|
||
4 years ago
|
println!("\nKernel panic!");
|
||
5 years ago
|
}
|
||
|
|
||
4 years ago
|
cpu::wait_forever()
|
||
5 years ago
|
}
|