| 1077 | } |
| 1078 | |
| 1079 | U32 KThread::get_robust_list(U32 pid, U32 head_ptr, U32 len_ptr) { |
| 1080 | KThread* thread; |
| 1081 | if (pid == 0) { |
| 1082 | thread = this; |
| 1083 | } else { |
| 1084 | thread = KSystem::getThreadById(pid); |
| 1085 | if (!thread) { |
| 1086 | return -K_ESRCH; |
| 1087 | } |
| 1088 | } |
| 1089 | if (!memory->canWrite(head_ptr, 4) || !memory->canWrite(len_ptr, 4)) { |
| 1090 | return -K_EFAULT; |
| 1091 | } |
| 1092 | memory->writed(head_ptr, this->robustList); |
| 1093 | memory->writed(len_ptr, 12); |
| 1094 | return 0; |
| 1095 | } |
| 1096 | |
| 1097 | void OPCALL onExitSignal(CPU* cpu, DecodedOp* op) { |
| 1098 | U64 count = cpu->instructionCount; |