Clean up after the block linker. armdis: add BKPT

This commit is contained in:
Henrik Rydgard committed 2014-11-17 21:21:34 +01:00
1 parent e43c7af32c
commit 74d8a9bdba
2 files changed
+17 -6

No files matched your search

+12 -1
View File
@@ -404,8 +404,19 @@ void JitBlockCache::LinkBlockExits(int i) {
int destinationBlock = GetBlockNumberFromStartAddress(b.exitAddress[e]);
if (destinationBlock != -1) {
#if defined(ARM)
const u8 *nextExit = b.exitPtrs[e + 1];
if (!nextExit) {
nextExit = b.normalEntry + b.codeSize;
}
ARMXEmitter emit(b.exitPtrs[e]);
emit.B(blocks_[destinationBlock].checkedEntry);
u32 op = 0;
// Overwrite with nops until the next unconditional branch.
do {
emit.BKPT(1);
op = *((const u32 *)emit.GetCodePtr());
} while ((op & 0xFF000000) != 0xEA000000);
emit.BKPT(1);
emit.FlushIcache();
#elif defined(_M_IX86) || defined(_M_X64)
@@ -609,7 +620,7 @@ void JitBlockCache::InvalidateICache(u32 address, const u32 length) {
int JitBlockCache::GetBlockExitSize() {
#if defined(ARM)
// TODO
// Will depend on the sequence found to encode the destination address.
return 0;
#elif defined(_M_IX86) || defined(_M_X64)
return 15;