11 IRX_ID(
"sbusdebug", 1, 0);
13 volatile int _iop_controlled = 0;
14 volatile int _iop_exception_state = 0;
21 int excode = M_IOP_GET_CAUSE_EXCODE(frame->cause);
25 _iop_exception_state = 2;
29 _iop_exception_state = 1;
35 signal_iop_exception(frame);
38 while(_iop_controlled)
48 extern void soft_break(
void);
52 "\t" ".set noreorder" "\n"
55 "\t" ".global soft_break" "\n"
56 "\t" ".ent soft_break" "\n"
57 "\t" "soft_break:" "\n"
59 "\t" "\t" "break" "\n"
61 "\t" "\t" "jr $ra" "\n"
63 "\t" ".end soft_break" "\n"
68 void _controller_thread(
void *arg)
86 param.thread = _controller_thread;
88 param.stacksize = 512;
91 tid = CreateThread(¶m);
95 extern void SBUS_dbg_init(
void);
97 int _start(
int argc,
char *argv[])
104 for(i = 2; i <= 7; i++)
106 iop_dbg_set_handler(i, (IOP_ExceptionHandler *) _iop_ex_handler);
109 for(i = 9; i <= 15; i++)
111 iop_dbg_set_handler(i, (IOP_ExceptionHandler *) _iop_ex_handler);
116 if(sbus_tty_init() != 0)
118 printf(
"Failed initializing SBUS TTY system!\n");
119 return MODULE_NO_RESIDENT_END;
127 printf(
"IOP SBUS Debug installed!\n");
129 return MODULE_RESIDENT_END;