|
|
|
@ -37,11 +37,12 @@ enum tdstate {
|
|
|
|
|
|
|
|
|
|
tdstate thumb_translate(u32 addr, u32 instr, u32* ainstr, u32* inst_size);
|
|
|
|
|
|
|
|
|
|
static inline u32 get_thumb_instr(u32 instr, u32 pc) {
|
|
|
|
|
u32 tinstr;
|
|
|
|
|
if ((pc & 0x3) != 0)
|
|
|
|
|
tinstr = instr >> 16;
|
|
|
|
|
else
|
|
|
|
|
tinstr = instr & 0xFFFF;
|
|
|
|
|
return tinstr;
|
|
|
|
|
static inline u32 GetThumbInstruction(u32 instr, u32 address) {
|
|
|
|
|
// Normally you would need to handle instruction endianness,
|
|
|
|
|
// however, it is fixed to little-endian on the MPCore, so
|
|
|
|
|
// there's no need to check for this beforehand.
|
|
|
|
|
if ((address & 0x3) != 0)
|
|
|
|
|
return instr >> 16;
|
|
|
|
|
|
|
|
|
|
return instr & 0xFFFF;
|
|
|
|
|
}
|
|
|
|
|