Fix ldrt/sdrt handling.

This commit is contained in:
TuxSH
2016-12-22 23:11:15 +01:00
parent f89845257e
commit 0ba7630354
6 changed files with 45 additions and 20 deletions

View File

@@ -67,7 +67,7 @@ void __attribute__((noreturn)) mainHandler(u32 *regs, u32 type, u32 cpuId)
//Dump registers
//Current order of saved regs: dfsr, ifsr, far, fpexc, fpinst, fpinst2, cpsr, pc, r8-r12, sp, lr, r0-r7
u32 cpsr = regs[6];
u32 pc = regs[7] - (type < 3 ? (((cpsr & 0x20) != 0 && type == 1) ? 2 : 4) : 8);
u32 pc = regs[7] - (type < 3 ? (((cpsr & 0x20) != 0 && type == 1) ? 2 : 4) : 0);
registerDump[15] = pc;
registerDump[16] = cpsr;
@@ -106,4 +106,4 @@ void __attribute__((noreturn)) mainHandler(u32 *regs, u32 type, u32 cpuId)
cleanInvalidateDCacheAndDMB();
mcuReboot(); //Also contains DCache-cleaning code
}
}