libnds
Macros | Functions | Variables
exceptions.h File Reference

Functions to handle hardware exceptions. More...

#include <nds/cpu.h>
#include <nds/ndstypes.h>

Macros

#define EXCEPTION_STACK_TOP   ((uint32_t *)0x2FFFD9C)
 NDS9 BIOS debug exception stack top (mirror)
 
#define EXCEPTION_VECTOR   (*(VoidFn *)(0x2FFFD9C))
 NDS9 BIOS debug exception vector, or 0 for no handler (mirror)
 

Functions

void defaultExceptionHandler (void)
 Sets the default hardware exception handler.
 
void enterException (void)
 Default exception handler of libnds.
 
void setExceptionHandler (VoidFn handler)
 Sets a custom hardware exception handler. More...
 

Variables

VoidFn exceptionC
 Pointer to the user exception handler, called from the exception handler of libnds.
 
s32 exceptionRegisters []
 Array with a copy of all the registers of when the exception occured.
 
u32 exceptionStack
 Stack reserved for the user exception handler, allocated by the exception handler of libnds.
 

Detailed Description

Functions to handle hardware exceptions.

Check https://www.problemkaputt.de/gbatek.htm#biosramusage for more information.

Function Documentation

◆ setExceptionHandler()

void setExceptionHandler ( VoidFn  handler)

Sets a custom hardware exception handler.

Parameters
handlerException handler routine.