libdragon
Data Structures | Typedefs | Enumerations | Functions

Exception Handler. More...

Go to the source code of this file.

Data Structures

struct  reg_block_t
 Structure representing a register block. More...
 
struct  exception_t
 Structure representing an exception. More...
 

Typedefs

typedef void(* exception_handler_t) (exception_t *exc)
 Generic exception handler. More...
 
typedef void(* syscall_handler_t) (exception_t *exc, uint32_t code)
 Syscall handler. More...
 

Enumerations

enum  { EXCEPTION_TYPE_UNKNOWN = 0 , EXCEPTION_TYPE_RESET , EXCEPTION_TYPE_CRITICAL , EXCEPTION_TYPE_SYSCALL }
 Exception types. More...
 
enum  exception_code_t {
  EXCEPTION_CODE_INTERRUPT = 0 , EXCEPTION_CODE_TLB_MODIFICATION = 1 , EXCEPTION_CODE_TLB_LOAD_I_MISS = 2 , EXCEPTION_CODE_TLB_STORE_MISS = 3 ,
  EXCEPTION_CODE_LOAD_I_ADDRESS_ERROR = 4 , EXCEPTION_CODE_STORE_ADDRESS_ERROR = 5 , EXCEPTION_CODE_I_BUS_ERROR = 6 , EXCEPTION_CODE_D_BUS_ERROR = 7 ,
  EXCEPTION_CODE_SYS_CALL = 8 , EXCEPTION_CODE_BREAKPOINT = 9 , EXCEPTION_CODE_RESERVED_INSTRUCTION = 10 , EXCEPTION_CODE_COPROCESSOR_UNUSABLE = 11 ,
  EXCEPTION_CODE_ARITHMETIC_OVERFLOW = 12 , EXCEPTION_CODE_TRAP = 13 , EXCEPTION_CODE_FLOATING_POINT = 15 , EXCEPTION_CODE_WATCH = 23
}
 Exception codes.
 

Functions

exception_handler_t register_exception_handler (exception_handler_t cb)
 Register an exception handler to handle exceptions. More...
 
void exception_default_handler (exception_t *ex)
 Default exception handler. More...
 
void register_syscall_handler (syscall_handler_t cb, uint32_t first_code, uint32_t last_code)
 Register a handler that will be called when a syscall exception. More...
 

Detailed Description

Exception Handler.

Typedef Documentation

◆ exception_handler_t

typedef void(* exception_handler_t) (exception_t *exc)

Generic exception handler.

This is the type of a handler that can be registered using register_exception_handler. It is associated to all unhandled exceptions that are not otherwise handled by libdragon.

Parameters
excException information

◆ syscall_handler_t

typedef void(* syscall_handler_t) (exception_t *exc, uint32_t code)

Syscall handler.

This is the type of a handler of a syscall exception.

Parameters
excException information
codeSyscall code