MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / prepareFpuException

Method prepareFpuException

source/emulation/cpu/common/cpu.cpp:211–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209}
210
211void CPU::prepareFpuException(int code, int error) {
212 const KProcessPtr& process = this->thread->process;
213
214 // blocking signals, signalfd can't handle these
215 if (process->sigActions[K_SIGSEGV].handlerAndSigAction != K_SIG_IGN && process->sigActions[K_SIGSEGV].handlerAndSigAction != K_SIG_DFL) {
216 process->sigActions[K_SIGSEGV].sigInfo[0] = K_SIGFPE;
217 process->sigActions[K_SIGSEGV].sigInfo[1] = error; // always 0?
218 process->sigActions[K_SIGSEGV].sigInfo[2] = code;
219 process->sigActions[K_SIGSEGV].sigInfo[3] = 0; // address
220 process->sigActions[K_SIGSEGV].sigInfo[4] = 16; // trap #, TRAP_x86_ARITHTRAP
221 this->thread->runSignal(K_SIGSEGV, 13, error);
222 } else {
223 CPU* cpu = this;
224 this->walkStack(this->eip.u32, EBP, 2);
225 kpanic_fmt("unhandled exception: code=%d error=%d", code, error);
226 }
227}
228
229void CPU::prepareException(int code, int error) {
230 const KProcessPtr& process = this->thread->process;

Callers

nothing calls this directly

Calls 3

walkStackMethod · 0.95
kpanic_fmtFunction · 0.85
runSignalMethod · 0.80

Tested by

no test coverage detected