PatchworkOS  da8a090
A non-POSIX operating system.
Loading...
Searching...
No Matches
Panic

Panic handling. More...

Collaboration diagram for Panic:

Detailed Description

Panic handling.

Macros

#define PANIC_NO_CPU_ID   UINT32_MAX
 Cpu ID indicating no CPU has panicked yet.
 
#define PANIC_MAX_STACK_FRAMES   16
 Maximum stack frames to capture in a panic.
 
#define QEMU_EXIT_ON_PANIC_PORT   0x501
 QEMU exit port for panic.
 

Functions

void panic_stack_trace (const interrupt_frame_t *frame)
 Print a stack trace from a interrupt frame.
 
NORETURN void panic (const interrupt_frame_t *frame, const char *format,...)
 Panic the kernel, printing a message and halting.
 

Macro Definition Documentation

◆ PANIC_NO_CPU_ID

#define PANIC_NO_CPU_ID   UINT32_MAX

Cpu ID indicating no CPU has panicked yet.

Definition at line 23 of file panic.h.

◆ PANIC_MAX_STACK_FRAMES

#define PANIC_MAX_STACK_FRAMES   16

Maximum stack frames to capture in a panic.

Definition at line 28 of file panic.h.

◆ QEMU_EXIT_ON_PANIC_PORT

#define QEMU_EXIT_ON_PANIC_PORT   0x501

QEMU exit port for panic.

Definition at line 33 of file panic.h.

Function Documentation

◆ panic_stack_trace()

void panic_stack_trace ( const interrupt_frame_t frame)

Print a stack trace from a interrupt frame.

Will NOT panic the kernel, just print the stack trace.

Parameters
framePointer to the interrupt frame.

Definition at line 261 of file panic.c.

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

◆ panic()

NORETURN void panic ( const interrupt_frame_t frame,
const char *  format,
  ... 
)

Panic the kernel, printing a message and halting.

If QEMU_EXIT_ON_PANIC is defined and we are running in QEMU, will exit QEMU instead of halting.

Parameters
framePointer to the interrupt frame, can be NULL.
formatThe format string for the panic message.
...Additional arguments for the format string.

Definition at line 266 of file panic.c.

Here is the call graph for this function: