ArvernOS
Loading...
Searching...
No Matches
panic.h File Reference
#include <logging.h>
#include <stdbool.h>
Include dependency graph for panic.h:

Macros

#define PANIC(...)   __PANIC(true, __VA_ARGS__, "\n")
 This macro should only be used when something goes terribly wrong.
 
#define PANIC_NO_STACKTRACE(...)   __PANIC(false, __VA_ARGS__, "\n")
 

Functions

void kernel_panic (bool dump_stacktrace, const char *format,...)
 
void kernel_dump_stacktrace ()
 

Detailed Description

See also
https://en.wikipedia.org/wiki/Kernel_panic

This file mainly contains the macros to use for kernel panics.

Macro Definition Documentation

◆ PANIC_NO_STACKTRACE

#define PANIC_NO_STACKTRACE ( ...)    __PANIC(false, __VA_ARGS__, "\n")

This macro is similar to PANIC() but it won't attempt to print a stacktrace.

Function Documentation

◆ kernel_dump_stacktrace()

void kernel_dump_stacktrace ( )

Dumps a stacktrace on both the standard and debug outputs (unless both are the same, in which case we do not print the debug messages).

◆ kernel_panic()

void kernel_panic ( bool dump_stacktrace,
const char * format,
... )

Handles a kernel panic.

Parameters
dump_stacktracewhether to dump a stacktrace
formatthe reason for the kernel panic