PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
ioptrap.c File Reference
#include "types.h"
#include "defs.h"
#include "irx.h"
#include "ioptrap.h"
#include "excepman.h"
#include "loadcore.h"
#include "sifman.h"
#include "stdio.h"
#include "sysclib.h"
#include "thbase.h"
+ Include dependency graph for ioptrap.c:

Go to the source code of this file.

Macros

#define MODNAME   "ioptrap_driver"
 
#define JUMP_BUF_PC   0
 
#define JUMP_BUF_SP   1
 
#define JUMP_BUF_FP   2
 
#define JUMP_BUF_S0   3
 
#define JUMP_BUF_S1   4
 
#define JUMP_BUF_S2   5
 
#define JUMP_BUF_S3   6
 
#define JUMP_BUF_S4   7
 
#define JUMP_BUF_S5   8
 
#define JUMP_BUF_S6   9
 
#define JUMP_BUF_S7   10
 
#define JUMP_BUF_GP   11
 
#define TRAP_PRINTF(args...)   printf(MODNAME ": " args)
 
#define do_tests()
 

Functions

 IRX_ID (MODNAME, 1, 1)
 
const char * get_exception_name (exception_type_t type)
 
void def_exc_handler ()
 
void bp_exc_handler ()
 
exception_type_t dbg_setjmp ()
 
trap_exception_handler_t set_exception_handler (exception_type_t type, trap_exception_handler_t handler)
 
trap_exception_handler_t get_exception_handler (exception_type_t type)
 
void trap (exception_type_t type, struct exception_frame *ex)
 
int _start (int argc, char *argv[])
 
int shutdown ()
 

Variables

struct irx_export_table _exp_ioptrap
 
static const char * exception_type_name []
 
exception_frame_t __trap_frame
 
int dbg_jmp_buf_setup = 0
 
jmp_buf dbg_jmp_buf
 
static trap_exception_handler_t handlers [16]
 

Detailed Description

IOP exception handling.

Definition in file ioptrap.c.

Macro Definition Documentation

◆ MODNAME

#define MODNAME   "ioptrap_driver"

Definition at line 28 of file ioptrap.c.

◆ JUMP_BUF_PC

#define JUMP_BUF_PC   0

Definition at line 129 of file ioptrap.c.

◆ JUMP_BUF_SP

#define JUMP_BUF_SP   1

Definition at line 130 of file ioptrap.c.

◆ JUMP_BUF_FP

#define JUMP_BUF_FP   2

Definition at line 131 of file ioptrap.c.

◆ JUMP_BUF_S0

#define JUMP_BUF_S0   3

Definition at line 132 of file ioptrap.c.

◆ JUMP_BUF_S1

#define JUMP_BUF_S1   4

Definition at line 133 of file ioptrap.c.

◆ JUMP_BUF_S2

#define JUMP_BUF_S2   5

Definition at line 134 of file ioptrap.c.

◆ JUMP_BUF_S3

#define JUMP_BUF_S3   6

Definition at line 135 of file ioptrap.c.

◆ JUMP_BUF_S4

#define JUMP_BUF_S4   7

Definition at line 136 of file ioptrap.c.

◆ JUMP_BUF_S5

#define JUMP_BUF_S5   8

Definition at line 137 of file ioptrap.c.

◆ JUMP_BUF_S6

#define JUMP_BUF_S6   9

Definition at line 138 of file ioptrap.c.

◆ JUMP_BUF_S7

#define JUMP_BUF_S7   10

Definition at line 139 of file ioptrap.c.

◆ JUMP_BUF_GP

#define JUMP_BUF_GP   11

Definition at line 140 of file ioptrap.c.

◆ TRAP_PRINTF

#define TRAP_PRINTF (   args...)    printf(MODNAME ": " args)

Definition at line 143 of file ioptrap.c.

◆ do_tests

#define do_tests ( )

Definition at line 265 of file ioptrap.c.

Function Documentation

◆ get_exception_name()

const char * get_exception_name ( exception_type_t  type)

Definition at line 52 of file ioptrap.c.

◆ dbg_setjmp()

exception_type_t dbg_setjmp ( )

Definition at line 64 of file ioptrap.c.

◆ set_exception_handler()

trap_exception_handler_t set_exception_handler ( exception_type_t  type,
trap_exception_handler_t  handler 
)

Definition at line 147 of file ioptrap.c.

◆ get_exception_handler()

trap_exception_handler_t get_exception_handler ( exception_type_t  type)

Definition at line 154 of file ioptrap.c.

◆ trap()

void trap ( exception_type_t  type,
struct exception_frame ex 
)

Definition at line 159 of file ioptrap.c.

◆ _start()

int _start ( int  argc,
char *  argv[] 
)

Definition at line 268 of file ioptrap.c.

◆ shutdown()

int shutdown ( void  )

Definition at line 293 of file ioptrap.c.

Variable Documentation

◆ exception_type_name

const char* exception_type_name[]
static
Initial value:
= {
"Interrupt",
"TLB Modification",
"TLB Miss Load",
"TLB Miss Store",
"Address Error Load",
"Address Error Store",
"Instruction Bus Error",
"Data Bus Error",
"Syscall",
"Breakpoint",
"Reserved Instruction",
"Coprocessor Unusable",
"Overflow",
"Reserved 13",
"Reserved 14"
}

Definition at line 34 of file ioptrap.c.

◆ __trap_frame

exception_frame_t __trap_frame

Definition at line 57 of file ioptrap.c.

◆ dbg_jmp_buf_setup

int dbg_jmp_buf_setup = 0

Definition at line 61 of file ioptrap.c.

◆ dbg_jmp_buf

jmp_buf dbg_jmp_buf

Definition at line 62 of file ioptrap.c.

◆ handlers

trap_exception_handler_t handlers[16]
static

Definition at line 145 of file ioptrap.c.