This is an automated email from Gerrit.

Spencer Oliver ([email protected]) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/2053

-- gerrit

commit 830d300f037066736a4e3cf400fcf56a264ed37f
Author: Spencer Oliver <[email protected]>
Date:   Mon Mar 17 14:04:25 2014 +0000

    armv7m: remove magic numbers for number of core registers
    
    Change-Id: I4296b812f0211011ccf3da8d203545dfba493903
    Signed-off-by: Spencer Oliver <[email protected]>

diff --git a/src/target/armv7m.c b/src/target/armv7m.c
index 7716139..2b587e7 100644
--- a/src/target/armv7m.c
+++ b/src/target/armv7m.c
@@ -52,7 +52,7 @@ static char *armv7m_exception_strings[] = {
 };
 
 /* PSP is used in some thread modes */
-const int armv7m_psp_reg_map[17] = {
+const int armv7m_psp_reg_map[ARMV7M_NUM_CORE_REGS] = {
        ARMV7M_R0, ARMV7M_R1, ARMV7M_R2, ARMV7M_R3,
        ARMV7M_R4, ARMV7M_R5, ARMV7M_R6, ARMV7M_R7,
        ARMV7M_R8, ARMV7M_R9, ARMV7M_R10, ARMV7M_R11,
@@ -61,7 +61,7 @@ const int armv7m_psp_reg_map[17] = {
 };
 
 /* MSP is used in handler and some thread modes */
-const int armv7m_msp_reg_map[17] = {
+const int armv7m_msp_reg_map[ARMV7M_NUM_CORE_REGS] = {
        ARMV7M_R0, ARMV7M_R1, ARMV7M_R2, ARMV7M_R3,
        ARMV7M_R4, ARMV7M_R5, ARMV7M_R6, ARMV7M_R7,
        ARMV7M_R8, ARMV7M_R9, ARMV7M_R10, ARMV7M_R11,
@@ -252,7 +252,7 @@ int armv7m_get_gdb_reg_list(struct target *target, struct 
reg **reg_list[],
        if (reg_class == REG_CLASS_ALL)
                *reg_list_size = ARMV7M_NUM_REGS;
        else
-               *reg_list_size = 17;
+               *reg_list_size = ARMV7M_NUM_CORE_REGS;
 
        *reg_list = malloc(sizeof(struct reg *) * (*reg_list_size));
        if (*reg_list == NULL)
diff --git a/src/target/armv7m.h b/src/target/armv7m.h
index 92bada0..575912f 100644
--- a/src/target/armv7m.h
+++ b/src/target/armv7m.h
@@ -135,6 +135,8 @@ enum {
        FPv4_SP,
 };
 
+#define ARMV7M_NUM_CORE_REGS (ARMV7M_xPSR + 1)
+
 #define ARMV7M_COMMON_MAGIC 0x2A452A45
 
 struct armv7m_common {

-- 

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to