diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2000-07-04 06:19:29 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@redhat.com> | 2000-07-04 06:19:29 +0000 |
commit | cf52c765b09c13868d5cc5a8eb0297854be660d5 (patch) | |
tree | 00d14d325741ffd2f05ff67a9360b6df05f9c583 /sim/arm/armsupp.c | |
parent | 4ef2594f4ed0fe4191d9e791e84b6241f968fc7c (diff) | |
download | gdb-cf52c765b09c13868d5cc5a8eb0297854be660d5.zip gdb-cf52c765b09c13868d5cc5a8eb0297854be660d5.tar.gz gdb-cf52c765b09c13868d5cc5a8eb0297854be660d5.tar.bz2 |
* armemu.h (GETSPSR): Call ARMul_GetSPSR().
* armsupp.c (ARMul_CPSRAltered): Zero out bits as they're
extracted from state->Cpsr, but preserve the unused bits.
(ARMul_GetCPSR): Get bits preserved in state->Cpsr.
(ARMul_GetSPSR, ARMul_FixCPSR): Use ARMul_GetCPSR() to
get the full CPSR word.
Diffstat (limited to 'sim/arm/armsupp.c')
-rw-r--r-- | sim/arm/armsupp.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sim/arm/armsupp.c b/sim/arm/armsupp.c index 6930529..27ee35b 100644 --- a/sim/arm/armsupp.c +++ b/sim/arm/armsupp.c @@ -183,7 +183,7 @@ ARMul_SetR15 (ARMul_State * state, ARMword value) ARMword ARMul_GetCPSR (ARMul_State * state) { - return (CPSR); + return (CPSR | state->Cpsr); } /***************************************************************************\ @@ -205,7 +205,7 @@ ARMul_SetCPSR (ARMul_State * state, ARMword value) void ARMul_FixCPSR (ARMul_State * state, ARMword instr, ARMword rhs) { - state->Cpsr = CPSR; + state->Cpsr = ARMul_GetCPSR (state); if (state->Bank != USERBANK) { /* In user mode, only write flags */ if (BIT (16)) @@ -230,7 +230,7 @@ ARMul_GetSPSR (ARMul_State * state, ARMword mode) ARMword bank = ModeToBank (mode & MODEBITS); if (! BANK_CAN_ACCESS_SPSR (bank)) - return CPSR; + return ARMul_GetCPSR (state); return state->Spsr[bank]; } @@ -290,14 +290,21 @@ ARMul_CPSRAltered (ARMul_State * state) state->NtransSig = (state->Mode & 3) ? HIGH : LOW; } + state->Cpsr &= ~MODEBITS; ASSIGNINT (state->Cpsr & INTBITS); + state->Cpsr &= ~INTBITS; ASSIGNN ((state->Cpsr & NBIT) != 0); + state->Cpsr &= ~NBIT; ASSIGNZ ((state->Cpsr & ZBIT) != 0); + state->Cpsr &= ~ZBIT; ASSIGNC ((state->Cpsr & CBIT) != 0); + state->Cpsr &= ~CBIT; ASSIGNV ((state->Cpsr & VBIT) != 0); + state->Cpsr &= ~VBIT; #ifdef MODET ASSIGNT ((state->Cpsr & TBIT) != 0); + state->Cpsr &= ~TBIT; #endif if (oldmode > SVC26MODE) |