command_handler: change 'args' to CMD_ARGV
authorZachary T Welch <zw@superlucidity.net>
Sun, 15 Nov 2009 16:15:59 +0000 (08:15 -0800)
committerZachary T Welch <zw@superlucidity.net>
Tue, 17 Nov 2009 19:38:07 +0000 (11:38 -0800)
This patch converts all instances of 'args' in COMMAND_HANDLER routines
to use CMD_ARGV macro.

63 files changed:
src/flash/at91sam3.c
src/flash/at91sam7.c
src/flash/cfi.c
src/flash/davinci_nand.c
src/flash/ecos.c
src/flash/faux.c
src/flash/flash.c
src/flash/flash.h
src/flash/lpc2000.c
src/flash/lpc288x.c
src/flash/lpc2900.c
src/flash/lpc3180_nand_controller.c
src/flash/mflash.c
src/flash/mx3_nand.c
src/flash/nand.c
src/flash/orion_nand.c
src/flash/pic32mx.c
src/flash/s3c24xx_nand.c
src/flash/stm32x.c
src/flash/str7x.c
src/flash/str9x.c
src/flash/str9xpec.c
src/flash/tms470.c
src/hello.c
src/helper/command.c
src/helper/ioutil.c
src/helper/log.c
src/jtag/amt_jtagaccel.c
src/jtag/at91rm9200.c
src/jtag/ft2232.c
src/jtag/gw16012.c
src/jtag/jlink.c
src/jtag/parport.c
src/jtag/presto.c
src/jtag/tcl.c
src/jtag/vsllink.c
src/pld/pld.c
src/pld/virtex2.c
src/server/gdb_server.c
src/server/httpd.c
src/server/server.c
src/svf/svf.c
src/target/arm11.c
src/target/arm720t.c
src/target/arm7_9_common.c
src/target/arm920t.c
src/target/arm926ejs.c
src/target/arm966e.c
src/target/arm9tdmi.c
src/target/arm_adi_v5.c
src/target/armv4_5.c
src/target/armv7a.c
src/target/armv7m.c
src/target/cortex_m3.c
src/target/etb.c
src/target/etm.c
src/target/etm_dummy.c
src/target/oocd_trace.c
src/target/target.c
src/target/target_request.c
src/target/trace.c
src/target/xscale.c
src/xsvf/xsvf.c

index 54e60bff1de76b63646a406c5bfba1ea1917d9e1..4cf4d2091836ebe90574e8bb4789e3168868b9a1 100644 (file)
@@ -2378,17 +2378,17 @@ COMMAND_HANDLER(sam3_handle_gpnvm_command)
                who = -1;
                break;
        case 2:
                who = -1;
                break;
        case 2:
-               if ((0 == strcmp(args[0], "show")) && (0 == strcmp(args[1], "all"))) {
+               if ((0 == strcmp(CMD_ARGV[0], "show")) && (0 == strcmp(CMD_ARGV[1], "all"))) {
                        who = -1;
                } else {
                        uint32_t v32;
                        who = -1;
                } else {
                        uint32_t v32;
-                       COMMAND_PARSE_NUMBER(u32, args[1], v32);
+                       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], v32);
                        who = v32;
                }
                break;
        }
 
                        who = v32;
                }
                break;
        }
 
-       if (0 == strcmp("show", args[0])) {
+       if (0 == strcmp("show", CMD_ARGV[0])) {
                if (who == -1) {
                showall:
                        r = ERROR_OK;
                if (who == -1) {
                showall:
                        r = ERROR_OK;
@@ -2416,13 +2416,13 @@ COMMAND_HANDLER(sam3_handle_gpnvm_command)
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
-       if (0 == strcmp("set", args[0])) {
+       if (0 == strcmp("set", CMD_ARGV[0])) {
                r = FLASHD_SetGPNVM(&(pChip->details.bank[0]), who);
                r = FLASHD_SetGPNVM(&(pChip->details.bank[0]), who);
-       } else if ((0 == strcmp("clr", args[0])) ||
-                          (0 == strcmp("clear", args[0]))) { // quietly accept both
+       } else if ((0 == strcmp("clr", CMD_ARGV[0])) ||
+                          (0 == strcmp("clear", CMD_ARGV[0]))) { // quietly accept both
                r = FLASHD_ClrGPNVM(&(pChip->details.bank[0]), who);
        } else {
                r = FLASHD_ClrGPNVM(&(pChip->details.bank[0]), who);
        } else {
-               command_print(cmd_ctx, "Unkown command: %s", args[0]);
+               command_print(cmd_ctx, "Unkown command: %s", CMD_ARGV[0]);
                r = ERROR_COMMAND_SYNTAX_ERROR;
        }
        return r;
                r = ERROR_COMMAND_SYNTAX_ERROR;
        }
        return r;
@@ -2446,7 +2446,7 @@ COMMAND_HANDLER(sam3_handle_slowclk_command)
        {
                // set
                uint32_t v;
        {
                // set
                uint32_t v;
-               COMMAND_PARSE_NUMBER(u32, args[0], v);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], v);
                if (v > 200000) {
                        // absurd slow clock of 200Khz?
                        command_print(cmd_ctx,"Absurd/illegal slow clock freq: %d\n", (int)(v));
                if (v > 200000) {
                        // absurd slow clock of 200Khz?
                        command_print(cmd_ctx,"Absurd/illegal slow clock freq: %d\n", (int)(v));
index 193bfd3598cf409505e1a792f07b2a7e62c7308b..d23d2b02149e5596946529e46226d9f6404c325c 100644 (file)
@@ -749,20 +749,20 @@ FLASH_BANK_COMMAND_HANDLER(at91sam7_flash_bank_command)
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
-       COMMAND_PARSE_NUMBER(u32, args[1], base_address);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], base_address);
 
 
-       COMMAND_PARSE_NUMBER(int, args[3], chip_width);
-       COMMAND_PARSE_NUMBER(int, args[4], bus_width);
+       COMMAND_PARSE_NUMBER(int, CMD_ARGV[3], chip_width);
+       COMMAND_PARSE_NUMBER(int, CMD_ARGV[4], bus_width);
 
 
-       COMMAND_PARSE_NUMBER(int, args[8], banks_num);
-       COMMAND_PARSE_NUMBER(int, args[9], num_sectors);
-       COMMAND_PARSE_NUMBER(u16, args[10], pages_per_sector);
-       COMMAND_PARSE_NUMBER(u16, args[11], page_size);
-       COMMAND_PARSE_NUMBER(u16, args[12], num_nvmbits);
+       COMMAND_PARSE_NUMBER(int, CMD_ARGV[8], banks_num);
+       COMMAND_PARSE_NUMBER(int, CMD_ARGV[9], num_sectors);
+       COMMAND_PARSE_NUMBER(u16, CMD_ARGV[10], pages_per_sector);
+       COMMAND_PARSE_NUMBER(u16, CMD_ARGV[11], page_size);
+       COMMAND_PARSE_NUMBER(u16, CMD_ARGV[12], num_nvmbits);
 
        if (CMD_ARGC == 14) {
                unsigned long freq;
 
        if (CMD_ARGC == 14) {
                unsigned long freq;
-               COMMAND_PARSE_NUMBER(ulong, args[13], freq);
+               COMMAND_PARSE_NUMBER(ulong, CMD_ARGV[13], freq);
                ext_freq = freq * 1000;
                at91sam7_info->ext_freq = ext_freq;
        }
                ext_freq = freq * 1000;
                at91sam7_info->ext_freq = ext_freq;
        }
@@ -774,8 +774,8 @@ FLASH_BANK_COMMAND_HANDLER(at91sam7_flash_bank_command)
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
-       target_name = calloc(strlen(args[7]) + 1, sizeof(char));
-       strcpy(target_name, args[7]);
+       target_name = calloc(strlen(CMD_ARGV[7]) + 1, sizeof(char));
+       strcpy(target_name, CMD_ARGV[7]);
 
        /* calculate bank size  */
        bank_size = num_sectors * pages_per_sector * page_size;
 
        /* calculate bank size  */
        bank_size = num_sectors * pages_per_sector * page_size;
@@ -1120,7 +1120,7 @@ COMMAND_HANDLER(at91sam7_handle_gpnvm_command)
        }
        if (strcmp(bank->driver->name, "at91sam7"))
        {
        }
        if (strcmp(bank->driver->name, "at91sam7"))
        {
-               command_print(cmd_ctx, "not an at91sam7 flash bank '%s'", args[0]);
+               command_print(cmd_ctx, "not an at91sam7 flash bank '%s'", CMD_ARGV[0]);
                return ERROR_FLASH_BANK_INVALID;
        }
        if (bank->target->state != TARGET_HALTED)
                return ERROR_FLASH_BANK_INVALID;
        }
        if (bank->target->state != TARGET_HALTED)
@@ -1129,11 +1129,11 @@ COMMAND_HANDLER(at91sam7_handle_gpnvm_command)
                return ERROR_TARGET_NOT_HALTED;
        }
 
                return ERROR_TARGET_NOT_HALTED;
        }
 
-       if (strcmp(args[1], "set") == 0)
+       if (strcmp(CMD_ARGV[1], "set") == 0)
        {
                flashcmd = SGPB;
        }
        {
                flashcmd = SGPB;
        }
-       else if (strcmp(args[1], "clear") == 0)
+       else if (strcmp(CMD_ARGV[1], "clear") == 0)
        {
                flashcmd = CGPB;
        }
        {
                flashcmd = CGPB;
        }
@@ -1152,10 +1152,10 @@ COMMAND_HANDLER(at91sam7_handle_gpnvm_command)
                }
        }
 
                }
        }
 
-       COMMAND_PARSE_NUMBER(int, args[0], bit);
+       COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], bit);
        if ((bit < 0) || (bit >= at91sam7_info->num_nvmbits))
        {
        if ((bit < 0) || (bit >= at91sam7_info->num_nvmbits))
        {
-               command_print(cmd_ctx, "gpnvm bit '#%s' is out of bounds for target %s", args[0], at91sam7_info->target_name);
+               command_print(cmd_ctx, "gpnvm bit '#%s' is out of bounds for target %s", CMD_ARGV[0], at91sam7_info->target_name);
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
index c68fb73851f28f47e3db0a185dcc4428bdafb98d..59c9c6c9f8fa6e7a7a332499aad5a310f346dbcb 100644 (file)
@@ -613,8 +613,8 @@ FLASH_BANK_COMMAND_HANDLER(cfi_flash_bank_command)
        }
 
        uint16_t chip_width, bus_width;
        }
 
        uint16_t chip_width, bus_width;
-       COMMAND_PARSE_NUMBER(u16, args[3], bus_width);
-       COMMAND_PARSE_NUMBER(u16, args[4], chip_width);
+       COMMAND_PARSE_NUMBER(u16, CMD_ARGV[3], bus_width);
+       COMMAND_PARSE_NUMBER(u16, CMD_ARGV[4], chip_width);
 
        if ((chip_width > CFI_MAX_CHIP_WIDTH)
                        || (bus_width > CFI_MAX_BUS_WIDTH))
 
        if ((chip_width > CFI_MAX_CHIP_WIDTH)
                        || (bus_width > CFI_MAX_BUS_WIDTH))
@@ -635,11 +635,11 @@ FLASH_BANK_COMMAND_HANDLER(cfi_flash_bank_command)
 
        for (unsigned i = 6; i < CMD_ARGC; i++)
        {
 
        for (unsigned i = 6; i < CMD_ARGC; i++)
        {
-               if (strcmp(args[i], "x16_as_x8") == 0)
+               if (strcmp(CMD_ARGV[i], "x16_as_x8") == 0)
                {
                        cfi_info->x16_as_x8 = 1;
                }
                {
                        cfi_info->x16_as_x8 = 1;
                }
-               else if (strcmp(args[i], "jedec_probe") == 0)
+               else if (strcmp(CMD_ARGV[i], "jedec_probe") == 0)
                {
                        cfi_info->jedec_probe = 1;
                }
                {
                        cfi_info->jedec_probe = 1;
                }
index 7c68be709c5d33f2758ab705c4ffb93f15bdc800..ebd9ba8dde5495a464b0ca4033d12934ab3d9236 100644 (file)
@@ -648,36 +648,36 @@ NAND_DEVICE_COMMAND_HANDLER(davinci_nand_device_command)
        if (CMD_ARGC < 5) {
                LOG_ERROR("parameters: %s target "
                                "chip_addr hwecc_mode aemif_addr",
        if (CMD_ARGC < 5) {
                LOG_ERROR("parameters: %s target "
                                "chip_addr hwecc_mode aemif_addr",
-                               args[0]);
+                               CMD_ARGV[0]);
                goto fail;
        }
 
                goto fail;
        }
 
-       target = get_target(args[1]);
+       target = get_target(CMD_ARGV[1]);
        if (!target) {
        if (!target) {
-               LOG_ERROR("invalid target %s", args[1]);
+               LOG_ERROR("invalid target %s", CMD_ARGV[1]);
                goto fail;
        }
 
                goto fail;
        }
 
-       COMMAND_PARSE_NUMBER(ulong, args[2], chip);
+       COMMAND_PARSE_NUMBER(ulong, CMD_ARGV[2], chip);
        if (chip == 0) {
        if (chip == 0) {
-               LOG_ERROR("Invalid NAND chip address %s", args[2]);
+               LOG_ERROR("Invalid NAND chip address %s", CMD_ARGV[2]);
                goto fail;
        }
 
                goto fail;
        }
 
-       if (strcmp(args[3], "hwecc1") == 0)
+       if (strcmp(CMD_ARGV[3], "hwecc1") == 0)
                eccmode = HWECC1;
                eccmode = HWECC1;
-       else if (strcmp(args[3], "hwecc4") == 0)
+       else if (strcmp(CMD_ARGV[3], "hwecc4") == 0)
                eccmode = HWECC4;
                eccmode = HWECC4;
-       else if (strcmp(args[3], "hwecc4_infix") == 0)
+       else if (strcmp(CMD_ARGV[3], "hwecc4_infix") == 0)
                eccmode = HWECC4_INFIX;
        else {
                eccmode = HWECC4_INFIX;
        else {
-               LOG_ERROR("Invalid ecc mode %s", args[3]);
+               LOG_ERROR("Invalid ecc mode %s", CMD_ARGV[3]);
                goto fail;
        }
 
                goto fail;
        }
 
-       COMMAND_PARSE_NUMBER(ulong, args[4], aemif);
+       COMMAND_PARSE_NUMBER(ulong, CMD_ARGV[4], aemif);
        if (aemif == 0) {
        if (aemif == 0) {
-               LOG_ERROR("Invalid AEMIF controller address %s", args[4]);
+               LOG_ERROR("Invalid AEMIF controller address %s", CMD_ARGV[4]);
                goto fail;
        }
 
                goto fail;
        }
 
index 8d2d3eecf4754c2e46e9e1bbe382914e12cb4237..863c12b28304204c17e7e05673344c0c9efd745d 100644 (file)
@@ -122,7 +122,7 @@ FLASH_BANK_COMMAND_HANDLER(ecosflash_flash_bank_command)
                exit(-1);
        }
        bank->driver_priv = info;
                exit(-1);
        }
        bank->driver_priv = info;
-       info->driverPath = strdup(args[6]);
+       info->driverPath = strdup(CMD_ARGV[6]);
 
        /* eCos flash sector sizes are not exposed to OpenOCD, use 0x10000 as
         * a way to improve impedance match between OpenOCD and eCos flash
 
        /* eCos flash sector sizes are not exposed to OpenOCD, use 0x10000 as
         * a way to improve impedance match between OpenOCD and eCos flash
@@ -141,10 +141,10 @@ FLASH_BANK_COMMAND_HANDLER(ecosflash_flash_bank_command)
                bank->sectors[i].is_protected = 0;
        }
 
                bank->sectors[i].is_protected = 0;
        }
 
-       info->target = get_target(args[5]);
+       info->target = get_target(CMD_ARGV[5]);
        if (info->target == NULL)
        {
        if (info->target == NULL)
        {
-               LOG_ERROR("target '%s' not defined", args[5]);
+               LOG_ERROR("target '%s' not defined", CMD_ARGV[5]);
                return ERROR_FAIL;
        }
        return ERROR_OK;
                return ERROR_FAIL;
        }
        return ERROR_OK;
index 54acf7548f6b54e9f330788bbbaf08fe1beb0c6f..558d7b07f31a7ac916c848738cb6fafe3ae1d283 100644 (file)
@@ -76,10 +76,10 @@ FLASH_BANK_COMMAND_HANDLER(faux_flash_bank_command)
                bank->sectors[i].is_protected = 0;
        }
 
                bank->sectors[i].is_protected = 0;
        }
 
-       info->target = get_target(args[5]);
+       info->target = get_target(CMD_ARGV[5]);
        if (info->target == NULL)
        {
        if (info->target == NULL)
        {
-               LOG_ERROR("target '%s' not defined", args[5]);
+               LOG_ERROR("target '%s' not defined", CMD_ARGV[5]);
                free(info->memory);
                free(info);
                return ERROR_FAIL;
                free(info->memory);
                free(info);
                return ERROR_FAIL;
index 7402772cd462420127f3a904d07104e63f470669..99e71d7a90b8d5bfbc4577b95a1c8cc8fbaf5511 100644 (file)
@@ -201,14 +201,14 @@ struct flash_bank *get_flash_bank_by_num(int num)
 COMMAND_HELPER(flash_command_get_bank_by_num,
        unsigned name_index, struct flash_bank **bank)
 {
 COMMAND_HELPER(flash_command_get_bank_by_num,
        unsigned name_index, struct flash_bank **bank)
 {
+       const char *name = CMD_ARGV[name_index];
        unsigned bank_num;
        unsigned bank_num;
-       COMMAND_PARSE_NUMBER(uint, args[name_index], bank_num);
+       COMMAND_PARSE_NUMBER(uint, name, bank_num);
 
        *bank = get_flash_bank_by_num(bank_num);
        if (!*bank)
        {
 
        *bank = get_flash_bank_by_num(bank_num);
        if (!*bank)
        {
-               command_print(cmd_ctx,
-                       "flash bank '#%u' not found", bank_num);
+               command_print(cmd_ctx, "flash bank '%s' not found", name);
                return ERROR_INVALID_ARGUMENTS;
        }
        return ERROR_OK;
                return ERROR_INVALID_ARGUMENTS;
        }
        return ERROR_OK;
@@ -227,15 +227,15 @@ COMMAND_HANDLER(handle_flash_bank_command)
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
-       if ((target = get_target(args[5])) == NULL)
+       if ((target = get_target(CMD_ARGV[5])) == NULL)
        {
        {
-               LOG_ERROR("target '%s' not defined", args[5]);
+               LOG_ERROR("target '%s' not defined", CMD_ARGV[5]);
                return ERROR_FAIL;
        }
 
        for (i = 0; flash_drivers[i]; i++)
        {
                return ERROR_FAIL;
        }
 
        for (i = 0; flash_drivers[i]; i++)
        {
-               if (strcmp(args[0], flash_drivers[i]->name) != 0)
+               if (strcmp(CMD_ARGV[0], flash_drivers[i]->name) != 0)
                        continue;
 
                struct flash_bank *p, *c;
                        continue;
 
                struct flash_bank *p, *c;
@@ -243,7 +243,7 @@ COMMAND_HANDLER(handle_flash_bank_command)
                /* register flash specific commands */
                if (flash_drivers[i]->register_commands(cmd_ctx) != ERROR_OK)
                {
                /* register flash specific commands */
                if (flash_drivers[i]->register_commands(cmd_ctx) != ERROR_OK)
                {
-                       LOG_ERROR("couldn't register '%s' commands", args[0]);
+                       LOG_ERROR("couldn't register '%s' commands", CMD_ARGV[0]);
                        return ERROR_FAIL;
                }
 
                        return ERROR_FAIL;
                }
 
@@ -251,10 +251,10 @@ COMMAND_HANDLER(handle_flash_bank_command)
                c->target = target;
                c->driver = flash_drivers[i];
                c->driver_priv = NULL;
                c->target = target;
                c->driver = flash_drivers[i];
                c->driver_priv = NULL;
-               COMMAND_PARSE_NUMBER(u32, args[1], c->base);
-               COMMAND_PARSE_NUMBER(u32, args[2], c->size);
-               COMMAND_PARSE_NUMBER(int, args[3], c->chip_width);
-               COMMAND_PARSE_NUMBER(int, args[4], c->bus_width);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], c->base);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], c->size);
+               COMMAND_PARSE_NUMBER(int, CMD_ARGV[3], c->chip_width);
+               COMMAND_PARSE_NUMBER(int, CMD_ARGV[4], c->bus_width);
                c->num_sectors = 0;
                c->sectors = NULL;
                c->next = NULL;
                c->num_sectors = 0;
                c->sectors = NULL;
                c->next = NULL;
@@ -262,7 +262,7 @@ COMMAND_HANDLER(handle_flash_bank_command)
                retval = CALL_COMMAND_HANDLER(flash_drivers[i]->flash_bank_command, c);
                if (ERROR_OK != retval)
                {
                retval = CALL_COMMAND_HANDLER(flash_drivers[i]->flash_bank_command, c);
                if (ERROR_OK != retval)
                {
-                       LOG_ERROR("'%s' driver rejected flash bank at 0x%8.8" PRIx32 , args[0], c->base);
+                       LOG_ERROR("'%s' driver rejected flash bank at 0x%8.8" PRIx32 , CMD_ARGV[0], c->base);
                        free(c);
                        return retval;
                }
                        free(c);
                        return retval;
                }
@@ -289,7 +289,7 @@ COMMAND_HANDLER(handle_flash_bank_command)
        /* no matching flash driver found */
        if (!found)
        {
        /* no matching flash driver found */
        if (!found)
        {
-               LOG_ERROR("flash driver '%s' not found", args[0]);
+               LOG_ERROR("flash driver '%s' not found", CMD_ARGV[0]);
                return ERROR_FAIL;
        }
 
                return ERROR_FAIL;
        }
 
@@ -307,7 +307,7 @@ COMMAND_HANDLER(handle_flash_info_command)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        unsigned bank_nr;
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        unsigned bank_nr;
-       COMMAND_PARSE_NUMBER(uint, args[0], bank_nr);
+       COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], bank_nr);
 
        for (p = flash_banks; p; p = p->next, i++)
        {
 
        for (p = flash_banks; p; p = p->next, i++)
        {
@@ -368,7 +368,7 @@ COMMAND_HANDLER(handle_flash_probe_command)
        }
 
        unsigned bank_nr;
        }
 
        unsigned bank_nr;
-       COMMAND_PARSE_NUMBER(uint, args[0], bank_nr);
+       COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], bank_nr);
        struct flash_bank *p = get_flash_bank_by_num_noprobe(bank_nr);
        if (p)
        {
        struct flash_bank *p = get_flash_bank_by_num_noprobe(bank_nr);
        if (p)
        {
@@ -379,17 +379,17 @@ COMMAND_HANDLER(handle_flash_probe_command)
                else if (retval == ERROR_FLASH_BANK_INVALID)
                {
                        command_print(cmd_ctx, "probing failed for flash bank '#%s' at 0x%8.8" PRIx32,
                else if (retval == ERROR_FLASH_BANK_INVALID)
                {
                        command_print(cmd_ctx, "probing failed for flash bank '#%s' at 0x%8.8" PRIx32,
-                                                 args[0], p->base);
+                                                 CMD_ARGV[0], p->base);
                }
                else
                {
                        command_print(cmd_ctx, "unknown error when probing flash bank '#%s' at 0x%8.8" PRIx32,
                }
                else
                {
                        command_print(cmd_ctx, "unknown error when probing flash bank '#%s' at 0x%8.8" PRIx32,
-                                                 args[0], p->base);
+                                                 CMD_ARGV[0], p->base);
                }
        }
        else
        {
                }
        }
        else
        {
-               command_print(cmd_ctx, "flash bank '#%s' is out of bounds", args[0]);
+               command_print(cmd_ctx, "flash bank '#%s' is out of bounds", CMD_ARGV[0]);
        }
 
        return ERROR_OK;
        }
 
        return ERROR_OK;
@@ -415,7 +415,7 @@ COMMAND_HANDLER(handle_flash_erase_check_command)
        else
        {
                command_print(cmd_ctx, "unknown error when checking erase state of flash bank #%s at 0x%8.8" PRIx32,
        else
        {
                command_print(cmd_ctx, "unknown error when checking erase state of flash bank #%s at 0x%8.8" PRIx32,
-                       args[0], p->base);
+                       CMD_ARGV[0], p->base);
        }
 
        for (j = 0; j < p->num_sectors; j++)
        }
 
        for (j = 0; j < p->num_sectors; j++)
@@ -453,8 +453,8 @@ COMMAND_HANDLER(handle_flash_erase_address_command)
        if (CMD_ARGC != 2)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        if (CMD_ARGC != 2)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
-       COMMAND_PARSE_NUMBER(int, args[0], address);
-       COMMAND_PARSE_NUMBER(int, args[1], length);
+       COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], address);
+       COMMAND_PARSE_NUMBER(int, CMD_ARGV[1], length);
        if (length <= 0)
        {
                command_print(cmd_ctx, "Length must be >0");
        if (length <= 0)
        {
                command_print(cmd_ctx, "Length must be >0");
@@ -501,11 +501,11 @@ COMMAND_HANDLER(handle_flash_protect_check_command)
        }
        else if (retval == ERROR_FLASH_OPERATION_FAILED)
        {
        }
        else if (retval == ERROR_FLASH_OPERATION_FAILED)
        {
-               command_print(cmd_ctx, "checking protection state failed (possibly unsupported) by flash #%s at 0x%8.8" PRIx32, args[0], p->base);
+               command_print(cmd_ctx, "checking protection state failed (possibly unsupported) by flash #%s at 0x%8.8" PRIx32, CMD_ARGV[0], p->base);
        }
        else
        {
        }
        else
        {
-               command_print(cmd_ctx, "unknown error when checking protection state of flash bank '#%s' at 0x%8.8" PRIx32, args[0], p->base);
+               command_print(cmd_ctx, "unknown error when checking protection state of flash bank '#%s' at 0x%8.8" PRIx32, CMD_ARGV[0], p->base);
        }
 
        return ERROR_OK;
        }
 
        return ERROR_OK;
@@ -538,16 +538,16 @@ COMMAND_HANDLER(handle_flash_erase_command)
        uint32_t first;
        uint32_t last;
 
        uint32_t first;
        uint32_t last;
 
-       COMMAND_PARSE_NUMBER(u32, args[0], bank_nr);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], bank_nr);
        struct flash_bank *p = get_flash_bank_by_num(bank_nr);
        if (!p)
                return ERROR_OK;
 
        struct flash_bank *p = get_flash_bank_by_num(bank_nr);
        if (!p)
                return ERROR_OK;
 
-       COMMAND_PARSE_NUMBER(u32, args[1], first);
-       if (strcmp(args[2], "last") == 0)
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], first);
+       if (strcmp(CMD_ARGV[2], "last") == 0)
                last = p->num_sectors - 1;
        else
                last = p->num_sectors - 1;
        else
-               COMMAND_PARSE_NUMBER(u32, args[2], last);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], last);
 
        int retval;
        if ((retval = flash_check_sector_parameters(cmd_ctx,
 
        int retval;
        if ((retval = flash_check_sector_parameters(cmd_ctx,
@@ -579,20 +579,20 @@ COMMAND_HANDLER(handle_flash_protect_command)
        uint32_t last;
        int set;
 
        uint32_t last;
        int set;
 
-       COMMAND_PARSE_NUMBER(u32, args[0], bank_nr);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], bank_nr);
        struct flash_bank *p = get_flash_bank_by_num(bank_nr);
        if (!p)
                return ERROR_OK;
 
        struct flash_bank *p = get_flash_bank_by_num(bank_nr);
        if (!p)
                return ERROR_OK;
 
-       COMMAND_PARSE_NUMBER(u32, args[1], first);
-       if (strcmp(args[2], "last") == 0)
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], first);
+       if (strcmp(CMD_ARGV[2], "last") == 0)
                last = p->num_sectors - 1;
        else
                last = p->num_sectors - 1;
        else
-               COMMAND_PARSE_NUMBER(u32, args[2], last);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], last);
 
 
-       if (strcmp(args[3], "on") == 0)
+       if (strcmp(CMD_ARGV[3], "on") == 0)
                set = 1;
                set = 1;
-       else if (strcmp(args[3], "off") == 0)
+       else if (strcmp(CMD_ARGV[3], "off") == 0)
                set = 0;
        else
                return ERROR_COMMAND_SYNTAX_ERROR;
                set = 0;
        else
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -633,16 +633,16 @@ COMMAND_HANDLER(handle_flash_write_image_command)
 
        for (;;)
        {
 
        for (;;)
        {
-               if (strcmp(args[0], "erase") == 0)
+               if (strcmp(CMD_ARGV[0], "erase") == 0)
                {
                        auto_erase = 1;
                {
                        auto_erase = 1;
-                       args++;
+                       CMD_ARGV++;
                        CMD_ARGC--;
                        command_print(cmd_ctx, "auto erase enabled");
                        CMD_ARGC--;
                        command_print(cmd_ctx, "auto erase enabled");
-               } else if (strcmp(args[0], "unlock") == 0)
+               } else if (strcmp(CMD_ARGV[0], "unlock") == 0)
                {
                        auto_unlock = true;
                {
                        auto_unlock = true;
-                       args++;
+                       CMD_ARGV++;
                        CMD_ARGC--;
                        command_print(cmd_ctx, "auto unlock enabled");
                } else
                        CMD_ARGC--;
                        command_print(cmd_ctx, "auto unlock enabled");
                } else
@@ -668,7 +668,7 @@ COMMAND_HANDLER(handle_flash_write_image_command)
        if (CMD_ARGC >= 2)
        {
                image.base_address_set = 1;
        if (CMD_ARGC >= 2)
        {
                image.base_address_set = 1;
-               COMMAND_PARSE_NUMBER(int, args[1], image.base_address);
+               COMMAND_PARSE_NUMBER(int, CMD_ARGV[1], image.base_address);
        }
        else
        {
        }
        else
        {
@@ -678,7 +678,7 @@ COMMAND_HANDLER(handle_flash_write_image_command)
 
        image.start_address_set = 0;
 
 
        image.start_address_set = 0;
 
-       retval = image_open(&image, args[0], (CMD_ARGC == 3) ? args[2] : NULL);
+       retval = image_open(&image, CMD_ARGV[0], (CMD_ARGC == 3) ? CMD_ARGV[2] : NULL);
        if (retval != ERROR_OK)
        {
                return retval;
        if (retval != ERROR_OK)
        {
                return retval;
@@ -694,7 +694,7 @@ COMMAND_HANDLER(handle_flash_write_image_command)
        if ((ERROR_OK == retval) && (duration_measure(&bench) == ERROR_OK))
        {
                command_print(cmd_ctx, "wrote %" PRIu32 " byte from file %s "
        if ((ERROR_OK == retval) && (duration_measure(&bench) == ERROR_OK))
        {
                command_print(cmd_ctx, "wrote %" PRIu32 " byte from file %s "
-                               "in %fs (%0.3f kb/s)", written, args[0],
+                               "in %fs (%0.3f kb/s)", written, CMD_ARGV[0],
                                duration_elapsed(&bench), duration_kbps(&bench, written));
        }
 
                                duration_elapsed(&bench), duration_kbps(&bench, written));
        }
 
@@ -721,9 +721,9 @@ COMMAND_HANDLER(handle_flash_fill_command)
        if (CMD_ARGC != 3)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        if (CMD_ARGC != 3)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
-       COMMAND_PARSE_NUMBER(u32, args[0], address);
-       COMMAND_PARSE_NUMBER(u32, args[1], pattern);
-       COMMAND_PARSE_NUMBER(u32, args[2], count);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], address);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], pattern);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], count);
 
        if (count == 0)
                return ERROR_OK;
 
        if (count == 0)
                return ERROR_OK;
@@ -824,9 +824,9 @@ COMMAND_HANDLER(handle_flash_write_bank_command)
        if (ERROR_OK != retval)
                return retval;
 
        if (ERROR_OK != retval)
                return retval;
 
-       COMMAND_PARSE_NUMBER(u32, args[2], offset);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], offset);
 
 
-       if (fileio_open(&fileio, args[1], FILEIO_READ, FILEIO_BINARY) != ERROR_OK)
+       if (fileio_open(&fileio, CMD_ARGV[1], FILEIO_READ, FILEIO_BINARY) != ERROR_OK)
        {
                return ERROR_OK;
        }
        {
                return ERROR_OK;
        }
@@ -849,7 +849,7 @@ COMMAND_HANDLER(handle_flash_write_bank_command)
        {
                command_print(cmd_ctx, "wrote %zu byte from file %s to flash bank %u"
                                " at offset 0x%8.8" PRIx32 " in %fs (%0.3f kb/s)",
        {
                command_print(cmd_ctx, "wrote %zu byte from file %s to flash bank %u"
                                " at offset 0x%8.8" PRIx32 " in %fs (%0.3f kb/s)",
-                               fileio.size, args[1], p->bank_number, offset,
+                               fileio.size, CMD_ARGV[1], p->bank_number, offset,
                                duration_elapsed(&bench), duration_kbps(&bench, fileio.size));
        }
 
                                duration_elapsed(&bench), duration_kbps(&bench, fileio.size));
        }
 
index df5b0c9b61ae5b01be98b59933f6c0dff572aabc..23a7b81839c0707f0f4f1edeeefb8712d59d1400 100644 (file)
@@ -105,21 +105,21 @@ struct flash_driver
         * layer when this routine is called, and the driver can store
         * additional information in its struct flash_bank::driver_priv field.
         *
         * layer when this routine is called, and the driver can store
         * additional information in its struct flash_bank::driver_priv field.
         *
-        * The args are: @par
+        * The CMD_ARGV are: @par
         * @code
         * @code
-        * args[0] = bank
-        * args[1] = drivername {name above}
-        * args[2] = baseaddress
-        * args[3] = lengthbytes
-        * args[4] = chip_width_in bytes
-        * args[5] = bus_width_bytes
-        * args[6] = driver-specific parameters
+        * CMD_ARGV[0] = bank
+        * CMD_ARGV[1] = drivername {name above}
+        * CMD_ARGV[2] = baseaddress
+        * CMD_ARGV[3] = lengthbytes
+        * CMD_ARGV[4] = chip_width_in bytes
+        * CMD_ARGV[5] = bus_width_bytes
+        * CMD_ARGV[6] = driver-specific parameters
         * @endcode
         *
         * @endcode
         *
-        * For example, args[4] = 16 bit flash, args[5] = 32bit bus.
+        * For example, CMD_ARGV[4] = 16 bit flash, CMD_ARGV[5] = 32bit bus.
         *
         * If extra arguments are provided (@a CMD_ARGC > 6), they will
         *
         * If extra arguments are provided (@a CMD_ARGC > 6), they will
-        * start in @a args[6].  These can be used to implement
+        * start in @a CMD_ARGV[6].  These can be used to implement
         * driver-specific extensions.
         *
         * @returns ERROR_OK if successful; otherwise, an error code.
         * driver-specific extensions.
         *
         * @returns ERROR_OK if successful; otherwise, an error code.
index 60d909f151a7fffda69186106d5f29fb7023b852..63781309790af0359d3983b4099bae4ff1d02a64 100644 (file)
@@ -433,7 +433,7 @@ FLASH_BANK_COMMAND_HANDLER(lpc2000_flash_bank_command)
        lpc2000_info = malloc(sizeof(struct lpc2000_flash_bank));
        bank->driver_priv = lpc2000_info;
 
        lpc2000_info = malloc(sizeof(struct lpc2000_flash_bank));
        bank->driver_priv = lpc2000_info;
 
-       if (strcmp(args[6], "lpc2000_v1") == 0)
+       if (strcmp(CMD_ARGV[6], "lpc2000_v1") == 0)
        {
                lpc2000_info->variant = lpc2000_v1;
                lpc2000_info->cmd51_dst_boundary = 512;
        {
                lpc2000_info->variant = lpc2000_v1;
                lpc2000_info->cmd51_dst_boundary = 512;
@@ -441,7 +441,7 @@ FLASH_BANK_COMMAND_HANDLER(lpc2000_flash_bank_command)
                lpc2000_info->cmd51_can_8192b = 1;
                lpc2000_info->checksum_vector = 5;
        }
                lpc2000_info->cmd51_can_8192b = 1;
                lpc2000_info->checksum_vector = 5;
        }
-       else if (strcmp(args[6], "lpc2000_v2") == 0)
+       else if (strcmp(CMD_ARGV[6], "lpc2000_v2") == 0)
        {
                lpc2000_info->variant = lpc2000_v2;
                lpc2000_info->cmd51_dst_boundary = 256;
        {
                lpc2000_info->variant = lpc2000_v2;
                lpc2000_info->cmd51_dst_boundary = 256;
@@ -449,7 +449,7 @@ FLASH_BANK_COMMAND_HANDLER(lpc2000_flash_bank_command)
                lpc2000_info->cmd51_can_8192b = 0;
                lpc2000_info->checksum_vector = 5;
        }
                lpc2000_info->cmd51_can_8192b = 0;
                lpc2000_info->checksum_vector = 5;
        }
-       else if (strcmp(args[6], "lpc1700") == 0)
+       else if (strcmp(CMD_ARGV[6], "lpc1700") == 0)
        {
                lpc2000_info->variant = lpc1700;
                lpc2000_info->cmd51_dst_boundary = 256;
        {
                lpc2000_info->variant = lpc1700;
                lpc2000_info->cmd51_dst_boundary = 256;
@@ -459,19 +459,19 @@ FLASH_BANK_COMMAND_HANDLER(lpc2000_flash_bank_command)
        }
        else
        {
        }
        else
        {
-               LOG_ERROR("unknown LPC2000 variant: %s", args[6]);
+               LOG_ERROR("unknown LPC2000 variant: %s", CMD_ARGV[6]);
                free(lpc2000_info);
                return ERROR_FLASH_BANK_INVALID;
        }
 
        lpc2000_info->iap_working_area = NULL;
                free(lpc2000_info);
                return ERROR_FLASH_BANK_INVALID;
        }
 
        lpc2000_info->iap_working_area = NULL;
-       COMMAND_PARSE_NUMBER(u32, args[7], lpc2000_info->cclk);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[7], lpc2000_info->cclk);
        lpc2000_info->calc_checksum = 0;
        lpc2000_build_sector_list(bank);
 
        if (CMD_ARGC >= 9)
        {
        lpc2000_info->calc_checksum = 0;
        lpc2000_build_sector_list(bank);
 
        if (CMD_ARGC >= 9)
        {
-               if (strcmp(args[8], "calc_checksum") == 0)
+               if (strcmp(CMD_ARGV[8], "calc_checksum") == 0)
                        lpc2000_info->calc_checksum = 1;
        }
 
                        lpc2000_info->calc_checksum = 1;
        }
 
index 2ad50146d7411928b499fe5fdfeb4bebb5996cf8..446fc9da58677787236e61117056b83554a3fe74 100644 (file)
@@ -180,7 +180,7 @@ FLASH_BANK_COMMAND_HANDLER(lpc288x_flash_bank_command)
 
        /* part wasn't probed for info yet */
        lpc288x_info->cidr = 0;
 
        /* part wasn't probed for info yet */
        lpc288x_info->cidr = 0;
-       COMMAND_PARSE_NUMBER(u32, args[6], lpc288x_info->cclk);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[6], lpc288x_info->cclk);
 
        return ERROR_OK;
 }
 
        return ERROR_OK;
 }
index 67a510e09ea9e1a6f02d9d5fbc6e3e445e06021f..98b13bf110067dd453e81e2b3267359b23f04c3a 100644 (file)
@@ -623,7 +623,7 @@ COMMAND_HANDLER(lpc2900_handle_read_custom_command)
 
        /* Try and open the file */
        struct fileio fileio;
 
        /* Try and open the file */
        struct fileio fileio;
-       const char *filename = args[1];
+       const char *filename = CMD_ARGV[1];
        int ret = fileio_open( &fileio, filename, FILEIO_WRITE, FILEIO_BINARY );
        if( ret != ERROR_OK )
        {
        int ret = fileio_open( &fileio, filename, FILEIO_WRITE, FILEIO_BINARY );
        if( ret != ERROR_OK )
        {
@@ -668,7 +668,7 @@ COMMAND_HANDLER(lpc2900_handle_password_command)
 
 #define ISS_PASSWORD "I_know_what_I_am_doing"
 
 
 #define ISS_PASSWORD "I_know_what_I_am_doing"
 
-       lpc2900_info->risky = !strcmp( args[1], ISS_PASSWORD );
+       lpc2900_info->risky = !strcmp( CMD_ARGV[1], ISS_PASSWORD );
 
        if( !lpc2900_info->risky )
        {
 
        if( !lpc2900_info->risky )
        {
@@ -723,8 +723,8 @@ COMMAND_HANDLER(lpc2900_handle_write_custom_command)
        image.base_address = 0;
        image.start_address_set = 0;
 
        image.base_address = 0;
        image.start_address_set = 0;
 
-       const char *filename = args[1];
-       const char *type = (CMD_ARGC >= 3) ? args[2] : NULL;
+       const char *filename = CMD_ARGV[1];
+       const char *type = (CMD_ARGC >= 3) ? CMD_ARGV[2] : NULL;
        retval = image_open(&image, filename, type);
        if (retval != ERROR_OK)
        {
        retval = image_open(&image, filename, type);
        if (retval != ERROR_OK)
        {
@@ -823,8 +823,8 @@ COMMAND_HANDLER(lpc2900_handle_secure_sector_command)
 
        /* Read sector range, and do a sanity check. */
        int first, last;
 
        /* Read sector range, and do a sanity check. */
        int first, last;
-       COMMAND_PARSE_NUMBER(int, args[1], first);
-       COMMAND_PARSE_NUMBER(int, args[2], last);
+       COMMAND_PARSE_NUMBER(int, CMD_ARGV[1], first);
+       COMMAND_PARSE_NUMBER(int, CMD_ARGV[2], last);
        if( (first >= bank->num_sectors) ||
            (last >= bank->num_sectors) ||
            (first > last) )
        if( (first >= bank->num_sectors) ||
            (last >= bank->num_sectors) ||
            (first > last) )
@@ -1034,7 +1034,7 @@ FLASH_BANK_COMMAND_HANDLER(lpc2900_flash_bank_command)
         * (if clock too slow), or for erase time (clock too fast).
         */
        uint32_t clk_sys_fmc;
         * (if clock too slow), or for erase time (clock too fast).
         */
        uint32_t clk_sys_fmc;
-       COMMAND_PARSE_NUMBER(u32, args[6], clk_sys_fmc);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[6], clk_sys_fmc);
        lpc2900_info->clk_sys_fmc = clk_sys_fmc * 1000;
 
        uint32_t clock_limit;
        lpc2900_info->clk_sys_fmc = clk_sys_fmc * 1000;
 
        uint32_t clock_limit;
index d7cbe388318ce2b4c77731531c67da7b3efeb293..1de48f4de40ad6df26488261711037de07eba664 100644 (file)
@@ -37,15 +37,15 @@ NAND_DEVICE_COMMAND_HANDLER(lpc3180_nand_device_command)
                return ERROR_FLASH_BANK_INVALID;
        }
 
                return ERROR_FLASH_BANK_INVALID;
        }
 
-       struct target *target = get_target(args[1]);
+       struct target *target = get_target(CMD_ARGV[1]);
        if (NULL == target)
        {
        if (NULL == target)
        {
-               LOG_ERROR("target '%s' not defined", args[1]);
+               LOG_ERROR("target '%s' not defined", CMD_ARGV[1]);
                return ERROR_NAND_DEVICE_INVALID;
        }
 
        uint32_t osc_freq;
                return ERROR_NAND_DEVICE_INVALID;
        }
 
        uint32_t osc_freq;
-       COMMAND_PARSE_NUMBER(u32, args[2], osc_freq);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], osc_freq);
 
        struct lpc3180_nand_controller *lpc3180_info;
        lpc3180_info = malloc(sizeof(struct lpc3180_nand_controller));
 
        struct lpc3180_nand_controller *lpc3180_info;
        lpc3180_info = malloc(sizeof(struct lpc3180_nand_controller));
@@ -842,11 +842,11 @@ COMMAND_HANDLER(handle_lpc3180_select_command)
        }
 
        unsigned num;
        }
 
        unsigned num;
-       COMMAND_PARSE_NUMBER(uint, args[1], num);
+       COMMAND_PARSE_NUMBER(uint, CMD_ARGV[1], num);
        struct nand_device *nand = get_nand_device_by_num(num);
        if (!nand)
        {
        struct nand_device *nand = get_nand_device_by_num(num);
        if (!nand)
        {
-               command_print(cmd_ctx, "nand device '#%s' is out of bounds", args[0]);
+               command_print(cmd_ctx, "nand device '#%s' is out of bounds", CMD_ARGV[0]);
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
@@ -854,11 +854,11 @@ COMMAND_HANDLER(handle_lpc3180_select_command)
 
        if (CMD_ARGC == 2)
        {
 
        if (CMD_ARGC == 2)
        {
-               if (strcmp(args[1], "mlc") == 0)
+               if (strcmp(CMD_ARGV[1], "mlc") == 0)
                {
                        lpc3180_info->selected_controller = LPC3180_MLC_CONTROLLER;
                }
                {
                        lpc3180_info->selected_controller = LPC3180_MLC_CONTROLLER;
                }
-               else if (strcmp(args[1], "slc") == 0)
+               else if (strcmp(CMD_ARGV[1], "slc") == 0)
                {
                        lpc3180_info->selected_controller = LPC3180_SLC_CONTROLLER;
                }
                {
                        lpc3180_info->selected_controller = LPC3180_SLC_CONTROLLER;
                }
index 6aeeabc670bd8f1367072d57155860eeff23cb82..64f332e9af6a3350255dc8443feaa5a5fd08bb2f 100644 (file)
@@ -714,9 +714,9 @@ COMMAND_HANDLER(mg_write_cmd)
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
-       COMMAND_PARSE_NUMBER(u32, args[2], address);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], address);
 
 
-       ret = fileio_open(&fileio, args[1], FILEIO_READ, FILEIO_BINARY);
+       ret = fileio_open(&fileio, CMD_ARGV[1], FILEIO_READ, FILEIO_BINARY);
        if (ret != ERROR_OK)
                return ret;
 
        if (ret != ERROR_OK)
                return ret;
 
@@ -752,7 +752,7 @@ COMMAND_HANDLER(mg_write_cmd)
        if (duration_measure(&bench) == ERROR_OK)
        {
                command_print(cmd_ctx, "wrote %zu byte from file %s "
        if (duration_measure(&bench) == ERROR_OK)
        {
                command_print(cmd_ctx, "wrote %zu byte from file %s "
-                               "in %fs (%0.3f kB/s)", fileio.size, args[1],
+                               "in %fs (%0.3f kB/s)", fileio.size, CMD_ARGV[1],
                                duration_elapsed(&bench), duration_kbps(&bench, fileio.size));
        }
 
                                duration_elapsed(&bench), duration_kbps(&bench, fileio.size));
        }
 
@@ -779,10 +779,10 @@ COMMAND_HANDLER(mg_dump_cmd)
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
-       COMMAND_PARSE_NUMBER(u32, args[2], address);
-       COMMAND_PARSE_NUMBER(u32, args[3], size);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], address);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[3], size);
 
 
-       ret = fileio_open(&fileio, args[1], FILEIO_WRITE, FILEIO_BINARY);
+       ret = fileio_open(&fileio, CMD_ARGV[1], FILEIO_WRITE, FILEIO_BINARY);
        if (ret != ERROR_OK)
                return ret;
 
        if (ret != ERROR_OK)
                return ret;
 
@@ -819,7 +819,7 @@ COMMAND_HANDLER(mg_dump_cmd)
        {
                command_print(cmd_ctx, "dump image (address 0x%8.8" PRIx32 " "
                                "size %" PRIu32 ") to file %s in %fs (%0.3f kB/s)",
        {
                command_print(cmd_ctx, "dump image (address 0x%8.8" PRIx32 " "
                                "size %" PRIu32 ") to file %s in %fs (%0.3f kB/s)",
-                               address, size, args[1],
+                               address, size, CMD_ARGV[1],
                                duration_elapsed(&bench), duration_kbps(&bench, size));
        }
 
                                duration_elapsed(&bench), duration_kbps(&bench, size));
        }
 
@@ -1225,17 +1225,17 @@ COMMAND_HANDLER(mg_config_cmd)
 
        switch (CMD_ARGC) {
                case 2:
 
        switch (CMD_ARGC) {
                case 2:
-                       if (!strcmp(args[1], "boot"))
+                       if (!strcmp(CMD_ARGV[1], "boot"))
                                return mg_boot_config();
                                return mg_boot_config();
-                       else if (!strcmp(args[1], "storage"))
+                       else if (!strcmp(CMD_ARGV[1], "storage"))
                                return mg_storage_config();
                        else
                                return ERROR_COMMAND_NOTFOUND;
                        break;
                case 3:
                                return mg_storage_config();
                        else
                                return ERROR_COMMAND_NOTFOUND;
                        break;
                case 3:
-                       if (!strcmp(args[1], "pll")) {
+                       if (!strcmp(CMD_ARGV[1], "pll")) {
                                unsigned long freq;
                                unsigned long freq;
-                               COMMAND_PARSE_NUMBER(ulong, args[2], freq);
+                               COMMAND_PARSE_NUMBER(ulong, CMD_ARGV[2], freq);
                                fin = freq;
 
                                if (fin > MG_PLL_CLK_OUT) {
                                fin = freq;
 
                                if (fin > MG_PLL_CLK_OUT) {
@@ -1293,30 +1293,30 @@ COMMAND_HANDLER(mg_bank_cmd)
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
-       if ((target = get_target(args[3])) == NULL)
+       if ((target = get_target(CMD_ARGV[3])) == NULL)
        {
        {
-               LOG_ERROR("target '%s' not defined", args[3]);
+               LOG_ERROR("target '%s' not defined", CMD_ARGV[3]);
                return ERROR_FAIL;
        }
 
        mflash_bank = calloc(sizeof(struct mflash_bank), 1);
                return ERROR_FAIL;
        }
 
        mflash_bank = calloc(sizeof(struct mflash_bank), 1);
-       COMMAND_PARSE_NUMBER(u32, args[1], mflash_bank->base);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], mflash_bank->base);
        /// @todo Verify how this parsing should work, then document it.
        char *str;
        /// @todo Verify how this parsing should work, then document it.
        char *str;
-       mflash_bank->rst_pin.num = strtoul(args[2], &str, 0);
+       mflash_bank->rst_pin.num = strtoul(CMD_ARGV[2], &str, 0);
        if (*str)
                mflash_bank->rst_pin.port[0] = (uint16_t)tolower(str[0]);
 
        mflash_bank->target = target;
 
        for (i = 0; mflash_gpio[i] ; i++) {
        if (*str)
                mflash_bank->rst_pin.port[0] = (uint16_t)tolower(str[0]);
 
        mflash_bank->target = target;
 
        for (i = 0; mflash_gpio[i] ; i++) {
-               if (! strcmp(mflash_gpio[i]->name, args[0])) {
+               if (! strcmp(mflash_gpio[i]->name, CMD_ARGV[0])) {
                        mflash_bank->gpio_drv = mflash_gpio[i];
                }
        }
 
        if (! mflash_bank->gpio_drv) {
                        mflash_bank->gpio_drv = mflash_gpio[i];
                }
        }
 
        if (! mflash_bank->gpio_drv) {
-               LOG_ERROR("%s is unsupported soc", args[0]);
+               LOG_ERROR("%s is unsupported soc", CMD_ARGV[0]);
                return ERROR_MG_UNSUPPORTED_SOC;
        }
 
                return ERROR_MG_UNSUPPORTED_SOC;
        }
 
index 49e1758be63f02a2959501c1a3ef691d8723d1a4..459e2a60cac2656088beca0fd3200e5832efdeef 100644 (file)
@@ -73,10 +73,10 @@ NAND_DEVICE_COMMAND_HANDLER(imx31_nand_device_command)
 
        nand->controller_priv = mx3_nf_info;
 
 
        nand->controller_priv = mx3_nf_info;
 
-       mx3_nf_info->target = get_target (args[1]);
+       mx3_nf_info->target = get_target (CMD_ARGV[1]);
        if (mx3_nf_info->target == NULL)
        {
        if (mx3_nf_info->target == NULL)
        {
-           LOG_ERROR ("target '%s' not defined", args[1]);
+           LOG_ERROR ("target '%s' not defined", CMD_ARGV[1]);
            return ERROR_FAIL;
        }
        if (CMD_ARGC < 3)
            return ERROR_FAIL;
        }
        if (CMD_ARGC < 3)
@@ -89,7 +89,7 @@ NAND_DEVICE_COMMAND_HANDLER(imx31_nand_device_command)
        */
        {
        int hwecc_needed;
        */
        {
        int hwecc_needed;
-       hwecc_needed = strcmp (args[2], "hwecc");
+       hwecc_needed = strcmp (CMD_ARGV[2], "hwecc");
        if (hwecc_needed == 0)
            {
                mx3_nf_info->flags.hw_ecc_enabled = 1;
        if (hwecc_needed == 0)
            {
                mx3_nf_info->flags.hw_ecc_enabled = 1;
index 9231b9adaa69b28963346e9e794d56d325d2b70c..ce713b9cd9a7cde34014d4187d0243cd263212ad 100644 (file)
@@ -220,12 +220,12 @@ COMMAND_HANDLER(handle_nand_device_command)
        {
                struct nand_device *p, *c;
 
        {
                struct nand_device *p, *c;
 
-               if (strcmp(args[0], nand_flash_controllers[i]->name) == 0)
+               if (strcmp(CMD_ARGV[0], nand_flash_controllers[i]->name) == 0)
                {
                        /* register flash specific commands */
                        if ((retval = nand_flash_controllers[i]->register_commands(cmd_ctx)) != ERROR_OK)
                        {
                {
                        /* register flash specific commands */
                        if ((retval = nand_flash_controllers[i]->register_commands(cmd_ctx)) != ERROR_OK)
                        {
-                               LOG_ERROR("couldn't register '%s' commands", args[0]);
+                               LOG_ERROR("couldn't register '%s' commands", CMD_ARGV[0]);
                                return retval;
                        }
 
                                return retval;
                        }
 
@@ -269,7 +269,7 @@ COMMAND_HANDLER(handle_nand_device_command)
        /* no valid NAND controller was found (i.e. the configuration option,
         * didn't match one of the compiled-in controllers)
         */
        /* no valid NAND controller was found (i.e. the configuration option,
         * didn't match one of the compiled-in controllers)
         */
-       LOG_ERROR("No valid NAND flash controller found (%s)", args[0]);
+       LOG_ERROR("No valid NAND flash controller found (%s)", CMD_ARGV[0]);
        LOG_ERROR("compiled-in NAND flash controllers:");
        for (i = 0; nand_flash_controllers[i]; i++)
        {
        LOG_ERROR("compiled-in NAND flash controllers:");
        for (i = 0; nand_flash_controllers[i]; i++)
        {
@@ -307,7 +307,7 @@ struct nand_device *get_nand_device_by_num(int num)
 COMMAND_HELPER(nand_command_get_device_by_num, unsigned name_index,
                struct nand_device **nand)
 {
 COMMAND_HELPER(nand_command_get_device_by_num, unsigned name_index,
                struct nand_device **nand)
 {
-       const char *str = args[name_index];
+       const char *str = CMD_ARGV[name_index];
        unsigned num;
        COMMAND_PARSE_NUMBER(uint, str, num);
        *nand = get_nand_device_by_num(num);
        unsigned num;
        COMMAND_PARSE_NUMBER(uint, str, num);
        *nand = get_nand_device_by_num(num);
@@ -1090,19 +1090,19 @@ COMMAND_HANDLER(handle_nand_info_command)
                last = INT32_MAX;
                break;
        case 2:
                last = INT32_MAX;
                break;
        case 2:
-               COMMAND_PARSE_NUMBER(int, args[1], i);
+               COMMAND_PARSE_NUMBER(int, CMD_ARGV[1], i);
                first = last = i;
                i = 0;
                break;
        case 3:
                first = last = i;
                i = 0;
                break;
        case 3:
-               COMMAND_PARSE_NUMBER(int, args[1], first);
-               COMMAND_PARSE_NUMBER(int, args[2], last);
+               COMMAND_PARSE_NUMBER(int, CMD_ARGV[1], first);
+               COMMAND_PARSE_NUMBER(int, CMD_ARGV[2], last);
                break;
        }
 
        if (NULL == p->device)
        {
                break;
        }
 
        if (NULL == p->device)
        {
-               command_print(cmd_ctx, "#%s: not probed", args[0]);
+               command_print(cmd_ctx, "#%s: not probed", CMD_ARGV[0]);
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
@@ -1193,11 +1193,11 @@ COMMAND_HANDLER(handle_nand_erase_command)
        if (CMD_ARGC == 3) {
                unsigned long size = p->erase_size * p->num_blocks;
 
        if (CMD_ARGC == 3) {
                unsigned long size = p->erase_size * p->num_blocks;
 
-               COMMAND_PARSE_NUMBER(ulong, args[1], offset);
+               COMMAND_PARSE_NUMBER(ulong, CMD_ARGV[1], offset);
                if ((offset % p->erase_size) != 0 || offset >= size)
                        return ERROR_INVALID_ARGUMENTS;
 
                if ((offset % p->erase_size) != 0 || offset >= size)
                        return ERROR_INVALID_ARGUMENTS;
 
-               COMMAND_PARSE_NUMBER(ulong, args[2], length);
+               COMMAND_PARSE_NUMBER(ulong, CMD_ARGV[2], length);
                if ((length == 0) || (length % p->erase_size) != 0
                                || (length + offset) > size)
                        return ERROR_INVALID_ARGUMENTS;
                if ((length == 0) || (length % p->erase_size) != 0
                                || (length + offset) > size)
                        return ERROR_INVALID_ARGUMENTS;
@@ -1215,7 +1215,7 @@ COMMAND_HANDLER(handle_nand_erase_command)
                command_print(cmd_ctx, "erased blocks %lu to %lu "
                                "on NAND flash device #%s '%s'",
                                offset, offset + length,
                command_print(cmd_ctx, "erased blocks %lu to %lu "
                                "on NAND flash device #%s '%s'",
                                offset, offset + length,
-                               args[0], p->device->name);
+                               CMD_ARGV[0], p->device->name);
        }
        else if (retval == ERROR_NAND_OPERATION_FAILED)
        {
        }
        else if (retval == ERROR_NAND_OPERATION_FAILED)
        {
@@ -1250,12 +1250,12 @@ COMMAND_HANDLER(handle_nand_check_bad_blocks_command)
                unsigned long offset;
                unsigned long length;
 
                unsigned long offset;
                unsigned long length;
 
-               COMMAND_PARSE_NUMBER(ulong, args[1], offset);
+               COMMAND_PARSE_NUMBER(ulong, CMD_ARGV[1], offset);
                if (offset % p->erase_size)
                        return ERROR_INVALID_ARGUMENTS;
                offset /= p->erase_size;
 
                if (offset % p->erase_size)
                        return ERROR_INVALID_ARGUMENTS;
                offset /= p->erase_size;
 
-               COMMAND_PARSE_NUMBER(ulong, args[2], length);
+               COMMAND_PARSE_NUMBER(ulong, CMD_ARGV[2], length);
                if (length % p->erase_size)
                        return ERROR_INVALID_ARGUMENTS;
 
                if (length % p->erase_size)
                        return ERROR_INVALID_ARGUMENTS;
 
@@ -1399,14 +1399,14 @@ static COMMAND_HELPER(nand_fileio_parse_args, struct nand_fileio_state *state,
 
        if (NULL == nand->device)
        {
 
        if (NULL == nand->device)
        {
-               command_print(cmd_ctx, "#%s: not probed", args[0]);
+               command_print(cmd_ctx, "#%s: not probed", CMD_ARGV[0]);
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
-       COMMAND_PARSE_NUMBER(u32, args[2], state->address);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], state->address);
        if (need_size)
        {
        if (need_size)
        {
-                       COMMAND_PARSE_NUMBER(u32, args[2], state->size);
+                       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], state->size);
                        if (state->size % nand->page_size)
                        {
                                command_print(cmd_ctx, "only page-aligned sizes are supported");
                        if (state->size % nand->page_size)
                        {
                                command_print(cmd_ctx, "only page-aligned sizes are supported");
@@ -1418,23 +1418,23 @@ static COMMAND_HELPER(nand_fileio_parse_args, struct nand_fileio_state *state,
        {
                for (unsigned i = minargs; i < CMD_ARGC; i++)
                {
        {
                for (unsigned i = minargs; i < CMD_ARGC; i++)
                {
-                       if (!strcmp(args[i], "oob_raw"))
+                       if (!strcmp(CMD_ARGV[i], "oob_raw"))
                                state->oob_format |= NAND_OOB_RAW;
                                state->oob_format |= NAND_OOB_RAW;
-                       else if (!strcmp(args[i], "oob_only"))
+                       else if (!strcmp(CMD_ARGV[i], "oob_only"))
                                state->oob_format |= NAND_OOB_RAW | NAND_OOB_ONLY;
                                state->oob_format |= NAND_OOB_RAW | NAND_OOB_ONLY;
-                       else if (sw_ecc && !strcmp(args[i], "oob_softecc"))
+                       else if (sw_ecc && !strcmp(CMD_ARGV[i], "oob_softecc"))
                                state->oob_format |= NAND_OOB_SW_ECC;
                                state->oob_format |= NAND_OOB_SW_ECC;
-                       else if (sw_ecc && !strcmp(args[i], "oob_softecc_kw"))
+                       else if (sw_ecc && !strcmp(CMD_ARGV[i], "oob_softecc_kw"))
                                state->oob_format |= NAND_OOB_SW_ECC_KW;
                        else
                        {
                                state->oob_format |= NAND_OOB_SW_ECC_KW;
                        else
                        {
-                               command_print(cmd_ctx, "unknown option: %s", args[i]);
+                               command_print(cmd_ctx, "unknown option: %s", CMD_ARGV[i]);
                                return ERROR_COMMAND_SYNTAX_ERROR;
                        }
                }
        }
 
                                return ERROR_COMMAND_SYNTAX_ERROR;
                        }
                }
        }
 
-       retval = nand_fileio_start(cmd_ctx, nand, args[1], filemode, state);
+       retval = nand_fileio_start(cmd_ctx, nand, CMD_ARGV[1], filemode, state);
        if (ERROR_OK != retval)
                return retval;
 
        if (ERROR_OK != retval)
                return retval;
 
@@ -1528,7 +1528,7 @@ COMMAND_HANDLER(handle_nand_write_command)
                {
                        command_print(cmd_ctx, "failed writing file %s "
                                "to NAND flash %s at offset 0x%8.8" PRIx32,
                {
                        command_print(cmd_ctx, "failed writing file %s "
                                "to NAND flash %s at offset 0x%8.8" PRIx32,
-                               args[1], args[0], s.address);
+                               CMD_ARGV[1], CMD_ARGV[0], s.address);
                        return nand_fileio_cleanup(&s);
                }
                s.address += s.page_size;
                        return nand_fileio_cleanup(&s);
                }
                s.address += s.page_size;
@@ -1538,7 +1538,7 @@ COMMAND_HANDLER(handle_nand_write_command)
        {
                command_print(cmd_ctx, "wrote file %s to NAND flash %s up to "
                                "offset 0x%8.8" PRIx32 " in %fs (%0.3f kb/s)",
        {
                command_print(cmd_ctx, "wrote file %s to NAND flash %s up to "
                                "offset 0x%8.8" PRIx32 " in %fs (%0.3f kb/s)",
-                               args[1], args[0], s.address, duration_elapsed(&s.bench),
+                               CMD_ARGV[1], CMD_ARGV[0], s.address, duration_elapsed(&s.bench),
                                duration_kbps(&s.bench, total_bytes));
        }
        return ERROR_OK;
                                duration_kbps(&s.bench, total_bytes));
        }
        return ERROR_OK;
@@ -1598,7 +1598,7 @@ COMMAND_HANDLER(handle_nand_verify_command)
        {
                command_print(cmd_ctx, "verified file %s in NAND flash %s "
                                "up to offset 0x%8.8" PRIx32 " in %fs (%0.3f kb/s)",
        {
                command_print(cmd_ctx, "verified file %s in NAND flash %s "
                                "up to offset 0x%8.8" PRIx32 " in %fs (%0.3f kb/s)",
-                               args[1], args[0], dev.address, duration_elapsed(&file.bench),
+                               CMD_ARGV[1], CMD_ARGV[0], dev.address, duration_elapsed(&file.bench),
                                duration_kbps(&file.bench, dev.size));
        }
 
                                duration_kbps(&file.bench, dev.size));
        }
 
@@ -1658,15 +1658,15 @@ COMMAND_HANDLER(handle_nand_raw_access_command)
 
        if (NULL == p->device)
        {
 
        if (NULL == p->device)
        {
-               command_print(cmd_ctx, "#%s: not probed", args[0]);
+               command_print(cmd_ctx, "#%s: not probed", CMD_ARGV[0]);
                return ERROR_OK;
        }
 
        if (CMD_ARGC == 2)
        {
                return ERROR_OK;
        }
 
        if (CMD_ARGC == 2)
        {
-               if (strcmp("enable", args[1]) == 0)
+               if (strcmp("enable", CMD_ARGV[1]) == 0)
                        p->use_raw = 1;
                        p->use_raw = 1;
-               else if (strcmp("disable", args[1]) == 0)
+               else if (strcmp("disable", CMD_ARGV[1]) == 0)
                        p->use_raw = 0;
                else
                        return ERROR_COMMAND_SYNTAX_ERROR;
                        p->use_raw = 0;
                else
                        return ERROR_COMMAND_SYNTAX_ERROR;
index 69d6d96606a1d1ed001c43e54c1b84396becca77..c8fc96988421fdaf7847f609f478e2503ea3e43f 100644 (file)
@@ -143,14 +143,14 @@ NAND_DEVICE_COMMAND_HANDLER(orion_nand_device_command)
        }
 
        nand->controller_priv = hw;
        }
 
        nand->controller_priv = hw;
-       hw->target = get_target(args[1]);
+       hw->target = get_target(CMD_ARGV[1]);
        if (!hw->target) {
        if (!hw->target) {
-               LOG_ERROR("target '%s' not defined", args[1]);
+               LOG_ERROR("target '%s' not defined", CMD_ARGV[1]);
                free(hw);
                return ERROR_NAND_DEVICE_INVALID;
        }
 
                free(hw);
                return ERROR_NAND_DEVICE_INVALID;
        }
 
-       COMMAND_PARSE_NUMBER(u32, args[2], base);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], base);
        cle = 0;
        ale = 1;
 
        cle = 0;
        ale = 1;
 
index 95e2c637349c5bfe91d0a27d9bbcaac00db9840b..05e047468d2a8c0cb2f119ea6c60000374e17fa8 100644 (file)
@@ -854,8 +854,8 @@ COMMAND_HANDLER(pic32mx_handle_pgm_word_command)
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
-       COMMAND_PARSE_NUMBER(u32, args[0], address);
-       COMMAND_PARSE_NUMBER(u32, args[1], value);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], address);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], value);
 
        struct flash_bank *bank;
        int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 2, &bank);
 
        struct flash_bank *bank;
        int retval = CALL_COMMAND_HANDLER(flash_command_get_bank_by_num, 2, &bank);
@@ -864,7 +864,7 @@ COMMAND_HANDLER(pic32mx_handle_pgm_word_command)
 
        if (address < bank->base || address >= (bank->base + bank->size))
        {
 
        if (address < bank->base || address >= (bank->base + bank->size))
        {
-               command_print(cmd_ctx, "flash address '%s' is out of bounds", args[0]);
+               command_print(cmd_ctx, "flash address '%s' is out of bounds", CMD_ARGV[0]);
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
index 75b8700c002c9f5d4776418967735ccafd3a5f74..262569e8f1ec18cd50a3174e6b391831c65cce94 100644 (file)
@@ -43,9 +43,9 @@ S3C24XX_DEVICE_COMMAND()
 
        nand->controller_priv = s3c24xx_info;
 
 
        nand->controller_priv = s3c24xx_info;
 
-       s3c24xx_info->target = get_target(args[1]);
+       s3c24xx_info->target = get_target(CMD_ARGV[1]);
        if (s3c24xx_info->target == NULL) {
        if (s3c24xx_info->target == NULL) {
-               LOG_ERROR("target '%s' not defined", args[1]);
+               LOG_ERROR("target '%s' not defined", CMD_ARGV[1]);
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
index d32e9ea495a7d69f5cbbbdf6e8d72562e8803d00..f59ed6155d3128809388acf0031813feae17d1d7 100644 (file)
@@ -1065,7 +1065,7 @@ COMMAND_HANDLER(stm32x_handle_options_write_command)
                return ERROR_TARGET_NOT_HALTED;
        }
 
                return ERROR_TARGET_NOT_HALTED;
        }
 
-       if (strcmp(args[1], "SWWDG") == 0)
+       if (strcmp(CMD_ARGV[1], "SWWDG") == 0)
        {
                optionbyte |= (1 << 0);
        }
        {
                optionbyte |= (1 << 0);
        }
@@ -1074,7 +1074,7 @@ COMMAND_HANDLER(stm32x_handle_options_write_command)
                optionbyte &= ~(1 << 0);
        }
 
                optionbyte &= ~(1 << 0);
        }
 
-       if (strcmp(args[2], "NORSTSTNDBY") == 0)
+       if (strcmp(CMD_ARGV[2], "NORSTSTNDBY") == 0)
        {
                optionbyte |= (1 << 1);
        }
        {
                optionbyte |= (1 << 1);
        }
@@ -1083,7 +1083,7 @@ COMMAND_HANDLER(stm32x_handle_options_write_command)
                optionbyte &= ~(1 << 1);
        }
 
                optionbyte &= ~(1 << 1);
        }
 
-       if (strcmp(args[3], "NORSTSTOP") == 0)
+       if (strcmp(CMD_ARGV[3], "NORSTSTOP") == 0)
        {
                optionbyte |= (1 << 2);
        }
        {
                optionbyte |= (1 << 2);
        }
index 134780b1474862d5d8529552d2f966cd550fbe3a..76b646777346201fed21c94659eb7c9ec9eba5d6 100644 (file)
@@ -127,23 +127,23 @@ FLASH_BANK_COMMAND_HANDLER(str7x_flash_bank_command)
        str7x_info->busy_bits = (FLASH_LOCK | FLASH_BSYA1 | FLASH_BSYA0);
        str7x_info->disable_bit = (1 << 1);
 
        str7x_info->busy_bits = (FLASH_LOCK | FLASH_BSYA1 | FLASH_BSYA0);
        str7x_info->disable_bit = (1 << 1);
 
-       if (strcmp(args[6], "STR71x") == 0)
+       if (strcmp(CMD_ARGV[6], "STR71x") == 0)
        {
                str7x_info->register_base = 0x40100000;
        }
        {
                str7x_info->register_base = 0x40100000;
        }
-       else if (strcmp(args[6], "STR73x") == 0)
+       else if (strcmp(CMD_ARGV[6], "STR73x") == 0)
        {
                str7x_info->register_base = 0x80100000;
                str7x_info->busy_bits = (FLASH_LOCK | FLASH_BSYA0);
        }
        {
                str7x_info->register_base = 0x80100000;
                str7x_info->busy_bits = (FLASH_LOCK | FLASH_BSYA0);
        }
-       else if (strcmp(args[6], "STR75x") == 0)
+       else if (strcmp(CMD_ARGV[6], "STR75x") == 0)
        {
                str7x_info->register_base = 0x20100000;
                str7x_info->disable_bit = (1 << 0);
        }
        else
        {
        {
                str7x_info->register_base = 0x20100000;
                str7x_info->disable_bit = (1 << 0);
        }
        else
        {
-               LOG_ERROR("unknown STR7x variant: '%s'", args[6]);
+               LOG_ERROR("unknown STR7x variant: '%s'", CMD_ARGV[6]);
                free(str7x_info);
                return ERROR_FLASH_BANK_INVALID;
        }
                free(str7x_info);
                return ERROR_FLASH_BANK_INVALID;
        }
index c103e572d1a7c95f0593cde04d8a513b9a3b2bd3..50cddaf2c430635b872a717ffc96df88f45842bb 100644 (file)
@@ -647,10 +647,10 @@ COMMAND_HANDLER(str9x_handle_flash_config_command)
                return retval;
 
        uint32_t bbsr, nbbsr, bbadr, nbbadr;
                return retval;
 
        uint32_t bbsr, nbbsr, bbadr, nbbadr;
-       COMMAND_PARSE_NUMBER(u32, args[1], bbsr);
-       COMMAND_PARSE_NUMBER(u32, args[2], nbbsr);
-       COMMAND_PARSE_NUMBER(u32, args[3], bbadr);
-       COMMAND_PARSE_NUMBER(u32, args[4], nbbadr);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], bbsr);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], nbbsr);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[3], bbadr);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[4], nbbadr);
 
        str9x_info = bank->driver_priv;
 
 
        str9x_info = bank->driver_priv;
 
index 73027e454cee2d6a123a089a22af238d6f55819f..a87d0fff46402e6891f2435b79a428b06c7c3f73 100644 (file)
@@ -934,7 +934,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_cmap_command)
 
        str9xpec_info = bank->driver_priv;
 
 
        str9xpec_info = bank->driver_priv;
 
-       if (strcmp(args[1], "bank1") == 0)
+       if (strcmp(CMD_ARGV[1], "bank1") == 0)
        {
                buf_set_u32(str9xpec_info->options, STR9XPEC_OPT_CSMAPBIT, 1, 1);
        }
        {
                buf_set_u32(str9xpec_info->options, STR9XPEC_OPT_CSMAPBIT, 1, 1);
        }
@@ -963,7 +963,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_lvdthd_command)
 
        str9xpec_info = bank->driver_priv;
 
 
        str9xpec_info = bank->driver_priv;
 
-       if (strcmp(args[1], "2.7v") == 0)
+       if (strcmp(CMD_ARGV[1], "2.7v") == 0)
        {
                buf_set_u32(str9xpec_info->options, STR9XPEC_OPT_LVDTHRESBIT, 1, 1);
        }
        {
                buf_set_u32(str9xpec_info->options, STR9XPEC_OPT_LVDTHRESBIT, 1, 1);
        }
@@ -992,7 +992,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_lvdsel_command)
 
        str9xpec_info = bank->driver_priv;
 
 
        str9xpec_info = bank->driver_priv;
 
-       if (strcmp(args[1], "vdd_vddq") == 0)
+       if (strcmp(CMD_ARGV[1], "vdd_vddq") == 0)
        {
                buf_set_u32(str9xpec_info->options, STR9XPEC_OPT_LVDSELBIT, 1, 1);
        }
        {
                buf_set_u32(str9xpec_info->options, STR9XPEC_OPT_LVDSELBIT, 1, 1);
        }
@@ -1021,7 +1021,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_lvdwarn_command)
 
        str9xpec_info = bank->driver_priv;
 
 
        str9xpec_info = bank->driver_priv;
 
-       if (strcmp(args[1], "vdd_vddq") == 0)
+       if (strcmp(CMD_ARGV[1], "vdd_vddq") == 0)
        {
                buf_set_u32(str9xpec_info->options, STR9XPEC_OPT_LVDWARNBIT, 1, 1);
        }
        {
                buf_set_u32(str9xpec_info->options, STR9XPEC_OPT_LVDWARNBIT, 1, 1);
        }
index d52dcc13a829fd1ce998317ae8da6b297fb027b3..890db73411e888fe478a83334258995989a38bc7 100644 (file)
@@ -302,12 +302,12 @@ COMMAND_HANDLER(tms470_handle_flash_keyset_command)
 
                for (i = 0; i < 4; i++)
                {
 
                for (i = 0; i < 4; i++)
                {
-                       int start = (0 == strncmp(args[i], "0x", 2)) ? 2 : 0;
+                       int start = (0 == strncmp(CMD_ARGV[i], "0x", 2)) ? 2 : 0;
 
 
-                       if (1 != sscanf(&args[i][start], "%" SCNx32 "", &flashKeys[i]))
+                       if (1 != sscanf(&CMD_ARGV[i][start], "%" SCNx32 "", &flashKeys[i]))
                        {
                        {
-                               command_print(cmd_ctx, "could not process flash key %s", args[i]);
-                               LOG_ERROR("could not process flash key %s", args[i]);
+                               command_print(cmd_ctx, "could not process flash key %s", CMD_ARGV[i]);
+                               LOG_ERROR("could not process flash key %s", CMD_ARGV[i]);
                                return ERROR_INVALID_ARGUMENTS;
                        }
                }
                                return ERROR_INVALID_ARGUMENTS;
                        }
                }
@@ -362,7 +362,7 @@ COMMAND_HANDLER(tms470_handle_osc_megahertz_command)
        }
        else if (CMD_ARGC == 1)
        {
        }
        else if (CMD_ARGC == 1)
        {
-               sscanf(args[0], "%d", &oscMHz);
+               sscanf(CMD_ARGV[0], "%d", &oscMHz);
        }
 
        if (oscMHz <= 0)
        }
 
        if (oscMHz <= 0)
@@ -391,7 +391,7 @@ COMMAND_HANDLER(tms470_handle_plldis_command)
        }
        else if (CMD_ARGC == 1)
        {
        }
        else if (CMD_ARGC == 1)
        {
-               sscanf(args[0], "%d", &plldis);
+               sscanf(CMD_ARGV[0], "%d", &plldis);
                plldis = plldis ? 1 : 0;
        }
 
                plldis = plldis ? 1 : 0;
        }
 
index b2d1d300666e0a5e20ca956efa86f6494de8be76..df0cb026ace069f6dfa8e14030182b3803bfc9a5 100644 (file)
@@ -32,7 +32,7 @@ static COMMAND_HELPER(handle_hello_args, const char **sep, const char **name)
        if (1 == CMD_ARGC)
        {
                *sep = " ";
        if (1 == CMD_ARGC)
        {
                *sep = " ";
-               *name = args[0];
+               *name = CMD_ARGV[0];
        }
        else
                *sep = *name = "";
        }
        else
                *sep = *name = "";
index 3abfdd67385debac2b4d4bc691e6a7caf918486b..fdb59f01ad7a17d6a699493175a9d956fee674be 100644 (file)
@@ -142,7 +142,7 @@ static int script_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
        log_add_callback(tcl_output, tclOutput);
 
 
        log_add_callback(tcl_output, tclOutput);
 
-       // turn words[0] into args[-1] with this cast
+       // turn words[0] into CMD_ARGV[-1] with this cast
        retval = run_command(context, c, (const char **)words + 1, nwords);
 
        log_remove_callback(tcl_output, tclOutput);
        retval = run_command(context, c, (const char **)words + 1, nwords);
 
        log_remove_callback(tcl_output, tclOutput);
@@ -725,7 +725,7 @@ COMMAND_HANDLER(handle_sleep_command)
        bool busy = false;
        if (CMD_ARGC == 2)
        {
        bool busy = false;
        if (CMD_ARGC == 2)
        {
-               if (strcmp(args[1], "busy") == 0)
+               if (strcmp(CMD_ARGV[1], "busy") == 0)
                        busy = true;
                else
                        return ERROR_COMMAND_SYNTAX_ERROR;
                        busy = true;
                else
                        return ERROR_COMMAND_SYNTAX_ERROR;
@@ -734,7 +734,7 @@ COMMAND_HANDLER(handle_sleep_command)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        unsigned long duration = 0;
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        unsigned long duration = 0;
-       int retval = parse_ulong(args[0], &duration);
+       int retval = parse_ulong(CMD_ARGV[0], &duration);
        if (ERROR_OK != retval)
                return retval;
 
        if (ERROR_OK != retval)
                return retval;
 
@@ -758,7 +758,7 @@ COMMAND_HANDLER(handle_fast_command)
        if (CMD_ARGC != 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        if (CMD_ARGC != 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
-       fast_and_dangerous = strcmp("enable", args[0]) == 0;
+       fast_and_dangerous = strcmp("enable", CMD_ARGV[0]) == 0;
 
        return ERROR_OK;
 }
 
        return ERROR_OK;
 }
index 2e8229c5af7b3d07d2db962c07dcffbb2290a8f9..3fc1a9663653d9ef6baa4f2407bc11344f2c9eea 100644 (file)
@@ -65,7 +65,7 @@ COMMAND_HANDLER(handle_rm_command)
                return ERROR_INVALID_ARGUMENTS;
        }
 
                return ERROR_INVALID_ARGUMENTS;
        }
 
-       if (unlink(args[0]) != 0)
+       if (unlink(CMD_ARGV[0]) != 0)
        {
                command_print(cmd_ctx, "failed: %d", errno);
        }
        {
                command_print(cmd_ctx, "failed: %d", errno);
        }
@@ -145,7 +145,7 @@ COMMAND_HANDLER(handle_cat_command)
        void *data;
        size_t len;
 
        void *data;
        size_t len;
 
-       int retval = loadFile(args[0], &data, &len);
+       int retval = loadFile(CMD_ARGV[0], &data, &len);
        if (retval == ERROR_OK)
        {
                command_print(cmd_ctx, "%s", (char *)data);
        if (retval == ERROR_OK)
        {
                command_print(cmd_ctx, "%s", (char *)data);
@@ -153,7 +153,7 @@ COMMAND_HANDLER(handle_cat_command)
        }
        else
        {
        }
        else
        {
-               command_print(cmd_ctx, "%s not found %d", args[0], retval);
+               command_print(cmd_ctx, "%s not found %d", CMD_ARGV[0], retval);
        }
 
        return ERROR_OK;
        }
 
        return ERROR_OK;
@@ -168,7 +168,7 @@ COMMAND_HANDLER(handle_trunc_command)
        }
 
        FILE *config_file = NULL;
        }
 
        FILE *config_file = NULL;
-       config_file = fopen(args[0], "w");
+       config_file = fopen(CMD_ARGV[0], "w");
        if (config_file != NULL)
                fclose(config_file);
 
        if (config_file != NULL)
                fclose(config_file);
 
@@ -211,7 +211,7 @@ COMMAND_HANDLER(handle_append_command)
 
        int retval = ERROR_FAIL;
        FILE *config_file = NULL;
 
        int retval = ERROR_FAIL;
        FILE *config_file = NULL;
-       config_file = fopen(args[0], "a");
+       config_file = fopen(CMD_ARGV[0], "a");
        if (config_file != NULL)
        {
                fseek(config_file, 0, SEEK_END);
        if (config_file != NULL)
        {
                fseek(config_file, 0, SEEK_END);
@@ -219,7 +219,7 @@ COMMAND_HANDLER(handle_append_command)
                unsigned i;
                for (i = 1; i < CMD_ARGC; i++)
                {
                unsigned i;
                for (i = 1; i < CMD_ARGC; i++)
                {
-                       if (fwrite(args[i], 1, strlen(args[i]), config_file) != strlen(args[i]))
+                       if (fwrite(CMD_ARGV[i], 1, strlen(CMD_ARGV[i]), config_file) != strlen(CMD_ARGV[i]))
                                break;
                        if (i != CMD_ARGC - 1)
                        {
                                break;
                        if (i != CMD_ARGC - 1)
                        {
@@ -250,11 +250,11 @@ COMMAND_HANDLER(handle_cp_command)
        void *data;
        size_t len;
 
        void *data;
        size_t len;
 
-       int retval = loadFile(args[0], &data, &len);
+       int retval = loadFile(CMD_ARGV[0], &data, &len);
        if (retval != ERROR_OK)
                return retval;
 
        if (retval != ERROR_OK)
                return retval;
 
-       FILE *f = fopen(args[1], "wb");
+       FILE *f = fopen(CMD_ARGV[1], "wb");
        if (f == NULL)
                retval = ERROR_INVALID_ARGUMENTS;
 
        if (f == NULL)
                retval = ERROR_INVALID_ARGUMENTS;
 
@@ -286,7 +286,7 @@ COMMAND_HANDLER(handle_cp_command)
 
        if (retval == ERROR_OK)
        {
 
        if (retval == ERROR_OK)
        {
-               command_print(cmd_ctx, "Copied %s to %s", args[0], args[1]);
+               command_print(cmd_ctx, "Copied %s to %s", CMD_ARGV[0], CMD_ARGV[1]);
        } else
        {
                command_print(cmd_ctx, "Failed: %d", retval);
        } else
        {
                command_print(cmd_ctx, "Failed: %d", retval);
@@ -298,7 +298,7 @@ COMMAND_HANDLER(handle_cp_command)
                fclose(f);
 
        if (retval != ERROR_OK)
                fclose(f);
 
        if (retval != ERROR_OK)
-               unlink(args[1]);
+               unlink(CMD_ARGV[1]);
 
        return retval;
 }
 
        return retval;
 }
index 715f2fa60b711368b8cb0899d3a01ad3fd9315cf..0e04c8e1b2ab1c2f4902b04ec1e4a384b0f81f0c 100644 (file)
@@ -278,7 +278,7 @@ COMMAND_HANDLER(handle_debug_level_command)
        if (CMD_ARGC == 1)
        {
                unsigned new_level;
        if (CMD_ARGC == 1)
        {
                unsigned new_level;
-               COMMAND_PARSE_NUMBER(uint, args[0], new_level);
+               COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], new_level);
                debug_level = MIN(new_level, LOG_LVL_DEBUG);
        }
        else if (CMD_ARGC > 1)
                debug_level = MIN(new_level, LOG_LVL_DEBUG);
        }
        else if (CMD_ARGC > 1)
@@ -305,7 +305,7 @@ COMMAND_HANDLER(handle_log_output_command)
 {
        if (CMD_ARGC == 1)
        {
 {
        if (CMD_ARGC == 1)
        {
-               FILE* file = fopen(args[0], "w");
+               FILE* file = fopen(CMD_ARGV[0], "w");
 
                if (file)
                {
 
                if (file)
                {
index 949acec2986f1f5ac2e96fe16908974d47c58dbe..d35b0c21b111466f4b7dc27b799ac2659fdac6db 100644 (file)
@@ -503,7 +503,7 @@ COMMAND_HANDLER(amt_jtagaccel_handle_parport_port_command)
                if (amt_jtagaccel_port == 0)
                {
                        uint16_t port;
                if (amt_jtagaccel_port == 0)
                {
                        uint16_t port;
-                       COMMAND_PARSE_NUMBER(u16, args[0], port);
+                       COMMAND_PARSE_NUMBER(u16, CMD_ARGV[0], port);
                        amt_jtagaccel_port = port;
                }
                else
                        amt_jtagaccel_port = port;
                }
                else
@@ -527,7 +527,7 @@ COMMAND_HANDLER(amt_jtagaccel_handle_rtck_command)
        }
        else
        {
        }
        else
        {
-               if (strcmp(args[0], "enabled") == 0)
+               if (strcmp(CMD_ARGV[0], "enabled") == 0)
                {
                        rtck_enabled = 1;
                }
                {
                        rtck_enabled = 1;
                }
index 90d94c958b14245d4fb7a2510fdd8e6b07d387f0..8fbdf3942394dc7c4bd7cc7010e820c27de693d8 100644 (file)
@@ -185,7 +185,7 @@ static int at91rm9200_speed(int speed)
        return ERROR_OK;
 }
 
        return ERROR_OK;
 }
 
-static int at91rm9200_handle_device_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc)
+static int at91rm9200_handle_device_command(struct command_context *cmd_ctx, char *cmd, char **CMD_ARGV, int argc)
 {
        if (CMD_ARGC == 0)
                return ERROR_OK;
 {
        if (CMD_ARGC == 0)
                return ERROR_OK;
@@ -193,8 +193,8 @@ static int at91rm9200_handle_device_command(struct command_context *cmd_ctx, cha
        /* only if the device name wasn't overwritten by cmdline */
        if (at91rm9200_device == 0)
        {
        /* only if the device name wasn't overwritten by cmdline */
        if (at91rm9200_device == 0)
        {
-               at91rm9200_device = malloc(strlen(args[0]) + sizeof(char));
-               strcpy(at91rm9200_device, args[0]);
+               at91rm9200_device = malloc(strlen(CMD_ARGV[0]) + sizeof(char));
+               strcpy(at91rm9200_device, CMD_ARGV[0]);
        }
 
        return ERROR_OK;
        }
 
        return ERROR_OK;
index c1b3f1023a46d12f9a80e0a6f9f17b6fa67ff5d8..451da41c052f82ab4e9e3038a8b586d1a1c88c5a 100644 (file)
@@ -2803,7 +2803,7 @@ COMMAND_HANDLER(ft2232_handle_device_desc_command)
        char buf[200];
        if (CMD_ARGC == 1)
        {
        char buf[200];
        if (CMD_ARGC == 1)
        {
-               ft2232_device_desc = strdup(args[0]);
+               ft2232_device_desc = strdup(CMD_ARGV[0]);
                cp = strchr(ft2232_device_desc, 0);
                /* under Win32, the FTD2XX driver appends an "A" to the end
                 * of the description, this examines the given desc
                cp = strchr(ft2232_device_desc, 0);
                /* under Win32, the FTD2XX driver appends an "A" to the end
                 * of the description, this examines the given desc
@@ -2835,7 +2835,7 @@ COMMAND_HANDLER(ft2232_handle_serial_command)
 {
        if (CMD_ARGC == 1)
        {
 {
        if (CMD_ARGC == 1)
        {
-               ft2232_serial = strdup(args[0]);
+               ft2232_serial = strdup(CMD_ARGV[0]);
        }
        else
        {
        }
        else
        {
@@ -2850,8 +2850,8 @@ COMMAND_HANDLER(ft2232_handle_layout_command)
        if (CMD_ARGC == 0)
                return ERROR_OK;
 
        if (CMD_ARGC == 0)
                return ERROR_OK;
 
-       ft2232_layout = malloc(strlen(args[0]) + 1);
-       strcpy(ft2232_layout, args[0]);
+       ft2232_layout = malloc(strlen(CMD_ARGV[0]) + 1);
+       strcpy(ft2232_layout, CMD_ARGV[0]);
 
        return ERROR_OK;
 }
 
        return ERROR_OK;
 }
@@ -2876,8 +2876,8 @@ COMMAND_HANDLER(ft2232_handle_vid_pid_command)
        unsigned i;
        for (i = 0; i < CMD_ARGC; i += 2)
        {
        unsigned i;
        for (i = 0; i < CMD_ARGC; i += 2)
        {
-               COMMAND_PARSE_NUMBER(u16, args[i], ft2232_vid[i >> 1]);
-               COMMAND_PARSE_NUMBER(u16, args[i + 1], ft2232_pid[i >> 1]);
+               COMMAND_PARSE_NUMBER(u16, CMD_ARGV[i], ft2232_vid[i >> 1]);
+               COMMAND_PARSE_NUMBER(u16, CMD_ARGV[i + 1], ft2232_pid[i >> 1]);
        }
 
        /*
        }
 
        /*
@@ -2893,7 +2893,7 @@ COMMAND_HANDLER(ft2232_handle_latency_command)
 {
        if (CMD_ARGC == 1)
        {
 {
        if (CMD_ARGC == 1)
        {
-               ft2232_latency = atoi(args[0]);
+               ft2232_latency = atoi(CMD_ARGV[0]);
        }
        else
        {
        }
        else
        {
index d1da2a13a9f06933086801ce926b579a9e3b5c2a..d0cdde6bdac21a2036f590044285ec345aed33ab 100644 (file)
@@ -548,7 +548,7 @@ COMMAND_HANDLER(gw16012_handle_parport_port_command)
                /* only if the port wasn't overwritten by cmdline */
                if (gw16012_port == 0)
                {
                /* only if the port wasn't overwritten by cmdline */
                if (gw16012_port == 0)
                {
-                       COMMAND_PARSE_NUMBER(u16, args[0], gw16012_port);
+                       COMMAND_PARSE_NUMBER(u16, CMD_ARGV[0], gw16012_port);
                }
                else
                {
                }
                else
                {
index 41b99a1434665c551b4a912a302dae5a4acdb8b6..80e7150246c7a85b0cb6e08ce8682c660db24205 100644 (file)
@@ -632,7 +632,7 @@ COMMAND_HANDLER(jlink_handle_jlink_hw_jtag_command)
                command_print(cmd_ctx, "jlink hw jtag  %i", jlink_hw_jtag_version);
                break;
        case 1: {
                command_print(cmd_ctx, "jlink hw jtag  %i", jlink_hw_jtag_version);
                break;
        case 1: {
-               int request_version = atoi(args[0]);
+               int request_version = atoi(CMD_ARGV[0]);
                switch (request_version) {
                case 2: case 3:
                        jlink_hw_jtag_version = request_version;
                switch (request_version) {
                case 2: case 3:
                        jlink_hw_jtag_version = request_version;
index 52289c5e0edcbbcc1978f974c9e709a7b0ddff8d..e15c66d1468cdd457f2607e50c188876cbd131ce 100644 (file)
@@ -416,7 +416,7 @@ COMMAND_HANDLER(parport_handle_parport_port_command)
                /* only if the port wasn't overwritten by cmdline */
                if (parport_port == 0)
                {
                /* only if the port wasn't overwritten by cmdline */
                if (parport_port == 0)
                {
-                       COMMAND_PARSE_NUMBER(u16, args[0], parport_port);
+                       COMMAND_PARSE_NUMBER(u16, CMD_ARGV[0], parport_port);
                }
                else
                {
                }
                else
                {
@@ -438,8 +438,8 @@ COMMAND_HANDLER(parport_handle_parport_cable_command)
        /* only if the cable name wasn't overwritten by cmdline */
        if (parport_cable == 0)
        {
        /* only if the cable name wasn't overwritten by cmdline */
        if (parport_cable == 0)
        {
-               parport_cable = malloc(strlen(args[0]) + sizeof(char));
-               strcpy(parport_cable, args[0]);
+               parport_cable = malloc(strlen(CMD_ARGV[0]) + sizeof(char));
+               strcpy(parport_cable, CMD_ARGV[0]);
        }
 
        return ERROR_OK;
        }
 
        return ERROR_OK;
@@ -453,9 +453,9 @@ COMMAND_HANDLER(parport_handle_write_on_exit_command)
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
-       if (strcmp(args[0], "on") == 0)
+       if (strcmp(CMD_ARGV[0], "on") == 0)
                parport_exit = 1;
                parport_exit = 1;
-       else if (strcmp(args[0], "off") == 0)
+       else if (strcmp(CMD_ARGV[0], "off") == 0)
                parport_exit = 0;
 
        return ERROR_OK;
                parport_exit = 0;
 
        return ERROR_OK;
@@ -465,7 +465,7 @@ COMMAND_HANDLER(parport_handle_parport_toggling_time_command)
 {
        if (CMD_ARGC == 1) {
                uint32_t ns;
 {
        if (CMD_ARGC == 1) {
                uint32_t ns;
-               int retval = parse_u32(args[0], &ns);
+               int retval = parse_u32(CMD_ARGV[0], &ns);
 
                if (ERROR_OK != retval)
                        return retval;
 
                if (ERROR_OK != retval)
                        return retval;
index 45d99fff38aafedd14c83a462be7660b0f0dafef..1d6bc1db3f39e2f80b75f11101505ddefb8c5e13 100644 (file)
@@ -756,7 +756,7 @@ COMMAND_HANDLER(presto_handle_serial_command)
        {
                if (presto_serial)
                        free(presto_serial);
        {
                if (presto_serial)
                        free(presto_serial);
-               presto_serial = strdup(args[0]);
+               presto_serial = strdup(CMD_ARGV[0]);
        }
        else
        {
        }
        else
        {
index bd3f704a89949bc8e9660b721984c75fcc49162a..1eead8d939fb9f6a75111b2310e2090cb4ba422b 100644 (file)
@@ -628,12 +628,12 @@ COMMAND_HANDLER(handle_interface_command)
        }
 
        /* interface name is a mandatory argument */
        }
 
        /* interface name is a mandatory argument */
-       if (CMD_ARGC != 1 || args[0][0] == '\0')
+       if (CMD_ARGC != 1 || CMD_ARGV[0][0] == '\0')
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        for (unsigned i = 0; NULL != jtag_interfaces[i]; i++)
        {
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        for (unsigned i = 0; NULL != jtag_interfaces[i]; i++)
        {
-               if (strcmp(args[0], jtag_interfaces[i]->name) != 0)
+               if (strcmp(CMD_ARGV[0], jtag_interfaces[i]->name) != 0)
                        continue;
 
                int retval = jtag_interfaces[i]->register_commands(cmd_ctx);
                        continue;
 
                int retval = jtag_interfaces[i]->register_commands(cmd_ctx);
@@ -657,7 +657,7 @@ COMMAND_HANDLER(handle_interface_command)
        /* no valid interface was found (i.e. the configuration option,
         * didn't match one of the compiled-in interfaces
         */
        /* no valid interface was found (i.e. the configuration option,
         * didn't match one of the compiled-in interfaces
         */
-       LOG_ERROR("The specified JTAG interface was not found (%s)", args[0]);
+       LOG_ERROR("The specified JTAG interface was not found (%s)", CMD_ARGV[0]);
        CALL_COMMAND_HANDLER(handle_interface_list_command);
        return ERROR_JTAG_INVALID_INTERFACE;
 }
        CALL_COMMAND_HANDLER(handle_interface_list_command);
        return ERROR_JTAG_INVALID_INTERFACE;
 }
@@ -711,21 +711,21 @@ COMMAND_HANDLER(handle_reset_config_command)
         * Here we don't care about the order, and only change values
         * which have been explicitly specified.
         */
         * Here we don't care about the order, and only change values
         * which have been explicitly specified.
         */
-       for (; CMD_ARGC; CMD_ARGC--, args++) {
+       for (; CMD_ARGC; CMD_ARGC--, CMD_ARGV++) {
                int tmp = 0;
                int m;
 
                /* gating */
                m = RESET_SRST_NO_GATING;
                int tmp = 0;
                int m;
 
                /* gating */
                m = RESET_SRST_NO_GATING;
-               if (strcmp(*args, "srst_gates_jtag") == 0)
+               if (strcmp(*CMD_ARGV, "srst_gates_jtag") == 0)
                        /* default: don't use JTAG while SRST asserted */;
                        /* default: don't use JTAG while SRST asserted */;
-               else if (strcmp(*args, "srst_nogate") == 0)
+               else if (strcmp(*CMD_ARGV, "srst_nogate") == 0)
                        tmp = RESET_SRST_NO_GATING;
                else
                        m = 0;
                if (mask & m) {
                        LOG_ERROR("extra reset_config %s spec (%s)",
                        tmp = RESET_SRST_NO_GATING;
                else
                        m = 0;
                if (mask & m) {
                        LOG_ERROR("extra reset_config %s spec (%s)",
-                                       "gating", *args);
+                                       "gating", *CMD_ARGV);
                        return ERROR_INVALID_ARGUMENTS;
                }
                if (m)
                        return ERROR_INVALID_ARGUMENTS;
                }
                if (m)
@@ -733,19 +733,19 @@ COMMAND_HANDLER(handle_reset_config_command)
 
                /* signals */
                m = RESET_HAS_TRST | RESET_HAS_SRST;
 
                /* signals */
                m = RESET_HAS_TRST | RESET_HAS_SRST;
-               if (strcmp(*args, "none") == 0)
+               if (strcmp(*CMD_ARGV, "none") == 0)
                        tmp = RESET_NONE;
                        tmp = RESET_NONE;
-               else if (strcmp(*args, "trst_only") == 0)
+               else if (strcmp(*CMD_ARGV, "trst_only") == 0)
                        tmp = RESET_HAS_TRST;
                        tmp = RESET_HAS_TRST;
-               else if (strcmp(*args, "srst_only") == 0)
+               else if (strcmp(*CMD_ARGV, "srst_only") == 0)
                        tmp = RESET_HAS_SRST;
                        tmp = RESET_HAS_SRST;
-               else if (strcmp(*args, "trst_and_srst") == 0)
+               else if (strcmp(*CMD_ARGV, "trst_and_srst") == 0)
                        tmp = RESET_HAS_TRST | RESET_HAS_SRST;
                else
                        m = 0;
                if (mask & m) {
                        LOG_ERROR("extra reset_config %s spec (%s)",
                        tmp = RESET_HAS_TRST | RESET_HAS_SRST;
                else
                        m = 0;
                if (mask & m) {
                        LOG_ERROR("extra reset_config %s spec (%s)",
-                                       "signal", *args);
+                                       "signal", *CMD_ARGV);
                        return ERROR_INVALID_ARGUMENTS;
                }
                if (m)
                        return ERROR_INVALID_ARGUMENTS;
                }
                if (m)
@@ -753,19 +753,19 @@ COMMAND_HANDLER(handle_reset_config_command)
 
                /* combination (options for broken wiring) */
                m = RESET_SRST_PULLS_TRST | RESET_TRST_PULLS_SRST;
 
                /* combination (options for broken wiring) */
                m = RESET_SRST_PULLS_TRST | RESET_TRST_PULLS_SRST;
-               if (strcmp(*args, "separate") == 0)
+               if (strcmp(*CMD_ARGV, "separate") == 0)
                        /* separate reset lines - default */;
                        /* separate reset lines - default */;
-               else if (strcmp(*args, "srst_pulls_trst") == 0)
+               else if (strcmp(*CMD_ARGV, "srst_pulls_trst") == 0)
                        tmp |= RESET_SRST_PULLS_TRST;
                        tmp |= RESET_SRST_PULLS_TRST;
-               else if (strcmp(*args, "trst_pulls_srst") == 0)
+               else if (strcmp(*CMD_ARGV, "trst_pulls_srst") == 0)
                        tmp |= RESET_TRST_PULLS_SRST;
                        tmp |= RESET_TRST_PULLS_SRST;
-               else if (strcmp(*args, "combined") == 0)
+               else if (strcmp(*CMD_ARGV, "combined") == 0)
                        tmp |= RESET_SRST_PULLS_TRST | RESET_TRST_PULLS_SRST;
                else
                        m = 0;
                if (mask & m) {
                        LOG_ERROR("extra reset_config %s spec (%s)",
                        tmp |= RESET_SRST_PULLS_TRST | RESET_TRST_PULLS_SRST;
                else
                        m = 0;
                if (mask & m) {
                        LOG_ERROR("extra reset_config %s spec (%s)",
-                                       "combination", *args);
+                                       "combination", *CMD_ARGV);
                        return ERROR_INVALID_ARGUMENTS;
                }
                if (m)
                        return ERROR_INVALID_ARGUMENTS;
                }
                if (m)
@@ -773,15 +773,15 @@ COMMAND_HANDLER(handle_reset_config_command)
 
                /* trst_type (NOP without HAS_TRST) */
                m = RESET_TRST_OPEN_DRAIN;
 
                /* trst_type (NOP without HAS_TRST) */
                m = RESET_TRST_OPEN_DRAIN;
-               if (strcmp(*args, "trst_open_drain") == 0)
+               if (strcmp(*CMD_ARGV, "trst_open_drain") == 0)
                        tmp |= RESET_TRST_OPEN_DRAIN;
                        tmp |= RESET_TRST_OPEN_DRAIN;
-               else if (strcmp(*args, "trst_push_pull") == 0)
+               else if (strcmp(*CMD_ARGV, "trst_push_pull") == 0)
                        /* push/pull from adapter - default */;
                else
                        m = 0;
                if (mask & m) {
                        LOG_ERROR("extra reset_config %s spec (%s)",
                        /* push/pull from adapter - default */;
                else
                        m = 0;
                if (mask & m) {
                        LOG_ERROR("extra reset_config %s spec (%s)",
-                                       "trst_type", *args);
+                                       "trst_type", *CMD_ARGV);
                        return ERROR_INVALID_ARGUMENTS;
                }
                if (m)
                        return ERROR_INVALID_ARGUMENTS;
                }
                if (m)
@@ -789,22 +789,22 @@ COMMAND_HANDLER(handle_reset_config_command)
 
                /* srst_type (NOP without HAS_SRST) */
                m |= RESET_SRST_PUSH_PULL;
 
                /* srst_type (NOP without HAS_SRST) */
                m |= RESET_SRST_PUSH_PULL;
-               if (strcmp(*args, "srst_push_pull") == 0)
+               if (strcmp(*CMD_ARGV, "srst_push_pull") == 0)
                        tmp |= RESET_SRST_PUSH_PULL;
                        tmp |= RESET_SRST_PUSH_PULL;
-               else if (strcmp(*args, "srst_open_drain") == 0)
+               else if (strcmp(*CMD_ARGV, "srst_open_drain") == 0)
                        /* open drain from adapter - default */;
                else
                        m = 0;
                if (mask & m) {
                        LOG_ERROR("extra reset_config %s spec (%s)",
                        /* open drain from adapter - default */;
                else
                        m = 0;
                if (mask & m) {
                        LOG_ERROR("extra reset_config %s spec (%s)",
-                                       "srst_type", *args);
+                                       "srst_type", *CMD_ARGV);
                        return ERROR_INVALID_ARGUMENTS;
                }
                if (m)
                        goto next;
 
                /* caller provided nonsense; fail */
                        return ERROR_INVALID_ARGUMENTS;
                }
                if (m)
                        goto next;
 
                /* caller provided nonsense; fail */
-               LOG_ERROR("unknown reset_config flag (%s)", *args);
+               LOG_ERROR("unknown reset_config flag (%s)", *CMD_ARGV);
                return ERROR_INVALID_ARGUMENTS;
 
 next:
                return ERROR_INVALID_ARGUMENTS;
 
 next:
@@ -902,7 +902,7 @@ COMMAND_HANDLER(handle_jtag_nsrst_delay_command)
        if (CMD_ARGC == 1)
        {
                unsigned delay;
        if (CMD_ARGC == 1)
        {
                unsigned delay;
-               COMMAND_PARSE_NUMBER(uint, args[0], delay);
+               COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], delay);
 
                jtag_set_nsrst_delay(delay);
        }
 
                jtag_set_nsrst_delay(delay);
        }
@@ -917,7 +917,7 @@ COMMAND_HANDLER(handle_jtag_ntrst_delay_command)
        if (CMD_ARGC == 1)
        {
                unsigned delay;
        if (CMD_ARGC == 1)
        {
                unsigned delay;
-               COMMAND_PARSE_NUMBER(uint, args[0], delay);
+               COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], delay);
 
                jtag_set_ntrst_delay(delay);
        }
 
                jtag_set_ntrst_delay(delay);
        }
@@ -932,7 +932,7 @@ COMMAND_HANDLER(handle_jtag_nsrst_assert_width_command)
        if (CMD_ARGC == 1)
        {
                unsigned delay;
        if (CMD_ARGC == 1)
        {
                unsigned delay;
-               COMMAND_PARSE_NUMBER(uint, args[0], delay);
+               COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], delay);
 
                jtag_set_nsrst_assert_width(delay);
        }
 
                jtag_set_nsrst_assert_width(delay);
        }
@@ -947,7 +947,7 @@ COMMAND_HANDLER(handle_jtag_ntrst_assert_width_command)
        if (CMD_ARGC == 1)
        {
                unsigned delay;
        if (CMD_ARGC == 1)
        {
                unsigned delay;
-               COMMAND_PARSE_NUMBER(uint, args[0], delay);
+               COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], delay);
 
                jtag_set_ntrst_assert_width(delay);
        }
 
                jtag_set_ntrst_assert_width(delay);
        }
@@ -964,7 +964,7 @@ COMMAND_HANDLER(handle_jtag_khz_command)
        if (CMD_ARGC == 1)
        {
                unsigned khz = 0;
        if (CMD_ARGC == 1)
        {
                unsigned khz = 0;
-               COMMAND_PARSE_NUMBER(uint, args[0], khz);
+               COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], khz);
 
                retval = jtag_config_khz(khz);
                if (ERROR_OK != retval)
 
                retval = jtag_config_khz(khz);
                if (ERROR_OK != retval)
@@ -993,7 +993,7 @@ COMMAND_HANDLER(handle_jtag_rclk_command)
        if (CMD_ARGC == 1)
        {
                unsigned khz = 0;
        if (CMD_ARGC == 1)
        {
                unsigned khz = 0;
-               COMMAND_PARSE_NUMBER(uint, args[0], khz);
+               COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], khz);
 
                retval = jtag_config_rclk(khz);
                if (ERROR_OK != retval)
 
                retval = jtag_config_rclk(khz);
                if (ERROR_OK != retval)
@@ -1019,17 +1019,17 @@ COMMAND_HANDLER(handle_jtag_reset_command)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        int trst = -1;
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        int trst = -1;
-       if (args[0][0] == '1')
+       if (CMD_ARGV[0][0] == '1')
                trst = 1;
                trst = 1;
-       else if (args[0][0] == '0')
+       else if (CMD_ARGV[0][0] == '0')
                trst = 0;
        else
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        int srst = -1;
                trst = 0;
        else
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        int srst = -1;
-       if (args[1][0] == '1')
+       if (CMD_ARGV[1][0] == '1')
                srst = 1;
                srst = 1;
-       else if (args[1][0] == '0')
+       else if (CMD_ARGV[1][0] == '0')
                srst = 0;
        else
                return ERROR_COMMAND_SYNTAX_ERROR;
                srst = 0;
        else
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -1047,7 +1047,7 @@ COMMAND_HANDLER(handle_runtest_command)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        unsigned num_clocks;
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        unsigned num_clocks;
-       COMMAND_PARSE_NUMBER(uint, args[0], num_clocks);
+       COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], num_clocks);
 
        jtag_add_runtest(num_clocks, TAP_IDLE);
        return jtag_execute_queue();
 
        jtag_add_runtest(num_clocks, TAP_IDLE);
        return jtag_execute_queue();
@@ -1096,13 +1096,13 @@ COMMAND_HANDLER(handle_irscan_command)
        if (CMD_ARGC >= 4) {
                /* have at least one pair of numbers. */
                /* is last pair the magic text? */
        if (CMD_ARGC >= 4) {
                /* have at least one pair of numbers. */
                /* is last pair the magic text? */
-               if (strcmp("-endstate", args[CMD_ARGC - 2]) == 0) {
-                       endstate = tap_state_by_name(args[CMD_ARGC - 1]);
+               if (strcmp("-endstate", CMD_ARGV[CMD_ARGC - 2]) == 0) {
+                       endstate = tap_state_by_name(CMD_ARGV[CMD_ARGC - 1]);
                        if (endstate == TAP_INVALID)
                                return ERROR_COMMAND_SYNTAX_ERROR;
                        if (!scan_is_safe(endstate))
                                LOG_WARNING("unstable irscan endstate \"%s\"",
                        if (endstate == TAP_INVALID)
                                return ERROR_COMMAND_SYNTAX_ERROR;
                        if (!scan_is_safe(endstate))
                                LOG_WARNING("unstable irscan endstate \"%s\"",
-                                               args[CMD_ARGC - 1]);
+                                               CMD_ARGV[CMD_ARGC - 1]);
                        CMD_ARGC -= 2;
                }
        }
                        CMD_ARGC -= 2;
                }
        }
@@ -1115,14 +1115,14 @@ COMMAND_HANDLER(handle_irscan_command)
        int retval;
        for (i = 0; i < num_fields; i++)
        {
        int retval;
        for (i = 0; i < num_fields; i++)
        {
-               tap = jtag_tap_by_string(args[i*2]);
+               tap = jtag_tap_by_string(CMD_ARGV[i*2]);
                if (tap == NULL)
                {
                        int j;
                        for (j = 0; j < i; j++)
                                free(fields[j].out_value);
                         free(fields);
                if (tap == NULL)
                {
                        int j;
                        for (j = 0; j < i; j++)
                                free(fields[j].out_value);
                         free(fields);
-                       command_print(cmd_ctx, "Tap: %s unknown", args[i*2]);
+                       command_print(cmd_ctx, "Tap: %s unknown", CMD_ARGV[i*2]);
 
                        return ERROR_FAIL;
                }
 
                        return ERROR_FAIL;
                }
@@ -1132,7 +1132,7 @@ COMMAND_HANDLER(handle_irscan_command)
                fields[i].out_value = malloc(DIV_ROUND_UP(field_size, 8));
 
                uint32_t value;
                fields[i].out_value = malloc(DIV_ROUND_UP(field_size, 8));
 
                uint32_t value;
-               retval = parse_u32(args[i * 2 + 1], &value);
+               retval = parse_u32(CMD_ARGV[i * 2 + 1], &value);
                if (ERROR_OK != retval)
                        goto error_return;
                buf_set_u32(fields[i].out_value, 0, field_size, value);
                if (ERROR_OK != retval)
                        goto error_return;
                buf_set_u32(fields[i].out_value, 0, field_size, value);
@@ -1357,9 +1357,9 @@ COMMAND_HANDLER(handle_verify_ircapture_command)
 
        if (CMD_ARGC == 1)
        {
 
        if (CMD_ARGC == 1)
        {
-               if (strcmp(args[0], "enable") == 0)
+               if (strcmp(CMD_ARGV[0], "enable") == 0)
                        jtag_set_verify_capture_ir(true);
                        jtag_set_verify_capture_ir(true);
-               else if (strcmp(args[0], "disable") == 0)
+               else if (strcmp(CMD_ARGV[0], "disable") == 0)
                        jtag_set_verify_capture_ir(false);
                else
                        return ERROR_COMMAND_SYNTAX_ERROR;
                        jtag_set_verify_capture_ir(false);
                else
                        return ERROR_COMMAND_SYNTAX_ERROR;
@@ -1378,9 +1378,9 @@ COMMAND_HANDLER(handle_verify_jtag_command)
 
        if (CMD_ARGC == 1)
        {
 
        if (CMD_ARGC == 1)
        {
-               if (strcmp(args[0], "enable") == 0)
+               if (strcmp(CMD_ARGV[0], "enable") == 0)
                        jtag_set_verify(true);
                        jtag_set_verify(true);
-               else if (strcmp(args[0], "disable") == 0)
+               else if (strcmp(CMD_ARGV[0], "disable") == 0)
                        jtag_set_verify(false);
                else
                        return ERROR_COMMAND_SYNTAX_ERROR;
                        jtag_set_verify(false);
                else
                        return ERROR_COMMAND_SYNTAX_ERROR;
@@ -1400,9 +1400,9 @@ COMMAND_HANDLER(handle_tms_sequence_command)
        if (CMD_ARGC == 1)
        {
                bool use_new_table;
        if (CMD_ARGC == 1)
        {
                bool use_new_table;
-               if (strcmp(args[0], "short") == 0)
+               if (strcmp(CMD_ARGV[0], "short") == 0)
                        use_new_table = true;
                        use_new_table = true;
-               else if (strcmp(args[0], "long") == 0)
+               else if (strcmp(CMD_ARGV[0], "long") == 0)
                        use_new_table = false;
                else
                        return ERROR_COMMAND_SYNTAX_ERROR;
                        use_new_table = false;
                else
                        return ERROR_COMMAND_SYNTAX_ERROR;
index cbea9956922cfde7f15090f6b799f06eca5e2d90..7962249c623579660bbdb0e9c0455658a0ba3fe5 100644 (file)
@@ -1329,17 +1329,17 @@ COMMAND_HANDLER(vsllink_handle_mode_command)
                return ERROR_FAIL;
        }
 
                return ERROR_FAIL;
        }
 
-       if (!strcmp(args[0], "normal"))
+       if (!strcmp(CMD_ARGV[0], "normal"))
        {
                vsllink_mode = VSLLINK_MODE_NORMAL;
        }
        {
                vsllink_mode = VSLLINK_MODE_NORMAL;
        }
-       else if (!strcmp(args[0], "dma"))
+       else if (!strcmp(CMD_ARGV[0], "dma"))
        {
                vsllink_mode = VSLLINK_MODE_DMA;
        }
        else
        {
        {
                vsllink_mode = VSLLINK_MODE_DMA;
        }
        else
        {
-               LOG_ERROR("invalid vsllink_mode: %s", args[0]);
+               LOG_ERROR("invalid vsllink_mode: %s", CMD_ARGV[0]);
                return ERROR_FAIL;
        }
 
                return ERROR_FAIL;
        }
 
@@ -1354,7 +1354,7 @@ COMMAND_HANDLER(vsllink_handle_usb_vid_command)
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
-       COMMAND_PARSE_NUMBER(u16, args[0], vsllink_usb_vid);
+       COMMAND_PARSE_NUMBER(u16, CMD_ARGV[0], vsllink_usb_vid);
        return ERROR_OK;
 }
 
        return ERROR_OK;
 }
 
@@ -1365,7 +1365,7 @@ COMMAND_HANDLER(vsllink_handle_usb_pid_command)
                LOG_ERROR("parameter error, should be one parameter for PID");
                return ERROR_OK;
        }
                LOG_ERROR("parameter error, should be one parameter for PID");
                return ERROR_OK;
        }
-       COMMAND_PARSE_NUMBER(u16, args[0], vsllink_usb_pid);
+       COMMAND_PARSE_NUMBER(u16, CMD_ARGV[0], vsllink_usb_pid);
        return ERROR_OK;
 }
 
        return ERROR_OK;
 }
 
@@ -1377,7 +1377,7 @@ COMMAND_HANDLER(vsllink_handle_usb_bulkin_command)
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
-       COMMAND_PARSE_NUMBER(u8, args[0], vsllink_usb_bulkin);
+       COMMAND_PARSE_NUMBER(u8, CMD_ARGV[0], vsllink_usb_bulkin);
 
        vsllink_usb_bulkin |= 0x80;
 
 
        vsllink_usb_bulkin |= 0x80;
 
@@ -1392,7 +1392,7 @@ COMMAND_HANDLER(vsllink_handle_usb_bulkout_command)
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
-       COMMAND_PARSE_NUMBER(u8, args[0], vsllink_usb_bulkout);
+       COMMAND_PARSE_NUMBER(u8, CMD_ARGV[0], vsllink_usb_bulkout);
 
        vsllink_usb_bulkout &= ~0x80;
 
 
        vsllink_usb_bulkout &= ~0x80;
 
@@ -1407,7 +1407,7 @@ COMMAND_HANDLER(vsllink_handle_usb_interface_command)
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
-       COMMAND_PARSE_NUMBER(u8, args[0], vsllink_usb_interface);
+       COMMAND_PARSE_NUMBER(u8, CMD_ARGV[0], vsllink_usb_interface);
        return ERROR_OK;
 }
 
        return ERROR_OK;
 }
 
index 178da97528b0b207e3138bc58340666431cdc228..96d37f17ea22d5b57ab100ebcf83c49d0e6f85c1 100644 (file)
@@ -70,14 +70,14 @@ COMMAND_HANDLER(handle_pld_device_command)
 
        for (i = 0; pld_drivers[i]; i++)
        {
 
        for (i = 0; pld_drivers[i]; i++)
        {
-               if (strcmp(args[0], pld_drivers[i]->name) == 0)
+               if (strcmp(CMD_ARGV[0], pld_drivers[i]->name) == 0)
                {
                        struct pld_device *p, *c;
 
                        /* register pld specific commands */
                        if (pld_drivers[i]->register_commands(cmd_ctx) != ERROR_OK)
                        {
                {
                        struct pld_device *p, *c;
 
                        /* register pld specific commands */
                        if (pld_drivers[i]->register_commands(cmd_ctx) != ERROR_OK)
                        {
-                               LOG_ERROR("couldn't register '%s' commands", args[0]);
+                               LOG_ERROR("couldn't register '%s' commands", CMD_ARGV[0]);
                                exit(-1);
                        }
 
                                exit(-1);
                        }
 
@@ -88,7 +88,7 @@ COMMAND_HANDLER(handle_pld_device_command)
                        int retval = CALL_COMMAND_HANDLER(pld_drivers[i]->pld_device_command, c);
                        if (ERROR_OK != retval)
                        {
                        int retval = CALL_COMMAND_HANDLER(pld_drivers[i]->pld_device_command, c);
                        if (ERROR_OK != retval)
                        {
-                               LOG_ERROR("'%s' driver rejected pld device", args[0]);
+                               LOG_ERROR("'%s' driver rejected pld device", CMD_ARGV[0]);
                                free(c);
                                return ERROR_OK;
                        }
                                free(c);
                                return ERROR_OK;
                        }
@@ -113,7 +113,7 @@ COMMAND_HANDLER(handle_pld_device_command)
        /* no matching pld driver found */
        if (!found)
        {
        /* no matching pld driver found */
        if (!found)
        {
-               LOG_ERROR("pld driver '%s' not found", args[0]);
+               LOG_ERROR("pld driver '%s' not found", CMD_ARGV[0]);
                exit(-1);
        }
 
                exit(-1);
        }
 
@@ -154,18 +154,18 @@ COMMAND_HANDLER(handle_pld_load_command)
        }
 
        unsigned dev_id;
        }
 
        unsigned dev_id;
-       COMMAND_PARSE_NUMBER(uint, args[0], dev_id);
+       COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], dev_id);
        p = get_pld_device_by_num(dev_id);
        if (!p)
        {
        p = get_pld_device_by_num(dev_id);
        if (!p)
        {
-               command_print(cmd_ctx, "pld device '#%s' is out of bounds", args[0]);
+               command_print(cmd_ctx, "pld device '#%s' is out of bounds", CMD_ARGV[0]);
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
-       if ((retval = p->driver->load(p, args[1])) != ERROR_OK)
+       if ((retval = p->driver->load(p, CMD_ARGV[1])) != ERROR_OK)
        {
                command_print(cmd_ctx, "failed loading file %s to pld device %u",
        {
                command_print(cmd_ctx, "failed loading file %s to pld device %u",
-                       args[1], dev_id);
+                       CMD_ARGV[1], dev_id);
                switch (retval)
                {
                }
                switch (retval)
                {
                }
@@ -177,7 +177,7 @@ COMMAND_HANDLER(handle_pld_load_command)
                timeval_subtract(&duration, &end, &start);
 
                command_print(cmd_ctx, "loaded file %s to pld device %u in %jis %jius",
                timeval_subtract(&duration, &end, &start);
 
                command_print(cmd_ctx, "loaded file %s to pld device %u in %jis %jius",
-                       args[1], dev_id,
+                       CMD_ARGV[1], dev_id,
                        (intmax_t)duration.tv_sec, (intmax_t)duration.tv_usec);
        }
 
                        (intmax_t)duration.tv_sec, (intmax_t)duration.tv_usec);
        }
 
index a6587ddc296f6082e6410883f2df98c38b30f972..b4593cc54b35a98d29478c583910954246518f05 100644 (file)
@@ -190,11 +190,11 @@ COMMAND_HANDLER(virtex2_handle_read_stat_command)
        }
 
        unsigned dev_id;
        }
 
        unsigned dev_id;
-       COMMAND_PARSE_NUMBER(uint, args[0], dev_id);
+       COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], dev_id);
        device = get_pld_device_by_num(dev_id);
        if (!device)
        {
        device = get_pld_device_by_num(dev_id);
        if (!device)
        {
-               command_print(cmd_ctx, "pld device '#%s' is out of bounds", args[0]);
+               command_print(cmd_ctx, "pld device '#%s' is out of bounds", CMD_ARGV[0]);
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
@@ -219,9 +219,9 @@ PLD_DEVICE_COMMAND_HANDLER(virtex2_pld_device_command)
                return ERROR_PLD_DEVICE_INVALID;
        }
 
                return ERROR_PLD_DEVICE_INVALID;
        }
 
-       tap = jtag_tap_by_string(args[1]);
+       tap = jtag_tap_by_string(CMD_ARGV[1]);
        if (tap == NULL) {
        if (tap == NULL) {
-               command_print(cmd_ctx, "Tap: %s does not exist", args[1]);
+               command_print(cmd_ctx, "Tap: %s does not exist", CMD_ARGV[1]);
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
index f5eb71da449d2a3ef6ca758434cd7beee5b870d6..716e1cfe6673cc658bb2c1c7a0f42c77b91f4401 100644 (file)
@@ -2272,18 +2272,18 @@ COMMAND_HANDLER(handle_gdb_memory_map_command)
 {
        if (CMD_ARGC == 1)
        {
 {
        if (CMD_ARGC == 1)
        {
-               if (strcmp(args[0], "enable") == 0)
+               if (strcmp(CMD_ARGV[0], "enable") == 0)
                {
                        gdb_use_memory_map = 1;
                        return ERROR_OK;
                }
                {
                        gdb_use_memory_map = 1;
                        return ERROR_OK;
                }
-               else if (strcmp(args[0], "disable") == 0)
+               else if (strcmp(CMD_ARGV[0], "disable") == 0)
                {
                        gdb_use_memory_map = 0;
                        return ERROR_OK;
                }
                else
                {
                        gdb_use_memory_map = 0;
                        return ERROR_OK;
                }
                else
-                       LOG_WARNING("invalid gdb_memory_map configuration directive %s", args[0]);
+                       LOG_WARNING("invalid gdb_memory_map configuration directive %s", CMD_ARGV[0]);
        }
 
        return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
        return ERROR_COMMAND_SYNTAX_ERROR;
@@ -2293,18 +2293,18 @@ COMMAND_HANDLER(handle_gdb_flash_program_command)
 {
        if (CMD_ARGC == 1)
        {
 {
        if (CMD_ARGC == 1)
        {
-               if (strcmp(args[0], "enable") == 0)
+               if (strcmp(CMD_ARGV[0], "enable") == 0)
                {
                        gdb_flash_program = 1;
                        return ERROR_OK;
                }
                {
                        gdb_flash_program = 1;
                        return ERROR_OK;
                }
-               else if (strcmp(args[0], "disable") == 0)
+               else if (strcmp(CMD_ARGV[0], "disable") == 0)
                {
                        gdb_flash_program = 0;
                        return ERROR_OK;
                }
                else
                {
                        gdb_flash_program = 0;
                        return ERROR_OK;
                }
                else
-                       LOG_WARNING("invalid gdb_flash_program configuration directive: %s", args[0]);
+                       LOG_WARNING("invalid gdb_flash_program configuration directive: %s", CMD_ARGV[0]);
        }
 
        return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
        return ERROR_COMMAND_SYNTAX_ERROR;
@@ -2314,18 +2314,18 @@ COMMAND_HANDLER(handle_gdb_report_data_abort_command)
 {
        if (CMD_ARGC == 1)
        {
 {
        if (CMD_ARGC == 1)
        {
-               if (strcmp(args[0], "enable") == 0)
+               if (strcmp(CMD_ARGV[0], "enable") == 0)
                {
                        gdb_report_data_abort = 1;
                        return ERROR_OK;
                }
                {
                        gdb_report_data_abort = 1;
                        return ERROR_OK;
                }
-               else if (strcmp(args[0], "disable") == 0)
+               else if (strcmp(CMD_ARGV[0], "disable") == 0)
                {
                        gdb_report_data_abort = 0;
                        return ERROR_OK;
                }
                else
                {
                        gdb_report_data_abort = 0;
                        return ERROR_OK;
                }
                else
-                       LOG_WARNING("invalid gdb_report_data_abort configuration directive: %s", args[0]);
+                       LOG_WARNING("invalid gdb_report_data_abort configuration directive: %s", CMD_ARGV[0]);
        }
 
        return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
        return ERROR_COMMAND_SYNTAX_ERROR;
@@ -2340,13 +2340,13 @@ COMMAND_HANDLER(handle_gdb_breakpoint_override_command)
        } else if (CMD_ARGC == 1)
        {
                gdb_breakpoint_override = 1;
        } else if (CMD_ARGC == 1)
        {
                gdb_breakpoint_override = 1;
-               if (strcmp(args[0], "hard") == 0)
+               if (strcmp(CMD_ARGV[0], "hard") == 0)
                {
                        gdb_breakpoint_override_type = BKPT_HARD;
                {
                        gdb_breakpoint_override_type = BKPT_HARD;
-               } else if (strcmp(args[0], "soft") == 0)
+               } else if (strcmp(CMD_ARGV[0], "soft") == 0)
                {
                        gdb_breakpoint_override_type = BKPT_SOFT;
                {
                        gdb_breakpoint_override_type = BKPT_SOFT;
-               } else if (strcmp(args[0], "disable") == 0)
+               } else if (strcmp(CMD_ARGV[0], "disable") == 0)
                {
                        gdb_breakpoint_override = 0;
                }
                {
                        gdb_breakpoint_override = 0;
                }
index d8659b09e6c39c7d64a4da8abaf041fef5dbd7bf..1c5e6d2b929a9cf3fc2e270fff4f57dc4baab00d 100644 (file)
@@ -109,7 +109,7 @@ static int httpd_Jim_Command_writeform(Jim_Interp *interp, int argc,
 {
        if (argc != 3)
        {
 {
        if (argc != 3)
        {
-               Jim_WrongNumArgs(interp, 1, argv, "method ?args ...?");
+               Jim_WrongNumArgs(interp, 1, argv, "method ?CMD_ARGV ...?");
                return JIM_ERR;
        }
        char *name = (char*) Jim_GetString(argv[1], NULL);
                return JIM_ERR;
        }
        char *name = (char*) Jim_GetString(argv[1], NULL);
@@ -156,7 +156,7 @@ httpd_Jim_Command_formfetch(Jim_Interp *interp,
 {
     if (argc != 2)
     {
 {
     if (argc != 2)
     {
-        Jim_WrongNumArgs(interp, 1, argv, "method ?args ...?");
+        Jim_WrongNumArgs(interp, 1, argv, "method ?CMD_ARGV ...?");
         return JIM_ERR;
     }
     char *name = (char*)Jim_GetString(argv[1], NULL);
         return JIM_ERR;
     }
     char *name = (char*)Jim_GetString(argv[1], NULL);
index 17a116d23e1cbb87844dcf2405da9027a3bc4238..258c89bcc54f162855b43df456cf320d59b5ec97 100644 (file)
@@ -558,7 +558,7 @@ SERVER_PORT_COMMAND()
        case 1:
        {
                uint16_t port;
        case 1:
        {
                uint16_t port;
-               COMMAND_PARSE_NUMBER(u16, args[0], port);
+               COMMAND_PARSE_NUMBER(u16, CMD_ARGV[0], port);
                *out = port;
                break;
        }
                *out = port;
                break;
        }
index c51e60905ef4384d3c33eb357467e91799c9bbef..45f34936dbaed7658f3df520892af9c87feec2be 100644 (file)
@@ -318,28 +318,28 @@ COMMAND_HANDLER(handle_svf_command)
        svf_quiet = 0;
        for (unsigned i = 1; i < CMD_ARGC; i++)
        {
        svf_quiet = 0;
        for (unsigned i = 1; i < CMD_ARGC; i++)
        {
-               if (!strcmp(args[i], "quiet"))
+               if (!strcmp(CMD_ARGV[i], "quiet"))
                {
                        svf_quiet = 1;
                }
                else
                {
                {
                        svf_quiet = 1;
                }
                else
                {
-                       LOG_ERROR("unknown variant for svf: %s", args[i]);
+                       LOG_ERROR("unknown variant for svf: %s", CMD_ARGV[i]);
 
                        // no need to free anything now
                        return ERROR_FAIL;
                }
        }
 
 
                        // no need to free anything now
                        return ERROR_FAIL;
                }
        }
 
-       if ((svf_fd = open(args[0], O_RDONLY)) < 0)
+       if ((svf_fd = open(CMD_ARGV[0], O_RDONLY)) < 0)
        {
        {
-               command_print(cmd_ctx, "file \"%s\" not found", args[0]);
+               command_print(cmd_ctx, "file \"%s\" not found", CMD_ARGV[0]);
 
                // no need to free anything now
                return ERROR_FAIL;
        }
 
 
                // no need to free anything now
                return ERROR_FAIL;
        }
 
-       LOG_USER("svf processing file: \"%s\"", args[0]);
+       LOG_USER("svf processing file: \"%s\"", CMD_ARGV[0]);
 
        // get time
        time_ago = timeval_ms();
 
        // get time
        time_ago = timeval_ms();
index 4236ac89d7f42f63025f4a8a516fd876b6d775c6..65e078099e0c531f9f243d6619991e76c33a2640 100644 (file)
@@ -2014,7 +2014,7 @@ static COMMAND_HELPER(arm11_handle_bool, bool *var, char *name)
        if (CMD_ARGC != 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        if (CMD_ARGC != 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
-       switch (args[0][0])
+       switch (CMD_ARGV[0][0])
        {
        case '0':       /* 0 */
        case 'f':       /* false */
        {
        case '0':       /* 0 */
        case 'f':       /* false */
@@ -2056,7 +2056,7 @@ COMMAND_HANDLER(arm11_handle_vcr)
        case 0:
                break;
        case 1:
        case 0:
                break;
        case 1:
-               COMMAND_PARSE_NUMBER(u32, args[0], arm11_vcr);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], arm11_vcr);
                break;
        default:
                return ERROR_COMMAND_SYNTAX_ERROR;
                break;
        default:
                return ERROR_COMMAND_SYNTAX_ERROR;
index 53d22245e87168d2659eac304cf5aabf23ba9554..a0cde5d4f2d3b71e2ab6c35af06d374761a69731 100644 (file)
@@ -432,7 +432,7 @@ COMMAND_HANDLER(arm720t_handle_cp15_command)
        if (CMD_ARGC >= 1)
        {
                uint32_t opcode;
        if (CMD_ARGC >= 1)
        {
                uint32_t opcode;
-               COMMAND_PARSE_NUMBER(u32, args[0], opcode);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], opcode);
 
                if (CMD_ARGC == 1)
                {
 
                if (CMD_ARGC == 1)
                {
@@ -453,7 +453,7 @@ COMMAND_HANDLER(arm720t_handle_cp15_command)
                else if (CMD_ARGC == 2)
                {
                        uint32_t value;
                else if (CMD_ARGC == 2)
                {
                        uint32_t value;
-                       COMMAND_PARSE_NUMBER(u32, args[1], value);
+                       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], value);
 
                        if ((retval = arm720t_write_cp15(target, opcode, value)) != ERROR_OK)
                        {
 
                        if ((retval = arm720t_write_cp15(target, opcode, value)) != ERROR_OK)
                        {
index 19c9791d9485c0b0dbafc77574ad687c3135c3af..bd018b49773444c68f6733b7f4b362f6d3b73ae5 100644 (file)
@@ -2771,8 +2771,8 @@ COMMAND_HANDLER(handle_arm7_9_write_xpsr_command)
                return ERROR_FAIL;
        }
 
                return ERROR_FAIL;
        }
 
-       COMMAND_PARSE_NUMBER(u32, args[0], value);
-       COMMAND_PARSE_NUMBER(int, args[1], spsr);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], value);
+       COMMAND_PARSE_NUMBER(int, CMD_ARGV[1], spsr);
 
        /* if we're writing the CPSR, mask the T bit */
        if (!spsr)
 
        /* if we're writing the CPSR, mask the T bit */
        if (!spsr)
@@ -2815,9 +2815,9 @@ COMMAND_HANDLER(handle_arm7_9_write_xpsr_im8_command)
                return ERROR_FAIL;
        }
 
                return ERROR_FAIL;
        }
 
-       COMMAND_PARSE_NUMBER(u32, args[0], value);
-       COMMAND_PARSE_NUMBER(int, args[1], rotate);
-       COMMAND_PARSE_NUMBER(int, args[2], spsr);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], value);
+       COMMAND_PARSE_NUMBER(int, CMD_ARGV[1], rotate);
+       COMMAND_PARSE_NUMBER(int, CMD_ARGV[2], spsr);
 
        arm7_9->write_xpsr_im8(target, value, rotate, spsr);
        if ((retval = jtag_execute_queue()) != ERROR_OK)
 
        arm7_9->write_xpsr_im8(target, value, rotate, spsr);
        if ((retval = jtag_execute_queue()) != ERROR_OK)
@@ -2855,9 +2855,9 @@ COMMAND_HANDLER(handle_arm7_9_write_core_reg_command)
                return ERROR_FAIL;
        }
 
                return ERROR_FAIL;
        }
 
-       COMMAND_PARSE_NUMBER(int, args[0], num);
-       COMMAND_PARSE_NUMBER(u32, args[1], mode);
-       COMMAND_PARSE_NUMBER(u32, args[2], value);
+       COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], num);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], mode);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], value);
 
        return arm7_9_write_core_reg(target, num, mode, value);
 }
 
        return arm7_9_write_core_reg(target, num, mode, value);
 }
@@ -2875,11 +2875,11 @@ COMMAND_HANDLER(handle_arm7_9_dbgrq_command)
 
        if (CMD_ARGC > 0)
        {
 
        if (CMD_ARGC > 0)
        {
-               if (strcmp("enable", args[0]) == 0)
+               if (strcmp("enable", CMD_ARGV[0]) == 0)
                {
                        arm7_9->use_dbgrq = 1;
                }
                {
                        arm7_9->use_dbgrq = 1;
                }
-               else if (strcmp("disable", args[0]) == 0)
+               else if (strcmp("disable", CMD_ARGV[0]) == 0)
                {
                        arm7_9->use_dbgrq = 0;
                }
                {
                        arm7_9->use_dbgrq = 0;
                }
@@ -2907,11 +2907,11 @@ COMMAND_HANDLER(handle_arm7_9_fast_memory_access_command)
 
        if (CMD_ARGC > 0)
        {
 
        if (CMD_ARGC > 0)
        {
-               if (strcmp("enable", args[0]) == 0)
+               if (strcmp("enable", CMD_ARGV[0]) == 0)
                {
                        arm7_9->fast_memory_access = 1;
                }
                {
                        arm7_9->fast_memory_access = 1;
                }
-               else if (strcmp("disable", args[0]) == 0)
+               else if (strcmp("disable", CMD_ARGV[0]) == 0)
                {
                        arm7_9->fast_memory_access = 0;
                }
                {
                        arm7_9->fast_memory_access = 0;
                }
@@ -2939,11 +2939,11 @@ COMMAND_HANDLER(handle_arm7_9_dcc_downloads_command)
 
        if (CMD_ARGC > 0)
        {
 
        if (CMD_ARGC > 0)
        {
-               if (strcmp("enable", args[0]) == 0)
+               if (strcmp("enable", CMD_ARGV[0]) == 0)
                {
                        arm7_9->dcc_downloads = 1;
                }
                {
                        arm7_9->dcc_downloads = 1;
                }
-               else if (strcmp("disable", args[0]) == 0)
+               else if (strcmp("disable", CMD_ARGV[0]) == 0)
                {
                        arm7_9->dcc_downloads = 0;
                }
                {
                        arm7_9->dcc_downloads = 0;
                }
index 58e92c35ec24490d4e88b2505960a21515a35100..fbb8d7f512329956e5beab5fee2f75edf8653e4c 100644 (file)
@@ -688,7 +688,7 @@ COMMAND_HANDLER(arm920t_handle_read_cache_command)
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
-       if ((output = fopen(args[0], "w")) == NULL)
+       if ((output = fopen(CMD_ARGV[0], "w")) == NULL)
        {
                LOG_DEBUG("error opening cache content file");
                return ERROR_OK;
        {
                LOG_DEBUG("error opening cache content file");
                return ERROR_OK;
@@ -885,7 +885,7 @@ COMMAND_HANDLER(arm920t_handle_read_cache_command)
        /* restore CP15 MMU and Cache settings */
        arm920t_write_cp15_physical(target, ARM920T_CP15_PHYS_ADDR(0, 0x1, 0), cp15_ctrl_saved);
 
        /* restore CP15 MMU and Cache settings */
        arm920t_write_cp15_physical(target, ARM920T_CP15_PHYS_ADDR(0, 0x1, 0), cp15_ctrl_saved);
 
-       command_print(cmd_ctx, "cache content successfully output to %s", args[0]);
+       command_print(cmd_ctx, "cache content successfully output to %s", CMD_ARGV[0]);
 
        fclose(output);
 
 
        fclose(output);
 
@@ -934,7 +934,7 @@ COMMAND_HANDLER(arm920t_handle_read_mmu_command)
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
-       if ((output = fopen(args[0], "w")) == NULL)
+       if ((output = fopen(CMD_ARGV[0], "w")) == NULL)
        {
                LOG_DEBUG("error opening mmu content file");
                return ERROR_OK;
        {
                LOG_DEBUG("error opening mmu content file");
                return ERROR_OK;
@@ -1168,7 +1168,7 @@ COMMAND_HANDLER(arm920t_handle_read_mmu_command)
                fprintf(output, "%i: 0x%8.8" PRIx32 " 0x%8.8" PRIx32 " 0x%8.8" PRIx32 " %s\n", i, i_tlb[i].cam, i_tlb[i].ram1, i_tlb[i].ram2, (i_tlb[i].cam & 0x20) ? "(valid)" : "(invalid)");
        }
 
                fprintf(output, "%i: 0x%8.8" PRIx32 " 0x%8.8" PRIx32 " 0x%8.8" PRIx32 " %s\n", i, i_tlb[i].cam, i_tlb[i].ram1, i_tlb[i].ram2, (i_tlb[i].cam & 0x20) ? "(valid)" : "(invalid)");
        }
 
-       command_print(cmd_ctx, "mmu content successfully output to %s", args[0]);
+       command_print(cmd_ctx, "mmu content successfully output to %s", CMD_ARGV[0]);
 
        fclose(output);
 
 
        fclose(output);
 
@@ -1210,7 +1210,7 @@ COMMAND_HANDLER(arm920t_handle_cp15_command)
        if (CMD_ARGC >= 1)
        {
                int address;
        if (CMD_ARGC >= 1)
        {
                int address;
-               COMMAND_PARSE_NUMBER(int, args[0], address);
+               COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], address);
 
                if (CMD_ARGC == 1)
                {
 
                if (CMD_ARGC == 1)
                {
@@ -1230,7 +1230,7 @@ COMMAND_HANDLER(arm920t_handle_cp15_command)
                else if (CMD_ARGC == 2)
                {
                        uint32_t value;
                else if (CMD_ARGC == 2)
                {
                        uint32_t value;
-                       COMMAND_PARSE_NUMBER(u32, args[1], value);
+                       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], value);
                        if ((retval = arm920t_write_cp15_physical(target, address, value)) != ERROR_OK)
                        {
                                command_print(cmd_ctx, "couldn't access reg %i", address);
                        if ((retval = arm920t_write_cp15_physical(target, address, value)) != ERROR_OK)
                        {
                                command_print(cmd_ctx, "couldn't access reg %i", address);
@@ -1264,7 +1264,7 @@ COMMAND_HANDLER(arm920t_handle_cp15i_command)
        if (CMD_ARGC >= 1)
        {
                uint32_t opcode;
        if (CMD_ARGC >= 1)
        {
                uint32_t opcode;
-               COMMAND_PARSE_NUMBER(u32, args[0], opcode);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], opcode);
 
                if (CMD_ARGC == 1)
                {
 
                if (CMD_ARGC == 1)
                {
@@ -1280,7 +1280,7 @@ COMMAND_HANDLER(arm920t_handle_cp15i_command)
                else if (CMD_ARGC == 2)
                {
                        uint32_t value;
                else if (CMD_ARGC == 2)
                {
                        uint32_t value;
-                       COMMAND_PARSE_NUMBER(u32, args[1], value);
+                       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], value);
                        if ((retval = arm920t_write_cp15_interpreted(target, opcode, value, 0)) != ERROR_OK)
                        {
                                command_print(cmd_ctx, "couldn't execute %8.8" PRIx32 "", opcode);
                        if ((retval = arm920t_write_cp15_interpreted(target, opcode, value, 0)) != ERROR_OK)
                        {
                                command_print(cmd_ctx, "couldn't execute %8.8" PRIx32 "", opcode);
@@ -1291,9 +1291,9 @@ COMMAND_HANDLER(arm920t_handle_cp15i_command)
                else if (CMD_ARGC == 3)
                {
                        uint32_t value;
                else if (CMD_ARGC == 3)
                {
                        uint32_t value;
-                       COMMAND_PARSE_NUMBER(u32, args[1], value);
+                       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], value);
                        uint32_t address;
                        uint32_t address;
-                       COMMAND_PARSE_NUMBER(u32, args[2], address);
+                       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], address);
                        if ((retval = arm920t_write_cp15_interpreted(target, opcode, value, address)) != ERROR_OK)
                        {
                                command_print(cmd_ctx, "couldn't execute %8.8" PRIx32 "", opcode);
                        if ((retval = arm920t_write_cp15_interpreted(target, opcode, value, address)) != ERROR_OK)
                        {
                                command_print(cmd_ctx, "couldn't execute %8.8" PRIx32 "", opcode);
index 4e2066461c12f6419141fa35546fb2ef6b8f148a..667805404837196a361af31a5f52dc463ad8dacc 100644 (file)
@@ -728,10 +728,10 @@ COMMAND_HANDLER(arm926ejs_handle_cp15_command)
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
-       COMMAND_PARSE_NUMBER(int, args[0], opcode_1);
-       COMMAND_PARSE_NUMBER(int, args[1], opcode_2);
-       COMMAND_PARSE_NUMBER(int, args[2], CRn);
-       COMMAND_PARSE_NUMBER(int, args[3], CRm);
+       COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], opcode_1);
+       COMMAND_PARSE_NUMBER(int, CMD_ARGV[1], opcode_2);
+       COMMAND_PARSE_NUMBER(int, CMD_ARGV[2], CRn);
+       COMMAND_PARSE_NUMBER(int, CMD_ARGV[3], CRm);
 
        retval = arm926ejs_verify_pointer(cmd_ctx, arm926ejs);
        if (retval != ERROR_OK)
 
        retval = arm926ejs_verify_pointer(cmd_ctx, arm926ejs);
        if (retval != ERROR_OK)
@@ -761,7 +761,7 @@ COMMAND_HANDLER(arm926ejs_handle_cp15_command)
        else
        {
                uint32_t value;
        else
        {
                uint32_t value;
-               COMMAND_PARSE_NUMBER(u32, args[4], value);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[4], value);
                if ((retval = arm926ejs->write_cp15(target, opcode_1, opcode_2, CRn, CRm, value)) != ERROR_OK)
                {
                        command_print(cmd_ctx, "couldn't access register");
                if ((retval = arm926ejs->write_cp15(target, opcode_1, opcode_2, CRn, CRm, value)) != ERROR_OK)
                {
                        command_print(cmd_ctx, "couldn't access register");
index 0c08a609f3659e08c5c77642afa7276b397baa06..ffc65cde50b3ad7cd4bcbfab65eb49e9cc8f33df 100644 (file)
@@ -182,7 +182,7 @@ COMMAND_HANDLER(arm966e_handle_cp15_command)
        if (CMD_ARGC >= 1)
        {
                uint32_t address;
        if (CMD_ARGC >= 1)
        {
                uint32_t address;
-               COMMAND_PARSE_NUMBER(u32, args[0], address);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], address);
 
                if (CMD_ARGC == 1)
                {
 
                if (CMD_ARGC == 1)
                {
@@ -205,7 +205,7 @@ COMMAND_HANDLER(arm966e_handle_cp15_command)
                else if (CMD_ARGC == 2)
                {
                        uint32_t value;
                else if (CMD_ARGC == 2)
                {
                        uint32_t value;
-                       COMMAND_PARSE_NUMBER(u32, args[1], value);
+                       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], value);
                        if ((retval = arm966e_write_cp15(target, address, value)) != ERROR_OK)
                        {
                                command_print(cmd_ctx,
                        if ((retval = arm966e_write_cp15(target, address, value)) != ERROR_OK)
                        {
                                command_print(cmd_ctx,
index b582eae3319ea3cff8efe2d4a29a1965c64d623b..3f074be86bee15d45cd272cbe23ffa2c27b452dd 100644 (file)
@@ -856,11 +856,11 @@ COMMAND_HANDLER(handle_arm9tdmi_catch_vectors_command)
        if (CMD_ARGC > 0)
        {
                vector_catch_value = 0x0;
        if (CMD_ARGC > 0)
        {
                vector_catch_value = 0x0;
-               if (strcmp(args[0], "all") == 0)
+               if (strcmp(CMD_ARGV[0], "all") == 0)
                {
                        vector_catch_value = 0xdf;
                }
                {
                        vector_catch_value = 0xdf;
                }
-               else if (strcmp(args[0], "none") == 0)
+               else if (strcmp(CMD_ARGV[0], "none") == 0)
                {
                        /* do nothing */
                }
                {
                        /* do nothing */
                }
@@ -872,7 +872,7 @@ COMMAND_HANDLER(handle_arm9tdmi_catch_vectors_command)
                                unsigned j;
                                for (j = 0; arm9tdmi_vectors[j].name; j++)
                                {
                                unsigned j;
                                for (j = 0; arm9tdmi_vectors[j].name; j++)
                                {
-                                       if (strcmp(args[i], arm9tdmi_vectors[j].name) == 0)
+                                       if (strcmp(CMD_ARGV[i], arm9tdmi_vectors[j].name) == 0)
                                        {
                                                vector_catch_value |= arm9tdmi_vectors[j].value;
                                                break;
                                        {
                                                vector_catch_value |= arm9tdmi_vectors[j].value;
                                                break;
@@ -882,7 +882,7 @@ COMMAND_HANDLER(handle_arm9tdmi_catch_vectors_command)
                                /* complain if vector wasn't found */
                                if (!arm9tdmi_vectors[j].name)
                                {
                                /* complain if vector wasn't found */
                                if (!arm9tdmi_vectors[j].name)
                                {
-                                       command_print(cmd_ctx, "vector '%s' not found, leaving current setting unchanged", args[i]);
+                                       command_print(cmd_ctx, "vector '%s' not found, leaving current setting unchanged", CMD_ARGV[i]);
 
                                        /* reread current setting */
                                        vector_catch_value = buf_get_u32(
 
                                        /* reread current setting */
                                        vector_catch_value = buf_get_u32(
index dcae81815b007aa22cca5b4822b054f1984ebc13..7f4bc58c22e10f6144d228661bfddf8c1eda8c93 100644 (file)
@@ -1375,7 +1375,7 @@ DAP_COMMAND_HANDLER(dap_baseaddr_command)
                apsel = swjdp->apsel;
                break;
        case 1:
                apsel = swjdp->apsel;
                break;
        case 1:
-               COMMAND_PARSE_NUMBER(u32, args[0], apsel);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], apsel);
                break;
        default:
                return ERROR_COMMAND_SYNTAX_ERROR;
                break;
        default:
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -1403,7 +1403,7 @@ DAP_COMMAND_HANDLER(dap_memaccess_command)
                memaccess_tck = swjdp->memaccess_tck;
                break;
        case 1:
                memaccess_tck = swjdp->memaccess_tck;
                break;
        case 1:
-               COMMAND_PARSE_NUMBER(u32, args[0], memaccess_tck);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], memaccess_tck);
                break;
        default:
                return ERROR_COMMAND_SYNTAX_ERROR;
                break;
        default:
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -1426,7 +1426,7 @@ DAP_COMMAND_HANDLER(dap_apsel_command)
                apsel = 0;
                break;
        case 1:
                apsel = 0;
                break;
        case 1:
-               COMMAND_PARSE_NUMBER(u32, args[0], apsel);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], apsel);
                break;
        default:
                return ERROR_COMMAND_SYNTAX_ERROR;
                break;
        default:
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -1452,7 +1452,7 @@ DAP_COMMAND_HANDLER(dap_apid_command)
                apsel = swjdp->apsel;
                break;
        case 1:
                apsel = swjdp->apsel;
                break;
        case 1:
-               COMMAND_PARSE_NUMBER(u32, args[0], apsel);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], apsel);
                break;
        default:
                return ERROR_COMMAND_SYNTAX_ERROR;
                break;
        default:
                return ERROR_COMMAND_SYNTAX_ERROR;
index 4c2a6e5422189d42fe3cc8da4ddf98fbb8eec02d..5f0fe42c76b5c8dfe896012ad9ad081de557f5ae 100644 (file)
@@ -424,11 +424,11 @@ COMMAND_HANDLER(handle_armv4_5_core_state_command)
 
        if (CMD_ARGC > 0)
        {
 
        if (CMD_ARGC > 0)
        {
-               if (strcmp(args[0], "arm") == 0)
+               if (strcmp(CMD_ARGV[0], "arm") == 0)
                {
                        armv4_5->core_state = ARMV4_5_STATE_ARM;
                }
                {
                        armv4_5->core_state = ARMV4_5_STATE_ARM;
                }
-               if (strcmp(args[0], "thumb") == 0)
+               if (strcmp(CMD_ARGV[0], "thumb") == 0)
                {
                        armv4_5->core_state = ARMV4_5_STATE_THUMB;
                }
                {
                        armv4_5->core_state = ARMV4_5_STATE_THUMB;
                }
@@ -455,15 +455,15 @@ COMMAND_HANDLER(handle_armv4_5_disassemble_command)
 
        switch (CMD_ARGC) {
        case 3:
 
        switch (CMD_ARGC) {
        case 3:
-               if (strcmp(args[2], "thumb") != 0)
+               if (strcmp(CMD_ARGV[2], "thumb") != 0)
                        goto usage;
                thumb = 1;
                /* FALL THROUGH */
        case 2:
                        goto usage;
                thumb = 1;
                /* FALL THROUGH */
        case 2:
-               COMMAND_PARSE_NUMBER(int, args[1], count);
+               COMMAND_PARSE_NUMBER(int, CMD_ARGV[1], count);
                /* FALL THROUGH */
        case 1:
                /* FALL THROUGH */
        case 1:
-               COMMAND_PARSE_NUMBER(u32, args[0], address);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], address);
                if (address & 0x01) {
                        if (!thumb) {
                                command_print(cmd_ctx, "Disassemble as Thumb");
                if (address & 0x01) {
                        if (!thumb) {
                                command_print(cmd_ctx, "Disassemble as Thumb");
index 31ab4b48e5b8474e34aaffd541e4bb9a3d223b16..7f5b834927465ecac434cb1e1e0e545f8de3a0c8 100644 (file)
@@ -264,7 +264,7 @@ COMMAND_HANDLER(handle_dap_info_command)
                apsel = swjdp->apsel;
                break;
        case 1:
                apsel = swjdp->apsel;
                break;
        case 1:
-               COMMAND_PARSE_NUMBER(u32, args[0], apsel);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], apsel);
                break;
        default:
                return ERROR_COMMAND_SYNTAX_ERROR;
                break;
        default:
                return ERROR_COMMAND_SYNTAX_ERROR;
index e9d46dfd1e27792fea46b14134436a95d8b5c4e3..4fe57943e428346fd4cec7c4f5df2a16626b30f0 100644 (file)
@@ -771,7 +771,7 @@ COMMAND_HANDLER(handle_dap_baseaddr_command)
                apsel = swjdp->apsel;
                break;
        case 1:
                apsel = swjdp->apsel;
                break;
        case 1:
-               COMMAND_PARSE_NUMBER(u32, args[0], apsel);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], apsel);
                break;
        default:
                return ERROR_COMMAND_SYNTAX_ERROR;
                break;
        default:
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -834,7 +834,7 @@ COMMAND_HANDLER(handle_dap_info_command)
                apsel = swjdp->apsel;
                break;
        case 1:
                apsel = swjdp->apsel;
                break;
        case 1:
-               COMMAND_PARSE_NUMBER(u32, args[0], apsel);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], apsel);
                break;
        default:
                return ERROR_COMMAND_SYNTAX_ERROR;
                break;
        default:
                return ERROR_COMMAND_SYNTAX_ERROR;
index 058443457ef9daefff97285691d7e4fccbe265b7..9cb4b98321c7f48534e8a8a201fbb9288dcf518c 100644 (file)
@@ -1782,10 +1782,10 @@ COMMAND_HANDLER(handle_cortex_m3_disassemble_command)
        errno = 0;
        switch (CMD_ARGC) {
        case 2:
        errno = 0;
        switch (CMD_ARGC) {
        case 2:
-               COMMAND_PARSE_NUMBER(ulong, args[1], count);
+               COMMAND_PARSE_NUMBER(ulong, CMD_ARGV[1], count);
                /* FALL THROUGH */
        case 1:
                /* FALL THROUGH */
        case 1:
-               COMMAND_PARSE_NUMBER(u32, args[0], address);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], address);
                break;
        default:
                command_print(cmd_ctx,
                break;
        default:
                command_print(cmd_ctx,
@@ -1836,25 +1836,25 @@ COMMAND_HANDLER(handle_cortex_m3_vector_catch_command)
                unsigned catch = 0;
 
                if (CMD_ARGC == 1) {
                unsigned catch = 0;
 
                if (CMD_ARGC == 1) {
-                       if (strcmp(args[0], "all") == 0) {
+                       if (strcmp(CMD_ARGV[0], "all") == 0) {
                                catch = VC_HARDERR | VC_INTERR | VC_BUSERR
                                        | VC_STATERR | VC_CHKERR | VC_NOCPERR
                                        | VC_MMERR | VC_CORERESET;
                                goto write;
                                catch = VC_HARDERR | VC_INTERR | VC_BUSERR
                                        | VC_STATERR | VC_CHKERR | VC_NOCPERR
                                        | VC_MMERR | VC_CORERESET;
                                goto write;
-                       } else if (strcmp(args[0], "none") == 0) {
+                       } else if (strcmp(CMD_ARGV[0], "none") == 0) {
                                goto write;
                        }
                }
                while (CMD_ARGC-- > 0) {
                        unsigned i;
                        for (i = 0; i < ARRAY_SIZE(vec_ids); i++) {
                                goto write;
                        }
                }
                while (CMD_ARGC-- > 0) {
                        unsigned i;
                        for (i = 0; i < ARRAY_SIZE(vec_ids); i++) {
-                               if (strcmp(args[CMD_ARGC], vec_ids[i].name) != 0)
+                               if (strcmp(CMD_ARGV[CMD_ARGC], vec_ids[i].name) != 0)
                                        continue;
                                catch |= vec_ids[i].mask;
                                break;
                        }
                        if (i == ARRAY_SIZE(vec_ids)) {
                                        continue;
                                catch |= vec_ids[i].mask;
                                break;
                        }
                        if (i == ARRAY_SIZE(vec_ids)) {
-                               LOG_ERROR("No CM3 vector '%s'", args[CMD_ARGC]);
+                               LOG_ERROR("No CM3 vector '%s'", CMD_ARGV[CMD_ARGC]);
                                return ERROR_INVALID_ARGUMENTS;
                        }
                }
                                return ERROR_INVALID_ARGUMENTS;
                        }
                }
@@ -1892,11 +1892,11 @@ COMMAND_HANDLER(handle_cortex_m3_mask_interrupts_command)
 
        if (CMD_ARGC > 0)
        {
 
        if (CMD_ARGC > 0)
        {
-               if (!strcmp(args[0], "on"))
+               if (!strcmp(CMD_ARGV[0], "on"))
                {
                        cortex_m3_write_debug_halt_mask(target, C_HALT | C_MASKINTS, 0);
                }
                {
                        cortex_m3_write_debug_halt_mask(target, C_HALT | C_MASKINTS, 0);
                }
-               else if (!strcmp(args[0], "off"))
+               else if (!strcmp(CMD_ARGV[0], "off"))
                {
                        cortex_m3_write_debug_halt_mask(target, C_HALT, C_MASKINTS);
                }
                {
                        cortex_m3_write_debug_halt_mask(target, C_HALT, C_MASKINTS);
                }
index 2ad51565f195e11ff10e45ec941f389c2f4b0a4d..25d6d0b0908cb2b59e67f16dba893cc147b8e01b 100644 (file)
@@ -359,25 +359,25 @@ COMMAND_HANDLER(handle_etb_config_command)
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
-       target = get_target(args[0]);
+       target = get_target(CMD_ARGV[0]);
 
        if (!target)
        {
 
        if (!target)
        {
-               LOG_ERROR("ETB: target '%s' not defined", args[0]);
+               LOG_ERROR("ETB: target '%s' not defined", CMD_ARGV[0]);
                return ERROR_FAIL;
        }
 
        arm = target_to_arm(target);
        if (!is_arm(arm))
        {
                return ERROR_FAIL;
        }
 
        arm = target_to_arm(target);
        if (!is_arm(arm))
        {
-               command_print(cmd_ctx, "ETB: '%s' isn't an ARM", args[0]);
+               command_print(cmd_ctx, "ETB: '%s' isn't an ARM", CMD_ARGV[0]);
                return ERROR_FAIL;
        }
 
                return ERROR_FAIL;
        }
 
-       tap = jtag_tap_by_string(args[1]);
+       tap = jtag_tap_by_string(CMD_ARGV[1]);
        if (tap == NULL)
        {
        if (tap == NULL)
        {
-               command_print(cmd_ctx, "ETB: TAP %s does not exist", args[1]);
+               command_print(cmd_ctx, "ETB: TAP %s does not exist", CMD_ARGV[1]);
                return ERROR_FAIL;
        }
 
                return ERROR_FAIL;
        }
 
index 044ccb06265cd142b7dd094e0ca23f6d6f49c32e..72e8b3d21fe422b0f7b58da5e8863db8f36fe91f 100644 (file)
@@ -1179,22 +1179,22 @@ static COMMAND_HELPER(handle_etm_tracemode_command_update,
        etmv1_tracemode_t tracemode;
 
        /* what parts of data access are traced? */
        etmv1_tracemode_t tracemode;
 
        /* what parts of data access are traced? */
-       if (strcmp(args[0], "none") == 0)
+       if (strcmp(CMD_ARGV[0], "none") == 0)
                tracemode = ETMV1_TRACE_NONE;
                tracemode = ETMV1_TRACE_NONE;
-       else if (strcmp(args[0], "data") == 0)
+       else if (strcmp(CMD_ARGV[0], "data") == 0)
                tracemode = ETMV1_TRACE_DATA;
                tracemode = ETMV1_TRACE_DATA;
-       else if (strcmp(args[0], "address") == 0)
+       else if (strcmp(CMD_ARGV[0], "address") == 0)
                tracemode = ETMV1_TRACE_ADDR;
                tracemode = ETMV1_TRACE_ADDR;
-       else if (strcmp(args[0], "all") == 0)
+       else if (strcmp(CMD_ARGV[0], "all") == 0)
                tracemode = ETMV1_TRACE_DATA | ETMV1_TRACE_ADDR;
        else
        {
                tracemode = ETMV1_TRACE_DATA | ETMV1_TRACE_ADDR;
        else
        {
-               command_print(cmd_ctx, "invalid option '%s'", args[0]);
+               command_print(cmd_ctx, "invalid option '%s'", CMD_ARGV[0]);
                return ERROR_INVALID_ARGUMENTS;
        }
 
        uint8_t context_id;
                return ERROR_INVALID_ARGUMENTS;
        }
 
        uint8_t context_id;
-       COMMAND_PARSE_NUMBER(u8, args[1], context_id);
+       COMMAND_PARSE_NUMBER(u8, CMD_ARGV[1], context_id);
        switch (context_id)
        {
        case 0:
        switch (context_id)
        {
        case 0:
@@ -1210,27 +1210,27 @@ static COMMAND_HELPER(handle_etm_tracemode_command_update,
                tracemode |= ETMV1_CONTEXTID_32;
                break;
        default:
                tracemode |= ETMV1_CONTEXTID_32;
                break;
        default:
-               command_print(cmd_ctx, "invalid option '%s'", args[1]);
+               command_print(cmd_ctx, "invalid option '%s'", CMD_ARGV[1]);
                return ERROR_INVALID_ARGUMENTS;
        }
 
                return ERROR_INVALID_ARGUMENTS;
        }
 
-       if (strcmp(args[2], "enable") == 0)
+       if (strcmp(CMD_ARGV[2], "enable") == 0)
                tracemode |= ETMV1_CYCLE_ACCURATE;
                tracemode |= ETMV1_CYCLE_ACCURATE;
-       else if (strcmp(args[2], "disable") == 0)
+       else if (strcmp(CMD_ARGV[2], "disable") == 0)
                tracemode |= 0;
        else
        {
                tracemode |= 0;
        else
        {
-               command_print(cmd_ctx, "invalid option '%s'", args[2]);
+               command_print(cmd_ctx, "invalid option '%s'", CMD_ARGV[2]);
                return ERROR_INVALID_ARGUMENTS;
        }
 
                return ERROR_INVALID_ARGUMENTS;
        }
 
-       if (strcmp(args[3], "enable") == 0)
+       if (strcmp(CMD_ARGV[3], "enable") == 0)
                tracemode |= ETMV1_BRANCH_OUTPUT;
                tracemode |= ETMV1_BRANCH_OUTPUT;
-       else if (strcmp(args[3], "disable") == 0)
+       else if (strcmp(CMD_ARGV[3], "disable") == 0)
                tracemode |= 0;
        else
        {
                tracemode |= 0;
        else
        {
-               command_print(cmd_ctx, "invalid option '%s'", args[3]);
+               command_print(cmd_ctx, "invalid option '%s'", CMD_ARGV[3]);
                return ERROR_INVALID_ARGUMENTS;
        }
 
                return ERROR_INVALID_ARGUMENTS;
        }
 
@@ -1377,10 +1377,10 @@ COMMAND_HANDLER(handle_etm_config_command)
        if (CMD_ARGC != 5)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        if (CMD_ARGC != 5)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
-       target = get_target(args[0]);
+       target = get_target(CMD_ARGV[0]);
        if (!target)
        {
        if (!target)
        {
-               LOG_ERROR("target '%s' not defined", args[0]);
+               LOG_ERROR("target '%s' not defined", CMD_ARGV[0]);
                return ERROR_FAIL;
        }
 
                return ERROR_FAIL;
        }
 
@@ -1404,7 +1404,7 @@ COMMAND_HANDLER(handle_etm_config_command)
         *    "normal full" ...
         */
        uint8_t port_width;
         *    "normal full" ...
         */
        uint8_t port_width;
-       COMMAND_PARSE_NUMBER(u8, args[1], port_width);
+       COMMAND_PARSE_NUMBER(u8, CMD_ARGV[1], port_width);
        switch (port_width)
        {
                /* before ETMv3.0 */
        switch (port_width)
        {
                /* before ETMv3.0 */
@@ -1438,39 +1438,39 @@ COMMAND_HANDLER(handle_etm_config_command)
                        break;
                default:
                        command_print(cmd_ctx,
                        break;
                default:
                        command_print(cmd_ctx,
-                               "unsupported ETM port width '%s'", args[1]);
+                               "unsupported ETM port width '%s'", CMD_ARGV[1]);
                        return ERROR_FAIL;
        }
 
                        return ERROR_FAIL;
        }
 
-       if (strcmp("normal", args[2]) == 0)
+       if (strcmp("normal", CMD_ARGV[2]) == 0)
        {
                portmode |= ETM_PORT_NORMAL;
        }
        {
                portmode |= ETM_PORT_NORMAL;
        }
-       else if (strcmp("multiplexed", args[2]) == 0)
+       else if (strcmp("multiplexed", CMD_ARGV[2]) == 0)
        {
                portmode |= ETM_PORT_MUXED;
        }
        {
                portmode |= ETM_PORT_MUXED;
        }
-       else if (strcmp("demultiplexed", args[2]) == 0)
+       else if (strcmp("demultiplexed", CMD_ARGV[2]) == 0)
        {
                portmode |= ETM_PORT_DEMUXED;
        }
        else
        {
        {
                portmode |= ETM_PORT_DEMUXED;
        }
        else
        {
-               command_print(cmd_ctx, "unsupported ETM port mode '%s', must be 'normal', 'multiplexed' or 'demultiplexed'", args[2]);
+               command_print(cmd_ctx, "unsupported ETM port mode '%s', must be 'normal', 'multiplexed' or 'demultiplexed'", CMD_ARGV[2]);
                return ERROR_FAIL;
        }
 
                return ERROR_FAIL;
        }
 
-       if (strcmp("half", args[3]) == 0)
+       if (strcmp("half", CMD_ARGV[3]) == 0)
        {
                portmode |= ETM_PORT_HALF_CLOCK;
        }
        {
                portmode |= ETM_PORT_HALF_CLOCK;
        }
-       else if (strcmp("full", args[3]) == 0)
+       else if (strcmp("full", CMD_ARGV[3]) == 0)
        {
                portmode |= ETM_PORT_FULL_CLOCK;
        }
        else
        {
        {
                portmode |= ETM_PORT_FULL_CLOCK;
        }
        else
        {
-               command_print(cmd_ctx, "unsupported ETM port clocking '%s', must be 'full' or 'half'", args[3]);
+               command_print(cmd_ctx, "unsupported ETM port clocking '%s', must be 'full' or 'half'", CMD_ARGV[3]);
                return ERROR_FAIL;
        }
 
                return ERROR_FAIL;
        }
 
@@ -1482,7 +1482,7 @@ COMMAND_HANDLER(handle_etm_config_command)
 
        for (i = 0; etm_capture_drivers[i]; i++)
        {
 
        for (i = 0; etm_capture_drivers[i]; i++)
        {
-               if (strcmp(args[4], etm_capture_drivers[i]->name) == 0)
+               if (strcmp(CMD_ARGV[4], etm_capture_drivers[i]->name) == 0)
                {
                        int retval;
                        if ((retval = etm_capture_drivers[i]->register_commands(cmd_ctx)) != ERROR_OK)
                {
                        int retval;
                        if ((retval = etm_capture_drivers[i]->register_commands(cmd_ctx)) != ERROR_OK)
@@ -1501,7 +1501,7 @@ COMMAND_HANDLER(handle_etm_config_command)
        {
                /* no supported capture driver found, don't register an ETM */
                free(etm_ctx);
        {
                /* no supported capture driver found, don't register an ETM */
                free(etm_ctx);
-               LOG_ERROR("trace capture driver '%s' not found", args[4]);
+               LOG_ERROR("trace capture driver '%s' not found", CMD_ARGV[4]);
                return ERROR_FAIL;
        }
 
                return ERROR_FAIL;
        }
 
@@ -1766,14 +1766,14 @@ COMMAND_HANDLER(handle_etm_image_command)
        if (CMD_ARGC >= 2)
        {
                etm_ctx->image->base_address_set = 1;
        if (CMD_ARGC >= 2)
        {
                etm_ctx->image->base_address_set = 1;
-               COMMAND_PARSE_NUMBER(int, args[1], etm_ctx->image->base_address);
+               COMMAND_PARSE_NUMBER(int, CMD_ARGV[1], etm_ctx->image->base_address);
        }
        else
        {
                etm_ctx->image->base_address_set = 0;
        }
 
        }
        else
        {
                etm_ctx->image->base_address_set = 0;
        }
 
-       if (image_open(etm_ctx->image, args[0], (CMD_ARGC >= 3) ? args[2] : NULL) != ERROR_OK)
+       if (image_open(etm_ctx->image, CMD_ARGV[0], (CMD_ARGC >= 3) ? CMD_ARGV[2] : NULL) != ERROR_OK)
        {
                free(etm_ctx->image);
                etm_ctx->image = NULL;
        {
                free(etm_ctx->image);
                etm_ctx->image = NULL;
@@ -1829,7 +1829,7 @@ COMMAND_HANDLER(handle_etm_dump_command)
        if (etm_ctx->trace_depth == 0)
                etm_ctx->capture_driver->read_trace(etm_ctx);
 
        if (etm_ctx->trace_depth == 0)
                etm_ctx->capture_driver->read_trace(etm_ctx);
 
-       if (fileio_open(&file, args[0], FILEIO_WRITE, FILEIO_BINARY) != ERROR_OK)
+       if (fileio_open(&file, CMD_ARGV[0], FILEIO_WRITE, FILEIO_BINARY) != ERROR_OK)
        {
                return ERROR_FAIL;
        }
        {
                return ERROR_FAIL;
        }
@@ -1886,7 +1886,7 @@ COMMAND_HANDLER(handle_etm_load_command)
                return ERROR_FAIL;
        }
 
                return ERROR_FAIL;
        }
 
-       if (fileio_open(&file, args[0], FILEIO_READ, FILEIO_BINARY) != ERROR_OK)
+       if (fileio_open(&file, CMD_ARGV[0], FILEIO_READ, FILEIO_BINARY) != ERROR_OK)
        {
                return ERROR_FAIL;
        }
        {
                return ERROR_FAIL;
        }
@@ -1959,7 +1959,7 @@ COMMAND_HANDLER(handle_etm_trigger_percent_command)
        if (CMD_ARGC > 0)
        {
                uint32_t new_value;
        if (CMD_ARGC > 0)
        {
                uint32_t new_value;
-               COMMAND_PARSE_NUMBER(u32, args[0], new_value);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], new_value);
 
                if ((new_value < 2) || (new_value > 100))
                {
 
                if ((new_value < 2) || (new_value > 100))
                {
index b0ab1fb857815b6feee94e3816f7c5fb36945a28..ae538024b1ebf24462b90c2790cdcbda7b9a1cab 100644 (file)
@@ -30,18 +30,18 @@ COMMAND_HANDLER(handle_etm_dummy_config_command)
        struct target *target;
        struct arm *arm;
 
        struct target *target;
        struct arm *arm;
 
-       target = get_target(args[0]);
+       target = get_target(CMD_ARGV[0]);
 
        if (!target)
        {
 
        if (!target)
        {
-               LOG_ERROR("target '%s' not defined", args[0]);
+               LOG_ERROR("target '%s' not defined", CMD_ARGV[0]);
                return ERROR_FAIL;
        }
 
        arm = target_to_arm(target);
        if (!is_arm(arm))
        {
                return ERROR_FAIL;
        }
 
        arm = target_to_arm(target);
        if (!is_arm(arm))
        {
-               command_print(cmd_ctx, "target '%s' isn't an ARM", args[0]);
+               command_print(cmd_ctx, "target '%s' isn't an ARM", CMD_ARGV[0]);
                return ERROR_FAIL;
        }
 
                return ERROR_FAIL;
        }
 
index 47c2bb49cf3a3d03f4eb47e3e903b69f2731a0a7..74f89552eca9d90e45915ea3b47921c09c4c65cb 100644 (file)
@@ -316,7 +316,7 @@ COMMAND_HANDLER(handle_oocd_trace_config_command)
                oocd_trace->etm_ctx = arm->etm;
 
                /* copy name of TTY device used to communicate with OpenOCD + trace */
                oocd_trace->etm_ctx = arm->etm;
 
                /* copy name of TTY device used to communicate with OpenOCD + trace */
-               oocd_trace->tty = strndup(args[1], 256);
+               oocd_trace->tty = strndup(CMD_ARGV[1], 256);
        }
        else
        {
        }
        else
        {
index 88fea1778f21ae0165c07be8ba15368d0cd366b9..3143180465c1edb7c84cc2374c8697179d505791 100644 (file)
@@ -1650,9 +1650,9 @@ COMMAND_HANDLER(handle_targets_command)
 
        if (CMD_ARGC == 1)
        {
 
        if (CMD_ARGC == 1)
        {
-               target = get_target(args[0]);
+               target = get_target(CMD_ARGV[0]);
                if (target == NULL) {
                if (target == NULL) {
-                       command_print(cmd_ctx,"Target: %s is unknown, try one of:\n", args[0]);
+                       command_print(cmd_ctx,"Target: %s is unknown, try one of:\n", CMD_ARGV[0]);
                        goto DumpTargets;
                }
                if (!target->tap->enabled) {
                        goto DumpTargets;
                }
                if (!target->tap->enabled) {
@@ -1908,10 +1908,10 @@ COMMAND_HANDLER(handle_reg_command)
        }
 
        /* access a single register by its ordinal number */
        }
 
        /* access a single register by its ordinal number */
-       if ((args[0][0] >= '0') && (args[0][0] <= '9'))
+       if ((CMD_ARGV[0][0] >= '0') && (CMD_ARGV[0][0] <= '9'))
        {
                unsigned num;
        {
                unsigned num;
-               COMMAND_PARSE_NUMBER(uint, args[0], num);
+               COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], num);
 
                struct reg_cache *cache = target->reg_cache;
                count = 0;
 
                struct reg_cache *cache = target->reg_cache;
                count = 0;
@@ -1938,19 +1938,19 @@ COMMAND_HANDLER(handle_reg_command)
                }
        } else /* access a single register by its name */
        {
                }
        } else /* access a single register by its name */
        {
-               reg = register_get_by_name(target->reg_cache, args[0], 1);
+               reg = register_get_by_name(target->reg_cache, CMD_ARGV[0], 1);
 
                if (!reg)
                {
 
                if (!reg)
                {
-                       command_print(cmd_ctx, "register %s not found in current target", args[0]);
+                       command_print(cmd_ctx, "register %s not found in current target", CMD_ARGV[0]);
                        return ERROR_OK;
                }
        }
 
        /* display a register */
                        return ERROR_OK;
                }
        }
 
        /* display a register */
-       if ((CMD_ARGC == 1) || ((CMD_ARGC == 2) && !((args[1][0] >= '0') && (args[1][0] <= '9'))))
+       if ((CMD_ARGC == 1) || ((CMD_ARGC == 2) && !((CMD_ARGV[1][0] >= '0') && (CMD_ARGV[1][0] <= '9'))))
        {
        {
-               if ((CMD_ARGC == 2) && (strcmp(args[1], "force") == 0))
+               if ((CMD_ARGC == 2) && (strcmp(CMD_ARGV[1], "force") == 0))
                        reg->valid = 0;
 
                if (reg->valid == 0)
                        reg->valid = 0;
 
                if (reg->valid == 0)
@@ -1967,7 +1967,7 @@ COMMAND_HANDLER(handle_reg_command)
        if (CMD_ARGC == 2)
        {
                uint8_t *buf = malloc(DIV_ROUND_UP(reg->size, 8));
        if (CMD_ARGC == 2)
        {
                uint8_t *buf = malloc(DIV_ROUND_UP(reg->size, 8));
-               str_to_buf(args[1], strlen(args[1]), buf, reg->size, 0);
+               str_to_buf(CMD_ARGV[1], strlen(CMD_ARGV[1]), buf, reg->size, 0);
 
                reg->type->set(reg, buf);
 
 
                reg->type->set(reg, buf);
 
@@ -2007,11 +2007,11 @@ COMMAND_HANDLER(handle_poll_command)
        }
        else if (CMD_ARGC == 1)
        {
        }
        else if (CMD_ARGC == 1)
        {
-               if (strcmp(args[0], "on") == 0)
+               if (strcmp(CMD_ARGV[0], "on") == 0)
                {
                        jtag_poll_set_enabled(true);
                }
                {
                        jtag_poll_set_enabled(true);
                }
-               else if (strcmp(args[0], "off") == 0)
+               else if (strcmp(CMD_ARGV[0], "off") == 0)
                {
                        jtag_poll_set_enabled(false);
                }
                {
                        jtag_poll_set_enabled(false);
                }
@@ -2035,7 +2035,7 @@ COMMAND_HANDLER(handle_wait_halt_command)
        unsigned ms = 5000;
        if (1 == CMD_ARGC)
        {
        unsigned ms = 5000;
        if (1 == CMD_ARGC)
        {
-               int retval = parse_uint(args[0], &ms);
+               int retval = parse_uint(CMD_ARGV[0], &ms);
                if (ERROR_OK != retval)
                {
                        command_print(cmd_ctx, "usage: %s [seconds]", CMD_NAME);
                if (ERROR_OK != retval)
                {
                        command_print(cmd_ctx, "usage: %s [seconds]", CMD_NAME);
@@ -2106,7 +2106,7 @@ COMMAND_HANDLER(handle_halt_command)
        if (CMD_ARGC == 1)
        {
                unsigned wait;
        if (CMD_ARGC == 1)
        {
                unsigned wait;
-               retval = parse_uint(args[0], &wait);
+               retval = parse_uint(CMD_ARGV[0], &wait);
                if (ERROR_OK != retval)
                        return ERROR_COMMAND_SYNTAX_ERROR;
                if (!wait)
                if (ERROR_OK != retval)
                        return ERROR_COMMAND_SYNTAX_ERROR;
                if (!wait)
@@ -2136,7 +2136,7 @@ COMMAND_HANDLER(handle_reset_command)
        if (CMD_ARGC == 1)
        {
                const Jim_Nvp *n;
        if (CMD_ARGC == 1)
        {
                const Jim_Nvp *n;
-               n = Jim_Nvp_name2value_simple(nvp_reset_modes, args[0]);
+               n = Jim_Nvp_name2value_simple(nvp_reset_modes, CMD_ARGV[0]);
                if ((n->name == NULL) || (n->value == RESET_UNKNOWN)) {
                        return ERROR_COMMAND_SYNTAX_ERROR;
                }
                if ((n->name == NULL) || (n->value == RESET_UNKNOWN)) {
                        return ERROR_COMMAND_SYNTAX_ERROR;
                }
@@ -2157,13 +2157,13 @@ COMMAND_HANDLER(handle_resume_command)
        struct target *target = get_current_target(cmd_ctx);
        target_handle_event(target, TARGET_EVENT_OLD_pre_resume);
 
        struct target *target = get_current_target(cmd_ctx);
        target_handle_event(target, TARGET_EVENT_OLD_pre_resume);
 
-       /* with no args, resume from current pc, addr = 0,
-        * with one arguments, addr = args[0],
+       /* with no CMD_ARGV, resume from current pc, addr = 0,
+        * with one arguments, addr = CMD_ARGV[0],
         * handle breakpoints, not debugging */
        uint32_t addr = 0;
        if (CMD_ARGC == 1)
        {
         * handle breakpoints, not debugging */
        uint32_t addr = 0;
        if (CMD_ARGC == 1)
        {
-               COMMAND_PARSE_NUMBER(u32, args[0], addr);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], addr);
                current = 0;
        }
 
                current = 0;
        }
 
@@ -2177,14 +2177,14 @@ COMMAND_HANDLER(handle_step_command)
 
        LOG_DEBUG("-");
 
 
        LOG_DEBUG("-");
 
-       /* with no args, step from current pc, addr = 0,
-        * with one argument addr = args[0],
+       /* with no CMD_ARGV, step from current pc, addr = 0,
+        * with one argument addr = CMD_ARGV[0],
         * handle breakpoints, debugging */
        uint32_t addr = 0;
        int current_pc = 1;
        if (CMD_ARGC == 1)
        {
         * handle breakpoints, debugging */
        uint32_t addr = 0;
        int current_pc = 1;
        if (CMD_ARGC == 1)
        {
-               COMMAND_PARSE_NUMBER(u32, args[0], addr);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], addr);
                current_pc = 0;
        }
 
                current_pc = 0;
        }
 
@@ -2256,13 +2256,13 @@ COMMAND_HANDLER(handle_md_command)
        default: return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
        default: return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
-       bool physical=strcmp(args[0], "phys")==0;
+       bool physical=strcmp(CMD_ARGV[0], "phys")==0;
        int (*fn)(struct target *target,
                        uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer);
        if (physical)
        {
                CMD_ARGC--;
        int (*fn)(struct target *target,
                        uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer);
        if (physical)
        {
                CMD_ARGC--;
-               args++;
+               CMD_ARGV++;
                fn=target_read_phys_memory;
        } else
        {
                fn=target_read_phys_memory;
        } else
        {
@@ -2274,11 +2274,11 @@ COMMAND_HANDLER(handle_md_command)
        }
 
        uint32_t address;
        }
 
        uint32_t address;
-       COMMAND_PARSE_NUMBER(u32, args[0], address);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], address);
 
        unsigned count = 1;
        if (CMD_ARGC == 2)
 
        unsigned count = 1;
        if (CMD_ARGC == 2)
-               COMMAND_PARSE_NUMBER(uint, args[1], count);
+               COMMAND_PARSE_NUMBER(uint, CMD_ARGV[1], count);
 
        uint8_t *buffer = calloc(count, size);
 
 
        uint8_t *buffer = calloc(count, size);
 
@@ -2298,14 +2298,14 @@ COMMAND_HANDLER(handle_mw_command)
        {
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
        {
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
-       bool physical=strcmp(args[0], "phys")==0;
+       bool physical=strcmp(CMD_ARGV[0], "phys")==0;
        int (*fn)(struct target *target,
                        uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer);
        const char *cmd_name = CMD_NAME;
        if (physical)
        {
                CMD_ARGC--;
        int (*fn)(struct target *target,
                        uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer);
        const char *cmd_name = CMD_NAME;
        if (physical)
        {
                CMD_ARGC--;
-               args++;
+               CMD_ARGV++;
                fn=target_write_phys_memory;
        } else
        {
                fn=target_write_phys_memory;
        } else
        {
@@ -2315,14 +2315,14 @@ COMMAND_HANDLER(handle_mw_command)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        uint32_t address;
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        uint32_t address;
-       COMMAND_PARSE_NUMBER(u32, args[0], address);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], address);
 
        uint32_t value;
 
        uint32_t value;
-       COMMAND_PARSE_NUMBER(u32, args[1], value);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], value);
 
        unsigned count = 1;
        if (CMD_ARGC == 3)
 
        unsigned count = 1;
        if (CMD_ARGC == 3)
-               COMMAND_PARSE_NUMBER(uint, args[2], count);
+               COMMAND_PARSE_NUMBER(uint, CMD_ARGV[2], count);
 
        struct target *target = get_current_target(cmd_ctx);
        unsigned wordsize;
 
        struct target *target = get_current_target(cmd_ctx);
        unsigned wordsize;
@@ -2357,7 +2357,7 @@ COMMAND_HANDLER(handle_mw_command)
 
 }
 
 
 }
 
-static COMMAND_HELPER(parse_load_image_command_args, struct image *image,
+static COMMAND_HELPER(parse_load_image_command_CMD_ARGV, struct image *image,
                uint32_t *min_address, uint32_t *max_address)
 {
        if (CMD_ARGC < 1 || CMD_ARGC > 5)
                uint32_t *min_address, uint32_t *max_address)
 {
        if (CMD_ARGC < 1 || CMD_ARGC > 5)
@@ -2368,7 +2368,7 @@ static COMMAND_HELPER(parse_load_image_command_args, struct image *image,
        if (CMD_ARGC >= 2)
        {
                uint32_t addr;
        if (CMD_ARGC >= 2)
        {
                uint32_t addr;
-               COMMAND_PARSE_NUMBER(u32, args[1], addr);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], addr);
                image->base_address = addr;
                image->base_address_set = 1;
        }
                image->base_address = addr;
                image->base_address_set = 1;
        }
@@ -2379,11 +2379,11 @@ static COMMAND_HELPER(parse_load_image_command_args, struct image *image,
 
        if (CMD_ARGC >= 4)
        {
 
        if (CMD_ARGC >= 4)
        {
-               COMMAND_PARSE_NUMBER(u32, args[3], *min_address);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[3], *min_address);
        }
        if (CMD_ARGC == 5)
        {
        }
        if (CMD_ARGC == 5)
        {
-               COMMAND_PARSE_NUMBER(u32, args[4], *max_address);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[4], *max_address);
                // use size (given) to find max (required)
                *max_address += *min_address;
        }
                // use size (given) to find max (required)
                *max_address += *min_address;
        }
@@ -2404,7 +2404,7 @@ COMMAND_HANDLER(handle_load_image_command)
        int i;
        struct image image;
 
        int i;
        struct image image;
 
-       int retval = CALL_COMMAND_HANDLER(parse_load_image_command_args,
+       int retval = CALL_COMMAND_HANDLER(parse_load_image_command_CMD_ARGV,
                        &image, &min_address, &max_address);
        if (ERROR_OK != retval)
                return retval;
                        &image, &min_address, &max_address);
        if (ERROR_OK != retval)
                return retval;
@@ -2414,7 +2414,7 @@ COMMAND_HANDLER(handle_load_image_command)
        struct duration bench;
        duration_start(&bench);
 
        struct duration bench;
        duration_start(&bench);
 
-       if (image_open(&image, args[0], (CMD_ARGC >= 3) ? args[2] : NULL) != ERROR_OK)
+       if (image_open(&image, CMD_ARGV[0], (CMD_ARGC >= 3) ? CMD_ARGV[2] : NULL) != ERROR_OK)
        {
                return ERROR_OK;
        }
        {
                return ERROR_OK;
        }
@@ -2502,11 +2502,11 @@ COMMAND_HANDLER(handle_dump_image_command)
        }
 
        uint32_t address;
        }
 
        uint32_t address;
-       COMMAND_PARSE_NUMBER(u32, args[1], address);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], address);
        uint32_t size;
        uint32_t size;
-       COMMAND_PARSE_NUMBER(u32, args[2], size);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], size);
 
 
-       if (fileio_open(&fileio, args[0], FILEIO_WRITE, FILEIO_BINARY) != ERROR_OK)
+       if (fileio_open(&fileio, CMD_ARGV[0], FILEIO_WRITE, FILEIO_BINARY) != ERROR_OK)
        {
                return ERROR_OK;
        }
        {
                return ERROR_OK;
        }
@@ -2579,7 +2579,7 @@ static COMMAND_HELPER(handle_verify_image_command_internal, int verify)
        if (CMD_ARGC >= 2)
        {
                uint32_t addr;
        if (CMD_ARGC >= 2)
        {
                uint32_t addr;
-               COMMAND_PARSE_NUMBER(u32, args[1], addr);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], addr);
                image.base_address = addr;
                image.base_address_set = 1;
        }
                image.base_address = addr;
                image.base_address_set = 1;
        }
@@ -2591,7 +2591,7 @@ static COMMAND_HELPER(handle_verify_image_command_internal, int verify)
 
        image.start_address_set = 0;
 
 
        image.start_address_set = 0;
 
-       if ((retval = image_open(&image, args[0], (CMD_ARGC == 3) ? args[2] : NULL)) != ERROR_OK)
+       if ((retval = image_open(&image, CMD_ARGV[0], (CMD_ARGC == 3) ? CMD_ARGV[2] : NULL)) != ERROR_OK)
        {
                return retval;
        }
        {
                return retval;
        }
@@ -2755,14 +2755,14 @@ COMMAND_HANDLER(handle_bp_command)
        }
 
        uint32_t addr;
        }
 
        uint32_t addr;
-       COMMAND_PARSE_NUMBER(u32, args[0], addr);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], addr);
        uint32_t length;
        uint32_t length;
-       COMMAND_PARSE_NUMBER(u32, args[1], length);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], length);
 
        int hw = BKPT_SOFT;
        if (CMD_ARGC == 3)
        {
 
        int hw = BKPT_SOFT;
        if (CMD_ARGC == 3)
        {
-               if (strcmp(args[2], "hw") == 0)
+               if (strcmp(CMD_ARGV[2], "hw") == 0)
                        hw = BKPT_HARD;
                else
                        return ERROR_COMMAND_SYNTAX_ERROR;
                        hw = BKPT_HARD;
                else
                        return ERROR_COMMAND_SYNTAX_ERROR;
@@ -2777,7 +2777,7 @@ COMMAND_HANDLER(handle_rbp_command)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        uint32_t addr;
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        uint32_t addr;
-       COMMAND_PARSE_NUMBER(u32, args[0], addr);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], addr);
 
        struct target *target = get_current_target(cmd_ctx);
        breakpoint_remove(target, addr);
 
        struct target *target = get_current_target(cmd_ctx);
        breakpoint_remove(target, addr);
@@ -2818,13 +2818,13 @@ COMMAND_HANDLER(handle_wp_command)
        switch (CMD_ARGC)
        {
        case 5:
        switch (CMD_ARGC)
        {
        case 5:
-               COMMAND_PARSE_NUMBER(u32, args[4], data_mask);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[4], data_mask);
                // fall through
        case 4:
                // fall through
        case 4:
-               COMMAND_PARSE_NUMBER(u32, args[3], data_value);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[3], data_value);
                // fall through
        case 3:
                // fall through
        case 3:
-               switch (args[2][0])
+               switch (CMD_ARGV[2][0])
                {
                case 'r':
                        type = WPT_READ;
                {
                case 'r':
                        type = WPT_READ;
@@ -2836,13 +2836,13 @@ COMMAND_HANDLER(handle_wp_command)
                        type = WPT_ACCESS;
                        break;
                default:
                        type = WPT_ACCESS;
                        break;
                default:
-                       LOG_ERROR("invalid watchpoint mode ('%c')", args[2][0]);
+                       LOG_ERROR("invalid watchpoint mode ('%c')", CMD_ARGV[2][0]);
                        return ERROR_COMMAND_SYNTAX_ERROR;
                }
                // fall through
        case 2:
                        return ERROR_COMMAND_SYNTAX_ERROR;
                }
                // fall through
        case 2:
-               COMMAND_PARSE_NUMBER(u32, args[1], length);
-               COMMAND_PARSE_NUMBER(u32, args[0], addr);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], length);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], addr);
                break;
 
        default:
                break;
 
        default:
@@ -2865,7 +2865,7 @@ COMMAND_HANDLER(handle_rwp_command)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        uint32_t addr;
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        uint32_t addr;
-       COMMAND_PARSE_NUMBER(u32, args[0], addr);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], addr);
 
        struct target *target = get_current_target(cmd_ctx);
        watchpoint_remove(target, addr);
 
        struct target *target = get_current_target(cmd_ctx);
        watchpoint_remove(target, addr);
@@ -2886,7 +2886,7 @@ COMMAND_HANDLER(handle_virt2phys_command)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        uint32_t va;
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        uint32_t va;
-       COMMAND_PARSE_NUMBER(u32, args[0], va);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], va);
        uint32_t pa;
 
        struct target *target = get_current_target(cmd_ctx);
        uint32_t pa;
 
        struct target *target = get_current_target(cmd_ctx);
@@ -3025,7 +3025,7 @@ COMMAND_HANDLER(handle_profile_command)
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
        unsigned offset;
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
        unsigned offset;
-       COMMAND_PARSE_NUMBER(uint, args[0], offset);
+       COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], offset);
 
        timeval_add_time(&timeout, offset, 0);
 
 
        timeval_add_time(&timeout, offset, 0);
 
@@ -3088,8 +3088,8 @@ COMMAND_HANDLER(handle_profile_command)
                                free(samples);
                                return retval;
                        }
                                free(samples);
                                return retval;
                        }
-                       writeGmon(samples, numSamples, args[1]);
-                       command_print(cmd_ctx, "Wrote %s", args[1]);
+                       writeGmon(samples, numSamples, CMD_ARGV[1]);
+                       command_print(cmd_ctx, "Wrote %s", CMD_ARGV[1]);
                        break;
                }
        }
                        break;
                }
        }
@@ -4543,7 +4543,7 @@ COMMAND_HANDLER(handle_fast_load_image_command)
 
        struct image image;
 
 
        struct image image;
 
-       int retval = CALL_COMMAND_HANDLER(parse_load_image_command_args,
+       int retval = CALL_COMMAND_HANDLER(parse_load_image_command_CMD_ARGV,
                        &image, &min_address, &max_address);
        if (ERROR_OK != retval)
                return retval;
                        &image, &min_address, &max_address);
        if (ERROR_OK != retval)
                return retval;
@@ -4551,7 +4551,7 @@ COMMAND_HANDLER(handle_fast_load_image_command)
        struct duration bench;
        duration_start(&bench);
 
        struct duration bench;
        duration_start(&bench);
 
-       if (image_open(&image, args[0], (CMD_ARGC >= 3) ? args[2] : NULL) != ERROR_OK)
+       if (image_open(&image, CMD_ARGV[0], (CMD_ARGC >= 3) ? CMD_ARGV[2] : NULL) != ERROR_OK)
        {
                return ERROR_OK;
        }
        {
                return ERROR_OK;
        }
@@ -4795,7 +4795,7 @@ int target_register_user_commands(struct command_context *cmd_ctx)
 
        register_command(cmd_ctx, NULL, "fast_load_image",
                        handle_fast_load_image_command, COMMAND_ANY,
 
        register_command(cmd_ctx, NULL, "fast_load_image",
                        handle_fast_load_image_command, COMMAND_ANY,
-                       "same args as load_image, image stored in memory "
+                       "same CMD_ARGV as load_image, image stored in memory "
                        "- mainly for profiling purposes");
 
        register_command(cmd_ctx, NULL, "fast_load",
                        "- mainly for profiling purposes");
 
        register_command(cmd_ctx, NULL, "fast_load",
index c5de691ae9e107e422a0bc648355b5aeeaa49081..1d618cc5bc174c7313193707582dab696a888e3e 100644 (file)
@@ -270,7 +270,7 @@ COMMAND_HANDLER(handle_target_request_debugmsgs_command)
 
        if (CMD_ARGC > 0)
        {
 
        if (CMD_ARGC > 0)
        {
-               if (!strcmp(args[0], "enable") || !strcmp(args[0], "charmsg"))
+               if (!strcmp(CMD_ARGV[0], "enable") || !strcmp(CMD_ARGV[0], "charmsg"))
                {
                        /* don't register if this command context is already receiving */
                        if (!receiving)
                {
                        /* don't register if this command context is already receiving */
                        if (!receiving)
@@ -278,9 +278,9 @@ COMMAND_HANDLER(handle_target_request_debugmsgs_command)
                                receiving = 1;
                                add_debug_msg_receiver(cmd_ctx, target);
                        }
                                receiving = 1;
                                add_debug_msg_receiver(cmd_ctx, target);
                        }
-                       charmsg_mode = !strcmp(args[0], "charmsg");
+                       charmsg_mode = !strcmp(CMD_ARGV[0], "charmsg");
                }
                }
-               else if (!strcmp(args[0], "disable"))
+               else if (!strcmp(CMD_ARGV[0], "disable"))
                {
                        /* no need to delete a receiver if none is registered */
                        if (receiving)
                {
                        /* no need to delete a receiver if none is registered */
                        if (receiving)
index 88f4ed32921a67db3f9ab53d66865bcf63e52967..f2fd790c2fb197d40854b538d2c842b1d34ea99a 100644 (file)
@@ -66,7 +66,7 @@ COMMAND_HANDLER(handle_trace_point_command)
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
-       if (!strcmp(args[0], "clear"))
+       if (!strcmp(CMD_ARGV[0], "clear"))
        {
                if (trace->trace_points)
                {
        {
                if (trace->trace_points)
                {
@@ -87,7 +87,7 @@ COMMAND_HANDLER(handle_trace_point_command)
        }
 
        uint32_t address;
        }
 
        uint32_t address;
-       COMMAND_PARSE_NUMBER(u32, args[0], address);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], address);
        trace->trace_points[trace->num_trace_points].address = address;
        trace->trace_points[trace->num_trace_points].hit_counter = 0;
        trace->num_trace_points++;
        trace->trace_points[trace->num_trace_points].address = address;
        trace->trace_points[trace->num_trace_points].hit_counter = 0;
        trace->num_trace_points++;
@@ -105,7 +105,7 @@ COMMAND_HANDLER(handle_trace_history_command)
                trace->trace_history_pos = 0;
                trace->trace_history_overflowed = 0;
 
                trace->trace_history_pos = 0;
                trace->trace_history_overflowed = 0;
 
-               if (!strcmp(args[0], "clear"))
+               if (!strcmp(CMD_ARGV[0], "clear"))
                {
                        /* clearing is implicit, we've just reset position anyway */
                        return ERROR_OK;
                {
                        /* clearing is implicit, we've just reset position anyway */
                        return ERROR_OK;
@@ -114,7 +114,7 @@ COMMAND_HANDLER(handle_trace_history_command)
                if (trace->trace_history)
                        free(trace->trace_history);
 
                if (trace->trace_history)
                        free(trace->trace_history);
 
-               COMMAND_PARSE_NUMBER(u32, args[0], trace->trace_history_size);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], trace->trace_history_size);
                trace->trace_history = malloc(sizeof(uint32_t) * trace->trace_history_size);
 
                command_print(cmd_ctx, "new trace history size: %i", (int)(trace->trace_history_size));
                trace->trace_history = malloc(sizeof(uint32_t) * trace->trace_history_size);
 
                command_print(cmd_ctx, "new trace history size: %i", (int)(trace->trace_history_size));
index 3af28d052d999d6aad41f544becc7ef8ffa0708b..9500a33b67ab304f1f7bbcf661af3538c65d573a 100644 (file)
@@ -3001,9 +3001,9 @@ COMMAND_HANDLER(xscale_handle_debug_handler_command)
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
-       if ((target = get_target(args[0])) == NULL)
+       if ((target = get_target(CMD_ARGV[0])) == NULL)
        {
        {
-               LOG_ERROR("target '%s' not defined", args[0]);
+               LOG_ERROR("target '%s' not defined", CMD_ARGV[0]);
                return ERROR_FAIL;
        }
 
                return ERROR_FAIL;
        }
 
@@ -3012,7 +3012,7 @@ COMMAND_HANDLER(xscale_handle_debug_handler_command)
        if (retval != ERROR_OK)
                return retval;
 
        if (retval != ERROR_OK)
                return retval;
 
-       COMMAND_PARSE_NUMBER(u32, args[1], handler_address);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], handler_address);
 
        if (((handler_address >= 0x800) && (handler_address <= 0x1fef800)) ||
                ((handler_address >= 0xfe000800) && (handler_address <= 0xfffff800)))
 
        if (((handler_address >= 0x800) && (handler_address <= 0x1fef800)) ||
                ((handler_address >= 0xfe000800) && (handler_address <= 0xfffff800)))
@@ -3040,10 +3040,10 @@ COMMAND_HANDLER(xscale_handle_cache_clean_address_command)
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
-       target = get_target(args[0]);
+       target = get_target(CMD_ARGV[0]);
        if (target == NULL)
        {
        if (target == NULL)
        {
-               LOG_ERROR("target '%s' not defined", args[0]);
+               LOG_ERROR("target '%s' not defined", CMD_ARGV[0]);
                return ERROR_FAIL;
        }
        xscale = target_to_xscale(target);
                return ERROR_FAIL;
        }
        xscale = target_to_xscale(target);
@@ -3051,7 +3051,7 @@ COMMAND_HANDLER(xscale_handle_cache_clean_address_command)
        if (retval != ERROR_OK)
                return retval;
 
        if (retval != ERROR_OK)
                return retval;
 
-       COMMAND_PARSE_NUMBER(u32, args[1], cache_clean_address);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], cache_clean_address);
 
        if (cache_clean_address & 0xffff)
        {
 
        if (cache_clean_address & 0xffff)
        {
@@ -3132,12 +3132,12 @@ COMMAND_HANDLER(xscale_handle_mmu_command)
 
        if (CMD_ARGC >= 1)
        {
 
        if (CMD_ARGC >= 1)
        {
-               if (strcmp("enable", args[0]) == 0)
+               if (strcmp("enable", CMD_ARGV[0]) == 0)
                {
                        xscale_enable_mmu_caches(target, 1, 0, 0);
                        xscale->armv4_5_mmu.mmu_enabled = 1;
                }
                {
                        xscale_enable_mmu_caches(target, 1, 0, 0);
                        xscale->armv4_5_mmu.mmu_enabled = 1;
                }
-               else if (strcmp("disable", args[0]) == 0)
+               else if (strcmp("disable", CMD_ARGV[0]) == 0)
                {
                        xscale_disable_mmu_caches(target, 1, 0, 0);
                        xscale->armv4_5_mmu.mmu_enabled = 0;
                {
                        xscale_disable_mmu_caches(target, 1, 0, 0);
                        xscale->armv4_5_mmu.mmu_enabled = 0;
@@ -3173,7 +3173,7 @@ COMMAND_HANDLER(xscale_handle_idcache_command)
 
        if (CMD_ARGC >= 1)
        {
 
        if (CMD_ARGC >= 1)
        {
-               if (strcmp("enable", args[0]) == 0)
+               if (strcmp("enable", CMD_ARGV[0]) == 0)
                {
                        xscale_enable_mmu_caches(target, 0, dcache, icache);
 
                {
                        xscale_enable_mmu_caches(target, 0, dcache, icache);
 
@@ -3182,7 +3182,7 @@ COMMAND_HANDLER(xscale_handle_idcache_command)
                        else if (dcache)
                                xscale->armv4_5_mmu.armv4_5_cache.d_u_cache_enabled = 1;
                }
                        else if (dcache)
                                xscale->armv4_5_mmu.armv4_5_cache.d_u_cache_enabled = 1;
                }
-               else if (strcmp("disable", args[0]) == 0)
+               else if (strcmp("disable", CMD_ARGV[0]) == 0)
                {
                        xscale_disable_mmu_caches(target, 0, dcache, icache);
 
                {
                        xscale_disable_mmu_caches(target, 0, dcache, icache);
 
@@ -3218,7 +3218,7 @@ COMMAND_HANDLER(xscale_handle_vector_catch_command)
        }
        else
        {
        }
        else
        {
-               COMMAND_PARSE_NUMBER(u8, args[0], xscale->vector_catch);
+               COMMAND_PARSE_NUMBER(u8, CMD_ARGV[0], xscale->vector_catch);
                buf_set_u32(xscale->reg_cache->reg_list[XSCALE_DCSR].value, 16, 8, xscale->vector_catch);
                xscale_write_dcsr(target, -1, -1);
        }
                buf_set_u32(xscale->reg_cache->reg_list[XSCALE_DCSR].value, 16, 8, xscale->vector_catch);
                xscale_write_dcsr(target, -1, -1);
        }
@@ -3259,19 +3259,19 @@ COMMAND_HANDLER(xscale_handle_vector_table_command)
        else
        {
                int idx;
        else
        {
                int idx;
-               COMMAND_PARSE_NUMBER(int, args[1], idx);
+               COMMAND_PARSE_NUMBER(int, CMD_ARGV[1], idx);
                uint32_t vec;
                uint32_t vec;
-               COMMAND_PARSE_NUMBER(u32, args[2], vec);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], vec);
 
                if (idx < 1 || idx >= 8)
                        err = 1;
 
 
                if (idx < 1 || idx >= 8)
                        err = 1;
 
-               if (!err && strcmp(args[0], "low") == 0)
+               if (!err && strcmp(CMD_ARGV[0], "low") == 0)
                {
                        xscale->static_low_vectors_set |= (1<<idx);
                        xscale->static_low_vectors[idx] = vec;
                }
                {
                        xscale->static_low_vectors_set |= (1<<idx);
                        xscale->static_low_vectors[idx] = vec;
                }
-               else if (!err && (strcmp(args[0], "high") == 0))
+               else if (!err && (strcmp(CMD_ARGV[0], "high") == 0))
                {
                        xscale->static_high_vectors_set |= (1<<idx);
                        xscale->static_high_vectors[idx] = vec;
                {
                        xscale->static_high_vectors_set |= (1<<idx);
                        xscale->static_high_vectors[idx] = vec;
@@ -3305,7 +3305,7 @@ COMMAND_HANDLER(xscale_handle_trace_buffer_command)
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
-       if ((CMD_ARGC >= 1) && (strcmp("enable", args[0]) == 0))
+       if ((CMD_ARGC >= 1) && (strcmp("enable", CMD_ARGV[0]) == 0))
        {
                struct xscale_trace_data *td, *next_td;
                xscale->trace.buffer_enabled = 1;
        {
                struct xscale_trace_data *td, *next_td;
                xscale->trace.buffer_enabled = 1;
@@ -3323,19 +3323,19 @@ COMMAND_HANDLER(xscale_handle_trace_buffer_command)
                }
                xscale->trace.data = NULL;
        }
                }
                xscale->trace.data = NULL;
        }
-       else if ((CMD_ARGC >= 1) && (strcmp("disable", args[0]) == 0))
+       else if ((CMD_ARGC >= 1) && (strcmp("disable", CMD_ARGV[0]) == 0))
        {
                xscale->trace.buffer_enabled = 0;
        }
 
        {
                xscale->trace.buffer_enabled = 0;
        }
 
-       if ((CMD_ARGC >= 2) && (strcmp("fill", args[1]) == 0))
+       if ((CMD_ARGC >= 2) && (strcmp("fill", CMD_ARGV[1]) == 0))
        {
                uint32_t fill = 1;
                if (CMD_ARGC >= 3)
        {
                uint32_t fill = 1;
                if (CMD_ARGC >= 3)
-                       COMMAND_PARSE_NUMBER(u32, args[2], fill);
+                       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], fill);
                xscale->trace.buffer_fill = fill;
        }
                xscale->trace.buffer_fill = fill;
        }
-       else if ((CMD_ARGC >= 2) && (strcmp("wrap", args[1]) == 0))
+       else if ((CMD_ARGC >= 2) && (strcmp("wrap", CMD_ARGV[1]) == 0))
        {
                xscale->trace.buffer_fill = -1;
        }
        {
                xscale->trace.buffer_fill = -1;
        }
@@ -3397,14 +3397,14 @@ COMMAND_HANDLER(xscale_handle_trace_image_command)
        if (CMD_ARGC >= 2)
        {
                xscale->trace.image->base_address_set = 1;
        if (CMD_ARGC >= 2)
        {
                xscale->trace.image->base_address_set = 1;
-               COMMAND_PARSE_NUMBER(int, args[1], xscale->trace.image->base_address);
+               COMMAND_PARSE_NUMBER(int, CMD_ARGV[1], xscale->trace.image->base_address);
        }
        else
        {
                xscale->trace.image->base_address_set = 0;
        }
 
        }
        else
        {
                xscale->trace.image->base_address_set = 0;
        }
 
-       if (image_open(xscale->trace.image, args[0], (CMD_ARGC >= 3) ? args[2] : NULL) != ERROR_OK)
+       if (image_open(xscale->trace.image, CMD_ARGV[0], (CMD_ARGC >= 3) ? CMD_ARGV[2] : NULL) != ERROR_OK)
        {
                free(xscale->trace.image);
                xscale->trace.image = NULL;
        {
                free(xscale->trace.image);
                xscale->trace.image = NULL;
@@ -3446,7 +3446,7 @@ COMMAND_HANDLER(xscale_handle_dump_trace_command)
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
-       if (fileio_open(&file, args[0], FILEIO_WRITE, FILEIO_BINARY) != ERROR_OK)
+       if (fileio_open(&file, CMD_ARGV[0], FILEIO_WRITE, FILEIO_BINARY) != ERROR_OK)
        {
                return ERROR_OK;
        }
        {
                return ERROR_OK;
        }
@@ -3505,7 +3505,7 @@ COMMAND_HANDLER(xscale_handle_cp15)
        struct reg *reg = NULL;
        if (CMD_ARGC > 0)
        {
        struct reg *reg = NULL;
        if (CMD_ARGC > 0)
        {
-               COMMAND_PARSE_NUMBER(u32, args[0], reg_no);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], reg_no);
                /*translate from xscale cp15 register no to openocd register*/
                switch (reg_no)
                {
                /*translate from xscale cp15 register no to openocd register*/
                switch (reg_no)
                {
@@ -3552,7 +3552,7 @@ COMMAND_HANDLER(xscale_handle_cp15)
        else if (CMD_ARGC == 2)
        {
                uint32_t value;
        else if (CMD_ARGC == 2)
        {
                uint32_t value;
-               COMMAND_PARSE_NUMBER(u32, args[1], value);
+               COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], value);
 
                /* send CP write request (command 0x41) */
                xscale_send_u32(target, 0x41);
 
                /* send CP write request (command 0x41) */
                xscale_send_u32(target, 0x41);
index 311acc6077fb4008e0bec565fc3d44f8f40a5de0..1fe0b867020ce5a6e2def987f9ba4f85cab6bb33 100644 (file)
@@ -225,15 +225,15 @@ COMMAND_HANDLER(handle_xsvf_command)
                return ERROR_FAIL;
        }
 
                return ERROR_FAIL;
        }
 
-       /* we mess with args starting point below, snapshot filename here */
-       const char *filename = args[1];
+       /* we mess with CMD_ARGV starting point below, snapshot filename here */
+       const char *filename = CMD_ARGV[1];
 
 
-       if (strcmp(args[0], "plain") != 0)
+       if (strcmp(CMD_ARGV[0], "plain") != 0)
        {
        {
-               tap = jtag_tap_by_string(args[0]);
+               tap = jtag_tap_by_string(CMD_ARGV[0]);
                if (!tap)
                {
                if (!tap)
                {
-                       command_print(cmd_ctx, "Tap: %s unknown", args[0]);
+                       command_print(cmd_ctx, "Tap: %s unknown", CMD_ARGV[0]);
                        return ERROR_FAIL;
                }
        }
                        return ERROR_FAIL;
                }
        }
@@ -245,14 +245,14 @@ COMMAND_HANDLER(handle_xsvf_command)
        }
 
        /* if this argument is present, then interpret xruntest counts as TCK cycles rather than as usecs */
        }
 
        /* if this argument is present, then interpret xruntest counts as TCK cycles rather than as usecs */
-       if ((CMD_ARGC > 2) && (strcmp(args[2], "virt2") == 0))
+       if ((CMD_ARGC > 2) && (strcmp(CMD_ARGV[2], "virt2") == 0))
        {
                runtest_requires_tck = 1;
                --CMD_ARGC;
        {
                runtest_requires_tck = 1;
                --CMD_ARGC;
-               ++args;
+               ++CMD_ARGV;
        }
 
        }
 
-       if ((CMD_ARGC > 2) && (strcmp(args[2], "quiet") == 0))
+       if ((CMD_ARGC > 2) && (strcmp(CMD_ARGV[2], "quiet") == 0))
        {
                verbose = 0;
        }
        {
                verbose = 0;
        }

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)