aboutsummaryrefslogtreecommitdiff
path: root/sim/arm/arminit.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2000-07-04 06:52:30 +0000
committerAlexandre Oliva <aoliva@redhat.com>2000-07-04 06:52:30 +0000
commite063aa3bd8d3712e37a287603d3256282c209def (patch)
tree7e016132f8291cc7f4fdb5f8d129816f2e58495e /sim/arm/arminit.c
parent13b6dd6f68d9eb79f9d3dbe730ec1b6aa9bef737 (diff)
downloadgdb-e063aa3bd8d3712e37a287603d3256282c209def.zip
gdb-e063aa3bd8d3712e37a287603d3256282c209def.tar.gz
gdb-e063aa3bd8d3712e37a287603d3256282c209def.tar.bz2
* armemu.h (INSN_SIZE): New macro.
(SET_ABORT): Save CPSR in SPSR and set LR. * armemu.c (ARMul_Emulate, isize): Set to INSN_SIZE. (WriteR15, WriteSR15): Do not discard bit 1 in Thumb mode. * arminit.c (ARMul_Abort): Use new SETABORT and INSN_SIZE.
Diffstat (limited to 'sim/arm/arminit.c')
-rw-r--r--sim/arm/arminit.c41
1 files changed, 9 insertions, 32 deletions
diff --git a/sim/arm/arminit.c b/sim/arm/arminit.c
index 0105c17..66e6dad 100644
--- a/sim/arm/arminit.c
+++ b/sim/arm/arminit.c
@@ -253,6 +253,7 @@ void
ARMul_Abort (ARMul_State * state, ARMword vector)
{
ARMword temp;
+ int isize = INSN_SIZE;
state->Aborted = FALSE;
@@ -270,53 +271,29 @@ ARMul_Abort (ARMul_State * state, ARMword vector)
switch (vector)
{
case ARMul_ResetV: /* RESET */
- state->Spsr[SVCBANK] = CPSR;
- SETABORT (INTBITS, state->prog32Sig ? SVC32MODE : SVC26MODE);
- ARMul_CPSRAltered (state);
- state->Reg[14] = temp;
+ SETABORT (INTBITS, state->prog32Sig ? SVC32MODE : SVC26MODE, 0);
break;
case ARMul_UndefinedInstrV: /* Undefined Instruction */
- state->Spsr[state->prog32Sig ? UNDEFBANK : SVCBANK] = CPSR;
- SETABORT (IBIT, state->prog32Sig ? UNDEF32MODE : SVC26MODE);
- ARMul_CPSRAltered (state);
- state->Reg[14] = temp - 4;
+ SETABORT (IBIT, state->prog32Sig ? UNDEF32MODE : SVC26MODE, isize);
break;
case ARMul_SWIV: /* Software Interrupt */
- state->Spsr[SVCBANK] = CPSR;
- SETABORT (IBIT, state->prog32Sig ? SVC32MODE : SVC26MODE);
- ARMul_CPSRAltered (state);
- state->Reg[14] = temp - 4;
+ SETABORT (IBIT, state->prog32Sig ? SVC32MODE : SVC26MODE, isize);
break;
case ARMul_PrefetchAbortV: /* Prefetch Abort */
state->AbortAddr = 1;
- state->Spsr[state->prog32Sig ? ABORTBANK : SVCBANK] = CPSR;
- SETABORT (IBIT, state->prog32Sig ? ABORT32MODE : SVC26MODE);
- ARMul_CPSRAltered (state);
- state->Reg[14] = temp - 4;
+ SETABORT (IBIT, state->prog32Sig ? ABORT32MODE : SVC26MODE, isize);
break;
case ARMul_DataAbortV: /* Data Abort */
- state->Spsr[state->prog32Sig ? ABORTBANK : SVCBANK] = CPSR;
- SETABORT (IBIT, state->prog32Sig ? ABORT32MODE : SVC26MODE);
- ARMul_CPSRAltered (state);
- state->Reg[14] = temp - 4; /* the PC must have been incremented */
+ SETABORT (IBIT, state->prog32Sig ? ABORT32MODE : SVC26MODE, isize);
break;
case ARMul_AddrExceptnV: /* Address Exception */
- state->Spsr[SVCBANK] = CPSR;
- SETABORT (IBIT, SVC26MODE);
- ARMul_CPSRAltered (state);
- state->Reg[14] = temp - 4;
+ SETABORT (IBIT, SVC26MODE, isize);
break;
case ARMul_IRQV: /* IRQ */
- state->Spsr[IRQBANK] = CPSR;
- SETABORT (IBIT, state->prog32Sig ? IRQ32MODE : IRQ26MODE);
- ARMul_CPSRAltered (state);
- state->Reg[14] = temp - 4;
+ SETABORT (IBIT, state->prog32Sig ? IRQ32MODE : IRQ26MODE, isize);
break;
case ARMul_FIQV: /* FIQ */
- state->Spsr[FIQBANK] = CPSR;
- SETABORT (INTBITS, state->prog32Sig ? FIQ32MODE : FIQ26MODE);
- ARMul_CPSRAltered (state);
- state->Reg[14] = temp - 4;
+ SETABORT (INTBITS, state->prog32Sig ? FIQ32MODE : FIQ26MODE, isize);
break;
}
if (ARMul_MODE32BIT)