| 688 | } |
| 689 | |
| 690 | void KThread::signalTrap(U32 code) { |
| 691 | KSigAction* action = &this->process->sigActions[K_SIGTRAP]; |
| 692 | if (action->handlerAndSigAction == K_SIG_DFL) { |
| 693 | DecodedOp* op = cpu->getNextOp(); |
| 694 | kpanic_fmt("%s tid=%04X eip=%08X Illegal instruction but no signal handler set up for it: %s (%X)", process->name.c_str(), cpu->thread->id, cpu->eip.u32, op->name(), op->inst); |
| 695 | } |
| 696 | memset(this->process->sigActions[K_SIGTRAP].sigInfo, 0, sizeof(this->process->sigActions[K_SIGTRAP].sigInfo)); |
| 697 | this->process->sigActions[K_SIGTRAP].sigInfo[0] = K_SIGTRAP; |
| 698 | this->process->sigActions[K_SIGTRAP].sigInfo[2] = code; |
| 699 | this->process->sigActions[K_SIGTRAP].sigInfo[3] = cpu->eip.u32; |
| 700 | this->runSignal(K_SIGTRAP, 3, 0); |
| 701 | } |
| 702 | |
| 703 | void KThread::signalIllegalInstruction(int code) { |
| 704 | KSigAction* action = &this->process->sigActions[K_SIGILL]; |
no test coverage detected