| 8643 | } |
| 8644 | |
| 8645 | void writeBlockWithEipCount(struct GenData* data, struct Block* block, S32 eipCount) { |
| 8646 | char tmp[16]; |
| 8647 | U32 i; |
| 8648 | struct Op* op; |
| 8649 | |
| 8650 | if (block->ops->func == restoreOps) { |
| 8651 | decodeBlockWithBlock(data->cpu, data->eip, block); |
| 8652 | } |
| 8653 | op = block->ops; |
| 8654 | if (op->func == firstOp) { |
| 8655 | op = op->next; |
| 8656 | } |
| 8657 | |
| 8658 | jit(data->cpu, block, data->eip); |
| 8659 | while (op && eipCount>0) { |
| 8660 | for (i=0;i<data->indent;i++) { |
| 8661 | out(data, " "); |
| 8662 | } |
| 8663 | srcgen[op->inst](data, op); |
| 8664 | // the last op is responsible for handling the eip adjustment |
| 8665 | if (op->next && op->eipCount) { |
| 8666 | out(data, " cpu->eip.u32+="); |
| 8667 | itoa(op->eipCount, tmp, 10); |
| 8668 | out(data, tmp); |
| 8669 | out(data, ";\n"); |
| 8670 | } |
| 8671 | eipCount-=op->eipCount; |
| 8672 | op = op->next; |
| 8673 | } |
| 8674 | if (eipCount!=0) |
| 8675 | kpanic("writeBlockWithEipCount error"); |
| 8676 | } |
| 8677 | |
| 8678 | U32 writeFunction(struct GenData* data, struct Op* op) { |
| 8679 | return 0; |