aarch64: use symbolic constant for register count 57/3757/5
authorMatthias Welwarsky <matthias.welwarsky@sysgo.com>
Fri, 16 Sep 2016 13:22:14 +0000 (15:22 +0200)
committerMatthias Welwarsky <matthias.welwarsky@sysgo.com>
Fri, 10 Feb 2017 13:01:39 +0000 (14:01 +0100)
Aarch64 has 34 registers, but use ARMV8_LAST_REG instead of
raw integer constant.

Change-Id: I86481899ade74f27fc90eff9f367d444c03e535e
Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
src/target/armv8.c

index f7c6e31c543b419f9d1945d9b17dc7026fb82575..06000c1ebb45a65ab57a695f38faaa50b1856f10 100644 (file)
@@ -908,7 +908,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;
@@ -933,14 +933,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.");

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)