The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
exception.c File Reference
#include "exception.h"
#include "common/stdint.h"
#include "common/stdio.h"
#include "kernel/debug/ksyms.h"
#include "kernel/panic.h"
#include "kernel/klog/klog.h"
#include "kernel/process/process.h"
#include "kernel/signal/signal.h"

Functions

void exception_dump_regs (const struct registers *regs)
 print the general-purpose and segment registers of a trapped context.
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, a backtrace from the trapped frame.
void exception_handler (struct registers *regs)
 default exception handler.
void exception_initialize (void)
 initialize the exception handling subsystem.

Function Documentation

◆ exception_dump_regs()

void exception_dump_regs ( const struct registers * regs)

print the general-purpose and segment registers of a trapped context.

Parameters
regsthe saved register state.

◆ exception_panic()

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, a backtrace from the trapped frame.

Parameters
messagedescription of the fault.
regsthe saved register state.

◆ exception_handler()

void exception_handler ( struct registers * regs)

default exception handler.

this function is called when a CPU exception occurs and no specific handler is registered for that exception

Parameters
regspointer to the registers structure containing the CPU state at the time of the exception.

◆ exception_initialize()

void exception_initialize ( void )

initialize the exception handling subsystem.

this function registers a default exception handler for all CPU exceptions.