From ff810723e051ed1f86cffcb565ade6b4d1fc50c8 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Sun, 22 Nov 2009 03:38:34 -0800 Subject: ARM: define two register utilities Define arm_reg_current() ... returning handle to a given register, and encapsulating the current mode's register shadowing. It's got one current use, for reporting the current register set to GDB. This will let later patches clean up much ARMV4_5_CORE_REG_MODE() nastiness, saving a bit of code. Define and use arm_set_cpsr() ... initially it updates the cached CPSR and sets up state used by arm_reg_current(), plus any SPSR handle. (Later: can also set up for T and J bits.) Signed-off-by: David Brownell --- src/target/cortex_a8.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/target/cortex_a8.c') diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index 24632099..71de3b79 100644 --- a/src/target/cortex_a8.c +++ b/src/target/cortex_a8.c @@ -648,7 +648,7 @@ static int cortex_a8_debug_entry(struct target *target) dap_ap_select(swjdp, swjdp_debugap); LOG_DEBUG("cpsr: %8.8" PRIx32, cpsr); - armv4_5->core_mode = cpsr & 0x1F; + arm_set_cpsr(armv4_5, cpsr); i = (cpsr >> 5) & 1; /* T */ i |= (cpsr >> 23) & 1; /* J << 1 */ @@ -674,11 +674,6 @@ static int cortex_a8_debug_entry(struct target *target) } /* update cache */ - reg = armv4_5->cpsr; - buf_set_u32(reg->value, 0, 32, cpsr); - reg->valid = 1; - reg->dirty = 0; - for (i = 0; i <= ARM_PC; i++) { reg = &ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, -- cgit v1.2.3-18-g5258