|
PatchworkOS
|
#include <kernel/log/panic.h>#include <kernel/cpu/cpu.h>#include <kernel/cpu/interrupt.h>#include <kernel/cpu/port.h>#include <kernel/cpu/regs.h>#include <kernel/cpu/smp.h>#include <kernel/log/log.h>#include <kernel/mem/pmm.h>#include <kernel/mem/vmm.h>#include <kernel/sched/thread.h>#include <kernel/sched/timer.h>#include <kernel/version.h>#include <boot/boot_info.h>#include <stdarg.h>#include <stdint.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/io.h>#include <sys/math.h>#include <sys/proc.h>Go to the source code of this file.
Functions | |
| static bool | panic_is_valid_stack_frame (void *ptr) |
| static bool | panic_is_valid_address (uintptr_t addr) |
| static const char * | panic_resolve_symbol (uintptr_t addr, uintptr_t *offset) |
| static const char * | panic_get_exception_name (uint64_t vector) |
| static void | panic_registers (const interrupt_frame_t *frame) |
| static void | panic_print_stack_dump (const interrupt_frame_t *frame) |
| static void | panic_print_trace_address (uintptr_t addr) |
| static void | panic_direct_stack_trace (void) |
| void | panic_stack_trace (const interrupt_frame_t *frame) |
| Print a stack trace from a interrupt frame. | |
| void | panic_symbols_init (const boot_kernel_t *kernel) |
| Initialize panic symbols from the bootloader-provided kernel information. | |
| void | panic (const interrupt_frame_t *frame, const char *format,...) |
| Panic the kernel, printing a message and halting. | |
Variables | |
| uint64_t | _kernelStart |
| uint64_t | _kernelEnd |
| static list_t | symbols = LIST_CREATE(symbols) |
| static bool | symbolsLoaded = false |
| static char | panicBuffer [LOG_MAX_BUFFER] = {0} |
| static atomic_uint32_t | panicCpudId = ATOMIC_VAR_INIT(PANIC_NO_CPU_ID) |
|
static |
Definition at line 246 of file panic.c.
References LOG_PANIC, NULL, panic_is_valid_stack_frame(), PANIC_MAX_STACK_FRAMES, and panic_print_trace_address().
Referenced by panic().
|
static |
Definition at line 65 of file panic.c.
References UINTPTR_MAX, VMM_IDENTITY_MAPPED_MIN, VMM_KERNEL_BINARY_MAX, VMM_USER_SPACE_MAX, and VMM_USER_SPACE_MIN.
Referenced by panic_print_stack_dump().
|
static |
Definition at line 35 of file panic.c.
References NULL, UINTPTR_MAX, VMM_IDENTITY_MAPPED_MIN, VMM_KERNEL_BINARY_MAX, VMM_USER_SPACE_MAX, and VMM_USER_SPACE_MIN.
Referenced by panic_direct_stack_trace(), and panic_stack_trace().
|
static |
Definition at line 168 of file panic.c.
References LOG_PANIC, panic_is_valid_address(), and interrupt_frame_t::rsp.
Referenced by panic().
|
static |
Definition at line 227 of file panic.c.
References LOG_PANIC, NULL, panic_resolve_symbol(), VMM_USER_SPACE_MAX, and VMM_USER_SPACE_MIN.
Referenced by panic_direct_stack_trace(), and panic_stack_trace().
|
static |
Definition at line 147 of file panic.c.
References interrupt_frame_t::cs, LOG_PANIC, NULL, panic_resolve_symbol(), interrupt_frame_t::r10, interrupt_frame_t::r11, interrupt_frame_t::r12, interrupt_frame_t::r13, interrupt_frame_t::r14, interrupt_frame_t::r15, interrupt_frame_t::r8, interrupt_frame_t::r9, interrupt_frame_t::rax, interrupt_frame_t::rbp, interrupt_frame_t::rbx, interrupt_frame_t::rcx, interrupt_frame_t::rdi, interrupt_frame_t::rdx, interrupt_frame_t::rflags, interrupt_frame_t::rip, interrupt_frame_t::rsi, interrupt_frame_t::rsp, and interrupt_frame_t::ss.
Referenced by panic().
Definition at line 90 of file panic.c.
References LIST_FOR_EACH, panic_symbol_t::name, NULL, panic_symbol_t::start, symbols, and symbolsLoaded.
Referenced by panic_print_trace_address(), and panic_registers().
|
static |
|
static |
|
static |
Definition at line 29 of file panic.c.
Referenced by panic_resolve_symbol(), and panic_symbols_init().
Definition at line 30 of file panic.c.
Referenced by panic_resolve_symbol(), and panic_symbols_init().