17#ifdef F_GetSyscallHandler
18static u32 *g_pSyscallTable = NULL;
21static void InitSyscallTable(
void)
27 oldop = ee_set_opmode(0);
28 pAddr = (u32 *)0x800002f0;
29 g_pSyscallTable = (u32 *)((pAddr[0] << 16) | (pAddr[2] & 0xFFFF));
40void *GetSyscallHandler(
int syscall_no)
45 if (g_pSyscallTable == NULL) {
49 if (g_pSyscallTable != NULL) {
51 oldop = ee_set_opmode(0);
52 addr = g_pSyscallTable[syscall_no];
68void *GetSyscall(
int syscall_no) {
return (GetSyscallHandler(syscall_no)); }
71#ifdef F_GetExceptionHandler
73extern void *GetSyscallHandler(
int syscall_no);
79void *GetExceptionHandler(
int ex_cause_no)
85 if ((ex_cause_no < 1) || (ex_cause_no > 15)) {
90 addr = (u32)GetSyscallHandler(13);
94 oldop = ee_set_opmode(0);
97 lo16 = ((vu32 *)addr)[0x20 / 4];
98 hi16 = ((vu32 *)addr)[0x14 / 4];
99 table_addr = ((u32)(hi16 << 16) | lo16);
101 addr = ((u32 *)table_addr)[ex_cause_no];
104 ee_set_opmode(oldop);
109 return ((
void *)addr);
113#ifdef F_GetInterruptHandler
115extern void *GetSyscallHandler(
int syscall_no);
121void *GetInterruptHandler(
int intr_cause_no)
128 if ((intr_cause_no < 0) || (intr_cause_no > 7)) {
133 addr = (u32)GetSyscallHandler(15);
137 oldop = ee_set_opmode(0);
140 hi16 = ((vu32 *)addr)[0x10 / 4];
141 lo16 = ((vu32 *)addr)[0x1C / 4];
143 addr = ((u32 *)((u32)(hi16 << 16) | lo16))[intr_cause_no];
146 ee_set_opmode(oldop);