mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Run rustfmt
This commit is contained in:
@@ -65,22 +65,18 @@ struct ExceptionStackFrame {
|
|||||||
|
|
||||||
use vga_buffer::print_error;
|
use vga_buffer::print_error;
|
||||||
|
|
||||||
extern "C" fn divide_by_zero_handler(stack_frame: *const ExceptionStackFrame)
|
extern "C" fn divide_by_zero_handler(stack_frame: *const ExceptionStackFrame) -> ! {
|
||||||
-> !
|
|
||||||
{
|
|
||||||
unsafe {
|
unsafe {
|
||||||
print_error(format_args!("EXCEPTION: DIVIDE BY ZERO\n{:#?}",
|
print_error(format_args!("EXCEPTION: DIVIDE BY ZERO\n{:#?}", *stack_frame));
|
||||||
*stack_frame));
|
|
||||||
}
|
}
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" fn invalid_opcode_handler(stack_frame: *const ExceptionStackFrame)
|
extern "C" fn invalid_opcode_handler(stack_frame: *const ExceptionStackFrame) -> ! {
|
||||||
-> !
|
|
||||||
{
|
|
||||||
unsafe {
|
unsafe {
|
||||||
print_error(format_args!("EXCEPTION: INVALID OPCODE at {:#x}\n{:#?}",
|
print_error(format_args!("EXCEPTION: INVALID OPCODE at {:#x}\n{:#?}",
|
||||||
(*stack_frame).instruction_pointer, *stack_frame));
|
(*stack_frame).instruction_pointer,
|
||||||
|
*stack_frame));
|
||||||
}
|
}
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
@@ -95,17 +91,14 @@ bitflags! {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" fn page_fault_handler(stack_frame: *const ExceptionStackFrame,
|
extern "C" fn page_fault_handler(stack_frame: *const ExceptionStackFrame, error_code: u64) -> ! {
|
||||||
error_code: u64) -> !
|
|
||||||
{
|
|
||||||
use x86::controlregs;
|
use x86::controlregs;
|
||||||
unsafe {
|
unsafe {
|
||||||
print_error(format_args!(
|
print_error(format_args!("EXCEPTION: PAGE FAULT while accessing {:#x}\nerror code: \
|
||||||
"EXCEPTION: PAGE FAULT while accessing {:#x}\
|
{:?}\n{:#?}",
|
||||||
\nerror code: {:?}\n{:#?}",
|
controlregs::cr2(),
|
||||||
controlregs::cr2(),
|
PageFaultErrorCode::from_bits(error_code).unwrap(),
|
||||||
PageFaultErrorCode::from_bits(error_code).unwrap(),
|
*stack_frame));
|
||||||
*stack_frame));
|
|
||||||
}
|
}
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user