command_handler: change to 'argc' to CMD_ARGC
[openocd.git] / src / target / armv7m.c
index 3b01fa9abe0fd14365d18215f2756a733f967132..e9d46dfd1e27792fea46b14134436a95d8b5c4e3 100644 (file)
@@ -72,7 +72,6 @@ static struct reg armv7m_gdb_dummy_fp_reg =
        .valid = 1,
        .size = 96,
        .arch_info = NULL,
-       .arch_type = 0,
 };
 
 static uint8_t armv7m_gdb_dummy_fps_value[4];
@@ -85,7 +84,6 @@ static struct reg armv7m_gdb_dummy_fps_reg =
        .valid = 1,
        .size = 32,
        .arch_info = NULL,
-       .arch_type = 0,
 };
 
 #ifdef ARMV7_GDB_HACKS
@@ -99,7 +97,6 @@ struct reg armv7m_gdb_dummy_cpsr_reg =
        .valid = 1,
        .size = 32,
        .arch_info = NULL,
-       .arch_type = 0,
 };
 #endif
 
@@ -148,8 +145,6 @@ static const struct {
 
 #define ARMV7M_NUM_REGS        ARRAY_SIZE(armv7m_regs)
 
-static int armv7m_core_reg_arch_type = -1;
-
 /**
  * Restores target context using the cache of core registers set up
  * by armv7m_build_reg_cache(), calling optional core-specific hooks.
@@ -542,6 +537,10 @@ int armv7m_arch_state(struct target *target)
 
        return ERROR_OK;
 }
+static const struct reg_arch_type armv7m_reg_type = {
+       .get = armv7m_get_core_reg,
+       .set = armv7m_set_core_reg,
+};
 
 /** Builds cache of architecturally defined registers.  */
 struct reg_cache *armv7m_build_reg_cache(struct target *target)
@@ -554,11 +553,6 @@ struct reg_cache *armv7m_build_reg_cache(struct target *target)
        struct armv7m_core_reg *arch_info = calloc(num_regs, sizeof(struct armv7m_core_reg));
        int i;
 
-       if (armv7m_core_reg_arch_type == -1)
-       {
-               armv7m_core_reg_arch_type = register_reg_arch_type(armv7m_get_core_reg, armv7m_set_core_reg);
-       }
-
        register_init_dummy(&armv7m_gdb_dummy_fps_reg);
 #ifdef ARMV7_GDB_HACKS
        register_init_dummy(&armv7m_gdb_dummy_cpsr_reg);
@@ -583,7 +577,7 @@ struct reg_cache *armv7m_build_reg_cache(struct target *target)
                reg_list[i].value = calloc(1, 4);
                reg_list[i].dirty = 0;
                reg_list[i].valid = 0;
-               reg_list[i].arch_type = armv7m_core_reg_arch_type;
+               reg_list[i].type = &armv7m_reg_type;
                reg_list[i].arch_info = &arch_info[i];
        }
 
@@ -772,7 +766,7 @@ COMMAND_HANDLER(handle_dap_baseaddr_command)
        int retval;
 
        apselsave = swjdp->apsel;
-       switch (argc) {
+       switch (CMD_ARGC) {
        case 0:
                apsel = swjdp->apsel;
                break;
@@ -835,7 +829,7 @@ COMMAND_HANDLER(handle_dap_info_command)
        struct swjdp_common *swjdp = &armv7m->swjdp_info;
        uint32_t apsel;
 
-       switch (argc) {
+       switch (CMD_ARGC) {
        case 0:
                apsel = swjdp->apsel;
                break;

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)