| 1252 | // bit 4 - 0 = n/a, 1 = fault was an instruction fetch |
| 1253 | |
| 1254 | void KThread::seg_mapper(U32 address, bool readFault, bool writeFault, bool throwException) { |
| 1255 | if (this->process->sigActions[K_SIGSEGV].handlerAndSigAction!=K_SIG_IGN && this->process->sigActions[K_SIGSEGV].handlerAndSigAction!=K_SIG_DFL) { |
| 1256 | this->process->sigActions[K_SIGSEGV].sigInfo[0] = K_SIGSEGV; |
| 1257 | this->process->sigActions[K_SIGSEGV].sigInfo[1] = 0; |
| 1258 | this->process->sigActions[K_SIGSEGV].sigInfo[2] = 1; // SEGV_MAPERR |
| 1259 | this->process->sigActions[K_SIGSEGV].sigInfo[3] = address; |
| 1260 | this->runSignal(K_SIGSEGV, EXCEPTION_PAGE_FAULT, (writeFault?2:0)); |
| 1261 | if (throwException) { |
| 1262 | throw 2; |
| 1263 | } |
| 1264 | } else { |
| 1265 | this->memory->logPageFault(this, address); |
| 1266 | } |
| 1267 | } |
| 1268 | |
| 1269 | // motorhead demo installer, tomb raider 3 demo will trigger this |
| 1270 | void KThread::seg_access(U32 address, bool readFault, bool writeFault, bool throwException) { |