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

Function signalHandler

platform/linux/platformThreads-armv8.cpp:168–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168void signalHandler(CPU* cpu) {
169 void* result = cpu->startException(cpu->exceptionAddress, cpu->exceptionReadAddress);
170 if (result) {
171 cpu->returnHostAddress = result;
172 return;
173 }
174 InException e(cpu);
175
176 if (cpu->exceptionSigNo == SIGSEGV || cpu->exceptionSigNo == SIGBUS || cpu->exceptionSigNo == SIGILL) {
177 BOXEDWINE_CRITICAL_SECTION_WITH_MUTEX(cpu->memory->mutex); // jitCache needs this
178 U32 eip = 0;
179 if (!getMemData(cpu->memory)->findOpFromJitAddress((U8*)cpu->exceptionIp, eip)) {
180 klog("probably about to crash, could not find emulation instruction that caused exception");
181 cpu->returnHostAddress = cpu->thread->process->blockExit;
182 } else {
183 cpu->eip.u32 = eip;
184 DecodedOp* op = cpu->getNextOp();
185 void* result = cpu->handleAccessException(op);
186 if (cpu->nextOp->pfnJitCode) {
187 cpu->returnHostAddress = cpu->nextOp->pfnJitCode;
188 } else {
189 cpu->returnHostAddress = result;
190 }
191 }
192 return;
193 }
194 kpanic_fmt("unhandled exception %d", cpu->exceptionSigNo);
195}
196
197#endif

Callers

nothing calls this directly

Calls 7

getMemDataFunction · 0.85
klogFunction · 0.85
kpanic_fmtFunction · 0.85
startExceptionMethod · 0.80
findOpFromJitAddressMethod · 0.80
getNextOpMethod · 0.80
handleAccessExceptionMethod · 0.80

Tested by

no test coverage detected