| 541 | |
| 542 | #if defined(BOXEDWINE_JIT) |
| 543 | static void opCallback(U32 address, DecodedOp* op, void* p) { |
| 544 | KMemory* memory = (KMemory*)p; |
| 545 | if (op->blockStart) { |
| 546 | // Normal and JIT cpu's don't need to track eip on an op except for this case, but I don't think it's really worth increasing |
| 547 | // the size of DecodedOp just for this |
| 548 | DecodedOp* nextOp = op->blockStart; |
| 549 | U32 len = 0; |
| 550 | while (nextOp != op) { |
| 551 | len += nextOp->len; |
| 552 | nextOp = nextOp->next; |
| 553 | } |
| 554 | U32 blockAddress = address - len; |
| 555 | memory->removeCodeBlock(blockAddress, op->blockStart, true); |
| 556 | } |
| 557 | } |
| 558 | #endif |
| 559 | void KMemory::removeCode(KThread* thread, U32 address, U32 len, bool becauseOfWrite) { |
| 560 | BOXEDWINE_CRITICAL_SECTION_WITH_MUTEX(mutex) |
nothing calls this directly
no test coverage detected