Skip to content

Commit

Permalink
[Kernel] CPU fault handlers use modern output API
Browse files Browse the repository at this point in the history
  • Loading branch information
codyd51 committed Jan 24, 2023
1 parent f0a08df commit f774737
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions kernel/kernel/interrupts/cpu_fault_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,44 @@ static void common_halt(register_state_t* regs, bool recoverable) {
}

void interrupt_handle_divide_by_zero(register_state_t* regs) {
printf_err("Attempted division by zero");
printf("Attempted division by zero\n");
common_halt(regs, false);
}

void interrupt_handle_bound_range_exceeded(register_state_t* regs) {
printf_err("Bound range exception");
printf("Bound range exception\n");
common_halt(regs, false);
}

void interrupt_handle_invalid_opcode(register_state_t* regs) {
printf_err("Invalid opcode encountered");
printf("Invalid opcode encountered\n");
common_halt(regs, false);
}

void interrupt_handle_device_not_available(register_state_t* regs) {
printf_err("Device not available");
printf("Device not available\n");
common_halt(regs, false);
}

void interrupt_handle_double_fault(register_state_t* regs) {
printf_err("=======================");
printf_err("Caught double fault!");
printf_err("=======================");
printf("=======================\n");
printf("Caught double fault\n");
printf("=======================\n");
common_halt(regs, false);
}

void interrupt_handle_invalid_tss(register_state_t* regs) {
printf_err("Invalid TSS section!");
printf("Invalid TSS section\n");
common_halt(regs, false);
}

void interrupt_handle_segment_not_present(register_state_t* regs) {
printf_err("Segment not present");
printf("Segment not present\n");
common_halt(regs, false);
}

void interrupt_handle_stack_segment_fault(register_state_t* regs) {
printf_err("Stack segment fault");
printf("Stack segment fault\n");
common_halt(regs, false);
}

Expand All @@ -61,21 +61,21 @@ void interrupt_handle_general_protection_fault(register_state_t* regs) {
}

void interrupt_handle_floating_point_exception(register_state_t* regs) {
printf_err("Floating point exception");
printf("Floating point exception\n");
common_halt(regs, false);
}

void interrupt_handle_alignment_check(register_state_t* regs) {
printf_err("Alignment check");
printf("Alignment check\n");
common_halt(regs, false);
}

void interrupt_handle_machine_check(register_state_t* regs) {
printf_err("Machine check");
printf("Machine check\n");
common_halt(regs, false);
}

void interrupt_handle_virtualization_exception(register_state_t* regs) {
printf_err("Virtualization exception");
printf("Virtualization exception\n");
common_halt(regs, false);
}

0 comments on commit f774737

Please sign in to comment.