This is an automated email from Gerrit.

Matthias Welwarsky (matth...@welwarsky.de) just uploaded a new patch set to 
Gerrit, which you can find at http://openocd.zylin.com/3757

-- gerrit

commit de00710761d963694bda78c05a0f73c65d525176
Author: Matthias Welwarsky <matthias.welwar...@sysgo.com>
Date:   Fri Sep 16 15:22:14 2016 +0200

    aarch64: use symbolic constant for register count
    
    Aarch64 has 34 registers, but use ARMV8_LAST_REG instead of
    raw integer constant.
    
    Change-Id: I86481899ade74f27fc90eff9f367d444c03e535e
    Signed-off-by: Matthias Welwarsky <matthias.welwar...@sysgo.com>

diff --git a/src/target/armv8.c b/src/target/armv8.c
index fccb17c..0c72fe9 100644
--- a/src/target/armv8.c
+++ b/src/target/armv8.c
@@ -914,7 +914,7 @@ struct reg *armv8_reg_current(struct arm *arm, unsigned 
regnum)
 {
        struct reg *r;
 
-       if (regnum > 33)
+       if (regnum > (ARMV8_LAST_REG - 1))
                return NULL;
 
        r = arm->core_cache->reg_list + regnum;
@@ -939,14 +939,13 @@ int armv8_get_gdb_reg_list(struct target *target,
        switch (reg_class) {
        case REG_CLASS_GENERAL:
        case REG_CLASS_ALL:
-               *reg_list_size = 34;
+               *reg_list_size = ARMV8_LAST_REG;
                *reg_list = malloc(sizeof(struct reg *) * (*reg_list_size));
 
-               for (i = 0; i < *reg_list_size; i++)
+               for (i = 0; i < ARMV8_LAST_REG; i++)
                                (*reg_list)[i] = armv8_reg_current(arm, i);
 
                return ERROR_OK;
-               break;
 
        default:
                LOG_ERROR("not a valid register class type in query.");

-- 

------------------------------------------------------------------------------
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to