The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
exception.h
Go to the documentation of this file.
1#pragma once
2#include "isr.h"
3
4/**
5 * initialize the exception handling subsystem.
6 * this function registers a default exception handler for all CPU exceptions.
7 */
8void exception_initialize(void);
9
10/**
11 * default exception handler.
12 * this function is called when a CPU exception occurs and no specific handler is registered for that exception
13 * @param regs pointer to the registers structure containing the CPU state at the time of the exception.
14 */
15void exception_handler(struct registers *regs);
16
17/**
18 * print the general-purpose and segment registers of a trapped context.
19 * @param regs the saved register state.
20 */
21void exception_dump_regs(const struct registers *regs);
22
23/**
24 * panic for a trapped context: prints the faulting pc and, for faults in
25 * kernel mode, a backtrace from the trapped frame.
26 * @param message description of the fault.
27 * @param regs the saved register state.
28 */
29void exception_panic(const char *message, const struct registers *regs) __attribute__((noreturn));
void exception_handler(struct registers *regs)
default exception handler.
Definition exception.c:202
void exception_initialize(void)
initialize the exception handling subsystem.
Definition exception.c:236
void exception_panic(const char *message, const struct registers *regs)
panic for a trapped context: prints the faulting pc and, for faults in kernel mode,...
Definition exception.c:157
void exception_dump_regs(const struct registers *regs)
print the general-purpose and segment registers of a trapped context.
Definition exception.c:49
ELF32 file header.
Definition elf.h:51
saved register state pushed onto the stack by ISR stubs.
Definition isr.h:41