MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / __OSUnhandledException

Function __OSUnhandledException

src/dolphin/src/os/OSError.c:114–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114void __OSUnhandledException(__OSException exception, OSContext* context, u32 dsisr, u32 dar)
115{
116 OSTime now;
117
118 now = OSGetTime();
119
120 if (!(context->srr1 & MSR_RI))
121 {
122 OSReport("Non-recoverable Exception %d", exception);
123 }
124 else
125 {
126 if (exception == __OS_EXCEPTION_PROGRAM && (context->srr1 & (0x80000000 >> 11)) &&
127 __OSErrorTable[OS_ERROR_FPE] != 0)
128 {
129 u32 fpscr;
130 u32 msr;
131
132 exception = OS_ERROR_FPE;
133
134 msr = PPCMfmsr();
135 PPCMtmsr(msr | MSR_FP);
136
137 if (__OSFPUContext)
138 {
139 OSSaveFPUContext((OSContext*)__OSFPUContext);
140 }
141
142 fpscr = PPCMffpscr();
143 fpscr &= ~(FPSCR_VXVC | FPSCR_VXIMZ | FPSCR_VXZDZ | FPSCR_VXIDI | FPSCR_VXISI |
144 FPSCR_VXSNAN | FPSCR_VXSOFT | FPSCR_VXSQRT | FPSCR_VXCVI | FPSCR_XX |
145 FPSCR_ZX | FPSCR_UX | FPSCR_OX | FPSCR_FX | FPSCR_FI);
146 PPCMtfpscr(fpscr);
147
148 PPCMtmsr(msr);
149
150 if (__OSFPUContext == context)
151 {
152 OSDisableScheduler();
153 __OSErrorTable[exception](exception, context, dsisr, dar);
154 context->srr1 &= ~MSR_FP;
155 __OSFPUContext = NULL;
156
157 context->fpscr &=
158 ~(FPSCR_VXVC | FPSCR_VXIMZ | FPSCR_VXZDZ | FPSCR_VXIDI | FPSCR_VXISI |
159 FPSCR_VXSNAN | FPSCR_VXSOFT | FPSCR_VXSQRT | FPSCR_VXCVI | FPSCR_XX |
160 FPSCR_ZX | FPSCR_UX | FPSCR_OX | FPSCR_FX | FPSCR_FI);
161 OSEnableScheduler();
162 __OSReschedule();
163 }
164 else
165 {
166 context->srr1 &= ~MSR_FP;
167 __OSFPUContext = NULL;
168 }
169
170 OSLoadContext(context);
171 }

Callers 2

MEMIntrruptHandlerFunction · 0.85
OSExceptionVectorFunction · 0.85

Calls 10

OSGetTimeFunction · 0.85
OSReportFunction · 0.85
PPCMfmsrFunction · 0.85
PPCMtmsrFunction · 0.85
PPCMffpscrFunction · 0.85
OSDisableSchedulerFunction · 0.85
OSEnableSchedulerFunction · 0.85
__OSRescheduleFunction · 0.85
OSLoadContextFunction · 0.85
OSDumpContextFunction · 0.85

Tested by

no test coverage detected