The manual
ginnOS
The reference: libc, the libraries and the kernel
Toggle main menu visibility
Loading...
Searching...
No Matches
panic.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
common/stdint.h
"
4
5
/**
6
* check whether a core has started a panic. the other cores then get an
7
* NMI (ARCH_IPI_STOP), and their NMI handler halts.
8
* @return true from the start of the first panic.
9
*/
10
bool
panic_in_progress
(
void
);
11
12
/**
13
* trigger a kernel panic, display error message and halt the system.
14
* prints a backtrace of the caller.
15
* @param message description of the panic condition.
16
*/
17
void
kernel_panic
(
const
char
*message)
__attribute__
((noreturn));
18
19
/**
20
* panic on behalf of a trapped context (cpu exception, page fault).
21
* prints the faulting pc and a backtrace from the trapped frame instead of
22
* the handler's own stack.
23
* @param message description of the panic condition.
24
* @param pc the faulting instruction address.
25
* @param caller a probable return address into the faulting function's
26
* caller, printed as an uncertain "?" entry, or 0. this
27
* recovers the caller when the fault hit a function without a
28
* frame of its own (a frameless leaf or a prologue).
29
* @param frame the frame pointer at the fault, or 0 to skip the backtrace
30
* (e.g. the fault came from user mode).
31
*/
32
void
kernel_panic_at
(
const
char
*message,
uintptr_t
pc,
uintptr_t
caller,
uintptr_t
frame)
33
__attribute__
((noreturn));
stdint.h
uintptr_t
__UINTPTR_TYPE__ uintptr_t
Definition
stdint.h:19
panic_in_progress
bool panic_in_progress(void)
check whether a core has started a panic.
Definition
panic.c:18
kernel_panic_at
void kernel_panic_at(const char *message, uintptr_t pc, uintptr_t caller, uintptr_t frame)
panic on behalf of a trapped context (cpu exception, page fault).
Definition
panic.c:106
kernel_panic
void kernel_panic(const char *message)
trigger a kernel panic, display error message and halt the system.
Definition
panic.c:92
__attribute__
ELF32 file header.
Definition
elf.h:51
src
kernel
panic.h
Generated by
1.18.0