2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 # Copyright 2001-2004, ps2dev - http://www.ps2dev.org
7 # Licenced under Academic Free License version 2.0
8 # Review ps2sdk README & LICENSE files for further details.
10 # $Id: ioptrap.h 598 2004-09-21 19:14:27Z lukasz $
18 /* IDT_R3000_20.pdf 3-11 table 3.5 */
20 EXCEPTION_Int
, /* note you can't really work with this one. */
34 EXCEPTION_RESERVED14
/* would be FPE, but that's not going to happen on the IOP */
37 typedef struct exception_frame
{
48 /* Beware: the handler will be run in a 'bad' state. Consider you are
49 on interrupt mode, so, only i* functions. */
50 typedef void (*trap_exception_handler_t
)(exception_type_t
, exception_frame_t
*);
52 #define DCIC_WR (1<<27)
53 #define DCIC_RD (1<<26)
54 #define DCIC_DA (1<<25)
55 #define DCIC_PC (1<<24)
57 #define ioptrap_IMPORTS_start DECLARE_IMPORT_TABLE(ioptrap, 1, 1)
58 #define ioptrap_IMPORTS_end END_IMPORT_TABLE
60 const char * get_exception_name(exception_type_t type
);
61 #define I_get_exception_name DECLARE_IMPORT(4, get_exception_name)
63 /* Will act as a setjmp. Returns 0 to say it was the first call,
64 otherwise, returns the exception number. (note that you'll never
65 get any interrupt...) Note that using this will completely disable
66 user defined exception handlers. */
67 exception_type_t
dbg_setjmp();
68 #define I_dbg_setjmp DECLARE_IMPORT(5, dbg_setjmp)
70 /* Will return the old handler. */
71 trap_exception_handler_t
set_exception_handler(exception_type_t type
, trap_exception_handler_t handler
);
72 #define I_set_exception_handler DECLARE_IMPORT(6, set_exception_handler)
73 trap_exception_handler_t
get_exception_handler(exception_type_t type
);
74 #define I_get_exception_handler DECLARE_IMPORT(7, get_exception_handler)
76 /* Breakpoint stuff. */
78 #define I_set_dba DECLARE_IMPORT(8, set_dba)
80 #define I_set_dbam DECLARE_IMPORT(9, set_dbam)
82 #define I_set_dcic DECLARE_IMPORT(10, set_dcic)
84 #define I_get_dba DECLARE_IMPORT(11, get_dba)
86 #define I_get_dbam DECLARE_IMPORT(12, get_dbam)
88 #define I_get_dcic DECLARE_IMPORT(13, get_dcic)