PatchworkOS  c9fea19
A non-POSIX operating system.
Loading...
Searching...
No Matches
panic.c File Reference
#include <kernel/cpu/irq.h>
#include <kernel/log/panic.h>
#include <kernel/cpu/cpu.h>
#include <kernel/cpu/interrupt.h>
#include <kernel/cpu/io.h>
#include <kernel/cpu/regs.h>
#include <kernel/init/init.h>
#include <kernel/log/log.h>
#include <kernel/mem/pmm.h>
#include <kernel/mem/vmm.h>
#include <kernel/module/symbol.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 <string.h>
#include <sys/io.h>
#include <sys/math.h>
#include <sys/proc.h>
Include dependency graph for panic.c:

Go to the source code of this file.

Functions

static const char * panic_get_exception_name (uint64_t vector)
 
static void panic_registers (const interrupt_frame_t *frame)
 
static bool panic_is_valid_address (uintptr_t addr)
 
static bool panic_is_valid_stack_frame (uintptr_t ptr)
 
static void panic_print_stack_dump (const interrupt_frame_t *frame)
 
static uint64_t panic_print_trace_address (uintptr_t addr)
 
static void panic_unwind_stack (uintptr_t *rbp)
 
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 (const interrupt_frame_t *frame, const char *format,...)
 Panic the kernel, printing a message and halting.
 

Variables

uint64_t _kernelStart
 
uint64_t _kernelEnd
 
static char panicBuffer [LOG_MAX_BUFFER] = {0}
 
static atomic_uint32_t panicCpuId = ATOMIC_VAR_INIT(PANIC_NO_CPU_ID)
 

Function Documentation

◆ panic_get_exception_name()

static const char * panic_get_exception_name ( uint64_t  vector)
static

Definition at line 34 of file panic.c.

Here is the caller graph for this function:

◆ panic_registers()

static void panic_registers ( const interrupt_frame_t frame)
static

Definition at line 68 of file panic.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ panic_is_valid_address()

static bool panic_is_valid_address ( uintptr_t  addr)
static

Definition at line 88 of file panic.c.

Here is the caller graph for this function:

◆ panic_is_valid_stack_frame()

static bool panic_is_valid_stack_frame ( uintptr_t  ptr)
static

Definition at line 117 of file panic.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ panic_print_stack_dump()

static void panic_print_stack_dump ( const interrupt_frame_t frame)
static

Definition at line 139 of file panic.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ panic_print_trace_address()

static uint64_t panic_print_trace_address ( uintptr_t  addr)
static

Definition at line 198 of file panic.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ panic_unwind_stack()

static void panic_unwind_stack ( uintptr_t rbp)
static

Definition at line 217 of file panic.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ panic_direct_stack_trace()

static void panic_direct_stack_trace ( void  )
static

Definition at line 256 of file panic.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ _kernelStart

uint64_t _kernelStart
extern

◆ _kernelEnd

uint64_t _kernelEnd
extern

◆ panicBuffer

char panicBuffer[LOG_MAX_BUFFER] = {0}
static

Definition at line 30 of file panic.c.

◆ panicCpuId

atomic_uint32_t panicCpuId = ATOMIC_VAR_INIT(PANIC_NO_CPU_ID)
static

Definition at line 32 of file panic.c.