are being executed: */
ARMword isize;
-#ifdef MODE32
ARMword
+#ifdef MODE32
ARMul_Emulate32 (register ARMul_State * state)
-{
#else
-ARMword
ARMul_Emulate26 (register ARMul_State * state)
-{
#endif
+{
register ARMword instr, /* the current instruction */
dest = 0, /* almost the DestBus */
temp, /* ubiquitous third hand */
if (! SWI_vector_installed)
ARMul_OSHandleSWI (state, SWI_Breakpoint);
else
-
- /* BKPT - normally this will cause an abort, but for the
- XScale if bit 31 in register 10 of coprocessor 14 is
- clear, then this is treated as a no-op. */
- if (state->is_XScale)
- {
- if (read_cp14_reg (10) & (1UL << 31))
- {
- ARMword value;
-
- value = read_cp14_reg (10);
- value &= ~0x1c;
- value |= 0xc;
-
- write_cp14_reg (10, value);
- write_cp15_reg (5, 0, 0, 0x200); /* Set FSR. */
- write_cp15_reg (6, 0, 0, pc); /* Set FAR. */
- }
- else
- break;
- }
+ {
+ /* BKPT - normally this will cause an abort, but for the
+ XScale if bit 31 in register 10 of coprocessor 14 is
+ clear, then this is treated as a no-op. */
+ if (state->is_XScale)
+ {
+ if (read_cp14_reg (10) & (1UL << 31))
+ {
+ ARMword value;
+
+ value = read_cp14_reg (10);
+ value &= ~0x1c;
+ value |= 0xc;
+
+ write_cp14_reg (10, value);
+ write_cp15_reg (5, 0, 0, 0x200); /* Set FSR. */
+ write_cp15_reg (6, 0, 0, pc); /* Set FAR. */
+ }
+ else
+ break;
+ }
+ }
ARMul_Abort (state, ARMul_PrefetchAbortV);
break;
case 0xfe:
case 0xff:
if (instr == ARMul_ABORTWORD && state->AbortAddr == pc)
- { /* a prefetch abort */
+ {
+ /* A prefetch abort. */
ARMul_Abort (state, ARMul_PrefetchAbortV);
break;
}
if (!state->abortSig && !state->Aborted)
state->Reg[temp++] = dest;
else if (!state->Aborted)
- state->Aborted = ARMul_DataAbortV;
+ {
+ state->Aborted = ARMul_DataAbortV;
+ }
for (; temp < 16; temp++) /* S cycles from here on */
if (BIT (temp))
if (!state->abortSig && !state->Aborted)
state->Reg[temp] = dest;
else if (!state->Aborted)
- state->Aborted = ARMul_DataAbortV;
+ {
+ state->Aborted = ARMul_DataAbortV;
+ }
}
if (BIT (15) && !state->Aborted)
\***************************************************************************/
static void
-LoadSMult (ARMul_State * state, ARMword instr,
- ARMword address, ARMword WBBase)
+LoadSMult (ARMul_State * state,
+ ARMword instr,
+ ARMword address,
+ ARMword WBBase)
{
ARMword dest, temp;
if (!state->abortSig)
state->Reg[temp++] = dest;
else if (!state->Aborted)
- state->Aborted = ARMul_DataAbortV;
+ {
+ state->Aborted = ARMul_DataAbortV;
+ }
for (; temp < 16; temp++)
/* S cycles from here on. */
if (!state->abortSig && !state->Aborted)
state->Reg[temp] = dest;
else if (!state->Aborted)
- state->Aborted = ARMul_DataAbortV;
+ {
+ state->Aborted = ARMul_DataAbortV;
+ }
}
if (BIT (15) && !state->Aborted)
}
else
ARMul_R15Altered (state);
+
FLUSHPIPE;
#endif
}
{
if (BIT (21) && LHSReg != 15)
LSBase = WBBase;
+
TAKEABORT;
}
}
else
ARMul_StoreWordN (state, address, state->Reg[temp++]);
#endif
+
if (state->abortSig && !state->Aborted)
- state->Aborted = ARMul_DataAbortV;
+ {
+ state->Aborted = ARMul_DataAbortV;
+ }
if (BIT (21) && LHSReg != 15)
LSBase = WBBase;
if (BIT (temp))
{ /* save this register */
address += 4;
+
ARMul_StoreWordS (state, address, state->Reg[temp]);
+
if (state->abortSig && !state->Aborted)
- state->Aborted = ARMul_DataAbortV;
+ {
+ state->Aborted = ARMul_DataAbortV;
+ }
}
+
if (state->Aborted)
{
TAKEABORT;
\***************************************************************************/
static void
-StoreSMult (
- ARMul_State * state,
+StoreSMult (ARMul_State * state,
ARMword instr,
ARMword address,
ARMword WBBase)
{
/* Save this register. */
address += 4;
+
(void) ARMul_LoadWordS (state, address);
}
-
+
if (BIT (21) && LHSReg != 15)
LSBase = WBBase;
#endif
if (state->abortSig && !state->Aborted)
- state->Aborted = ARMul_DataAbortV;
+ {
+ state->Aborted = ARMul_DataAbortV;
+ }
for (; temp < 16; temp++)
/* S cycles from here on. */
ARMul_StoreWordS (state, address, state->Reg[temp]);
if (state->abortSig && !state->Aborted)
- state->Aborted = ARMul_DataAbortV;
+ {
+ state->Aborted = ARMul_DataAbortV;
+ }
}
if (state->Mode != USER26MODE && state->Mode != USER32MODE)