| 209 | } |
| 210 | |
| 211 | void 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 | |
| 229 | void CPU::prepareException(int code, int error) { |
| 230 | const KProcessPtr& process = this->thread->process; |
nothing calls this directly
no test coverage detected