]> git.sur5r.net Git - openocd/commitdiff
use COMMAND_HANDLER macro to define all commands
authorZachary T Welch <zw@superlucidity.net>
Tue, 10 Nov 2009 07:56:52 +0000 (23:56 -0800)
committerZachary T Welch <zw@superlucidity.net>
Fri, 13 Nov 2009 18:51:45 +0000 (10:51 -0800)
55 files changed:
src/flash/at91sam3.c
src/flash/at91sam7.c
src/flash/avrf.c
src/flash/flash.c
src/flash/lpc2000.c
src/flash/lpc2900.c
src/flash/lpc3180_nand_controller.c
src/flash/mflash.c
src/flash/nand.c
src/flash/pic32mx.c
src/flash/stellaris.c
src/flash/stm32x.c
src/flash/str7x.c
src/flash/str9x.c
src/flash/str9xpec.c
src/flash/tms470.c
src/helper/command.c
src/helper/ioutil.c
src/helper/log.c
src/jtag/amt_jtagaccel.c
src/jtag/ft2232.c
src/jtag/gw16012.c
src/jtag/parport.c
src/jtag/presto.c
src/jtag/tcl.c
src/jtag/vsllink.c
src/openocd.c
src/pld/pld.c
src/pld/virtex2.c
src/server/gdb_server.c
src/server/server.c
src/server/tcl_server.c
src/server/telnet_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/armv4_5.c
src/target/armv7a.c
src/target/armv7m.c
src/target/cortex_a8.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 714e8b8b888d42542c6cbb780f64e3ece62b52ce..804a35b44be37c80fc863268e345370c426e62f4 100644 (file)
@@ -2266,8 +2266,7 @@ sam3_write(struct flash_bank_s *bank,
        return r;
 }
 
-static int
-sam3_handle_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(sam3_handle_info_command)
 {
        struct sam3_chip *pChip;
        void *vp;
@@ -2343,8 +2342,7 @@ sam3_handle_info_command(struct command_context_s *cmd_ctx, char *cmd, char **ar
        return ERROR_OK;
 }
 
-static int
-sam3_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(sam3_handle_gpnvm_command)
 {
        unsigned x,v;
        int r,who;
@@ -2437,8 +2435,7 @@ sam3_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **a
        return r;
 }
 
-static int
-sam3_handle_slowclk_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(sam3_handle_slowclk_command)
 {
        struct sam3_chip *pChip;
 
index 134c9e568bc2090e9fede28c82eb202b808d724c..4cd270560664b2d92dfcb536c21a01fb9ea11d62 100644 (file)
@@ -1098,7 +1098,7 @@ static int at91sam7_info(struct flash_bank_s *bank, char *buf, int buf_size)
 *   The maximum number of write/erase cycles for Non volatile Memory bits is 100. this includes
 *   Lock Bits (LOCKx), General Purpose NVM bits (GPNVMx) and the Security Bit.
 */
-static int at91sam7_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(at91sam7_handle_gpnvm_command)
 {
        flash_bank_t *bank;
        int bit;
index b0459093325f142402d515b6354bc781e5402090..6badb2d1035dfaee5f7570ee793df7e7e8340e7c 100644 (file)
@@ -415,7 +415,7 @@ static int avrf_mass_erase(struct flash_bank_s *bank)
        return ERROR_OK;
 }
 
-static int avrf_handle_mass_erase_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(avrf_handle_mass_erase_command)
 {
        int i;
 
index 1a04e123f9db4e07a285bc16c8a9d307fe9660ef..d3889b9bf42cbd223f594b10f4a8b218a724b552 100644 (file)
@@ -215,7 +215,7 @@ int flash_command_get_bank_by_num(
 }
 
 
-static int handle_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_bank_command)
 {
        int retval;
        int i;
@@ -295,7 +295,7 @@ static int handle_flash_bank_command(struct command_context_s *cmd_ctx, char *cm
        return ERROR_OK;
 }
 
-static int handle_flash_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_info_command)
 {
        flash_bank_t *p;
        uint32_t i = 0;
@@ -357,7 +357,7 @@ static int handle_flash_info_command(struct command_context_s *cmd_ctx, char *cm
        return ERROR_OK;
 }
 
-static int handle_flash_probe_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_probe_command)
 {
        int retval;
 
@@ -394,7 +394,7 @@ static int handle_flash_probe_command(struct command_context_s *cmd_ctx, char *c
        return ERROR_OK;
 }
 
-static int handle_flash_erase_check_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_erase_check_command)
 {
        if (argc != 1)
        {
@@ -440,7 +440,7 @@ static int handle_flash_erase_check_command(struct command_context_s *cmd_ctx, c
        return ERROR_OK;
 }
 
-static int handle_flash_erase_address_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_erase_address_command)
 {
        flash_bank_t *p;
        int retval;
@@ -484,7 +484,7 @@ static int handle_flash_erase_address_command(struct command_context_s *cmd_ctx,
        return retval;
 }
 
-static int handle_flash_protect_check_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_protect_check_command)
 {
        if (argc != 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -528,8 +528,7 @@ static int flash_check_sector_parameters(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int handle_flash_erase_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_erase_command)
 {
        if (argc != 2)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -569,8 +568,7 @@ static int handle_flash_erase_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int handle_flash_protect_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_protect_command)
 {
        if (argc != 3)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -614,7 +612,7 @@ static int handle_flash_protect_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int handle_flash_write_image_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_write_image_command)
 {
        target_t *target = get_current_target(cmd_ctx);
 
@@ -704,7 +702,7 @@ static int handle_flash_write_image_command(struct command_context_s *cmd_ctx, c
        return retval;
 }
 
-static int handle_flash_fill_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_fill_command)
 {
        int err = ERROR_OK;
        uint32_t address;
@@ -808,7 +806,7 @@ static int handle_flash_fill_command(struct command_context_s *cmd_ctx, char *cm
        return ERROR_OK;
 }
 
-static int handle_flash_write_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_write_bank_command)
 {
        uint32_t offset;
        uint8_t *buffer;
index e71629e57a1375c50354e950759062a4e9b845ee..4d4d9a2aee6e997b064e6c317969e4bd9c125dbe 100644 (file)
@@ -737,7 +737,7 @@ static int lpc2000_info(struct flash_bank_s *bank, char *buf, int buf_size)
        return ERROR_OK;
 }
 
-static int lpc2000_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(lpc2000_handle_part_id_command)
 {
        uint32_t param_table[5];
        uint32_t result_table[4];
index 379b4e8731c0f269507fdb5a9fdc9b8004e67d4c..945fc9a24862171ef75a7196db55c4605c38c657 100644 (file)
@@ -531,8 +531,7 @@ static uint32_t lpc2900_calc_tr( uint32_t clock, uint32_t time )
  * Uses the Built-In-Self-Test (BIST) to generate a 128-bit hash value
  * of the flash content.
  */
-static int lpc2900_handle_signature_command( struct command_context_s *cmd_ctx,
-                                             char *cmd, char **args, int argc )
+COMMAND_HANDLER(lpc2900_handle_signature_command)
 {
        uint32_t status;
        uint32_t signature[4];
@@ -582,8 +581,7 @@ static int lpc2900_handle_signature_command( struct command_context_s *cmd_ctx,
  * Read customer info from index sector, and store that block of data into
  * a disk file. The format is binary.
  */
-static int lpc2900_handle_read_custom_command( struct command_context_s *cmd_ctx,
-                                               char *cmd, char **args, int argc )
+COMMAND_HANDLER(lpc2900_handle_read_custom_command)
 {
        if( argc < 2 )
        {
@@ -654,8 +652,7 @@ static int lpc2900_handle_read_custom_command( struct command_context_s *cmd_ctx
 /**
  * Enter password to enable potentially dangerous options.
  */
-static int lpc2900_handle_password_command(struct command_context_s *cmd_ctx,
-                                           char *cmd, char **args, int argc)
+COMMAND_HANDLER(lpc2900_handle_password_command)
 {
        if (argc < 2)
        {
@@ -690,8 +687,7 @@ static int lpc2900_handle_password_command(struct command_context_s *cmd_ctx,
 /**
  * Write customer info from file to the index sector.
  */
-static int lpc2900_handle_write_custom_command( struct command_context_s *cmd_ctx,
-                                                char *cmd, char **args, int argc )
+COMMAND_HANDLER(lpc2900_handle_write_custom_command)
 {
        if (argc < 2)
        {
@@ -801,8 +797,7 @@ static int lpc2900_handle_write_custom_command( struct command_context_s *cmd_ct
 /**
  * Activate 'sector security' for a range of sectors.
  */
-static int lpc2900_handle_secure_sector_command(struct command_context_s *cmd_ctx,
-                                                char *cmd, char **args, int argc)
+COMMAND_HANDLER(lpc2900_handle_secure_sector_command)
 {
        if (argc < 3)
        {
@@ -901,8 +896,7 @@ static int lpc2900_handle_secure_sector_command(struct command_context_s *cmd_ct
 /**
  * Activate JTAG protection.
  */
-static int lpc2900_handle_secure_jtag_command(struct command_context_s *cmd_ctx,
-                                              char *cmd, char **args, int argc)
+COMMAND_HANDLER(lpc2900_handle_secure_jtag_command)
 {
        if (argc < 1)
        {
index f02c8807433d19e63511994d27c21d32aba060ea..4b120779e9f447b518b0692253a77e9e715cade2 100644 (file)
@@ -828,7 +828,7 @@ static int lpc3180_nand_ready(struct nand_device_s *nand, int timeout)
        return 0;
 }
 
-static int handle_lpc3180_select_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_lpc3180_select_command)
 {
        lpc3180_nand_controller_t *lpc3180_info = NULL;
        char *selected[] =
index 5a392a4d64f90217f679ef26983cf0b9b8c0aedb..5a9b7c355df1e7325b87033e06200147c3459909 100644 (file)
@@ -408,7 +408,7 @@ static int mg_mflash_probe(void)
        return mg_dsk_drv_info();
 }
 
-static int mg_probe_cmd(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(mg_probe_cmd)
 {
        int ret;
 
@@ -702,7 +702,7 @@ static int mg_mflash_write(uint32_t addr, uint8_t *buff, uint32_t len)
        return ret;
 }
 
-static int mg_write_cmd(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(mg_write_cmd)
 {
        uint32_t address, buf_cnt, cnt, res, i;
        uint8_t *buffer;
@@ -766,7 +766,7 @@ mg_write_cmd_err:
        return ret;
 }
 
-static int mg_dump_cmd(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(mg_dump_cmd)
 {
        uint32_t address, size_written, size, cnt, res, i;
        uint8_t *buffer;
@@ -1208,8 +1208,7 @@ static int mg_erase_nand(void)
        return ret;
 }
 
-int mg_config_cmd(struct command_context_s *cmd_ctx, char *cmd,
-               char **args, int argc)
+COMMAND_HANDLER(mg_config_cmd)
 {
        double fin, fout;
        mg_pll_t pll;
@@ -1281,7 +1280,7 @@ int mflash_init_drivers(struct command_context_s *cmd_ctx)
        return ERROR_OK;
 }
 
-static int mg_bank_cmd(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(mg_bank_cmd)
 {
        target_t *target;
        int i;
index 4d32d25d2dac7cc02041e20895a65e74532e1a22..181700d04f183170e0274f7e17a702c5e66dd9df 100644 (file)
@@ -205,7 +205,7 @@ static nand_ecclayout_t nand_oob_64 = {
 
 /* nand device <nand_controller> [controller options]
  */
-static int handle_nand_device_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_nand_device_command)
 {
        int i;
        int retval;
@@ -1041,7 +1041,7 @@ int nand_write_page_raw(struct nand_device_s *nand, uint32_t page, uint8_t *data
        return ERROR_OK;
 }
 
-int handle_nand_list_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_nand_list_command)
 {
        nand_device_t *p;
        int i;
@@ -1068,7 +1068,7 @@ int handle_nand_list_command(struct command_context_s *cmd_ctx, char *cmd, char
        return ERROR_OK;
 }
 
-static int handle_nand_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_nand_info_command)
 {
        int i = 0;
        int j = 0;
@@ -1143,7 +1143,7 @@ static int handle_nand_info_command(struct command_context_s *cmd_ctx, char *cmd
        return ERROR_OK;
 }
 
-static int handle_nand_probe_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_nand_probe_command)
 {
        if (argc != 1)
        {
@@ -1171,7 +1171,7 @@ static int handle_nand_probe_command(struct command_context_s *cmd_ctx, char *cm
        return ERROR_OK;
 }
 
-static int handle_nand_erase_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_nand_erase_command)
 {
        if (argc != 1 && argc != 3)
        {
@@ -1227,7 +1227,7 @@ static int handle_nand_erase_command(struct command_context_s *cmd_ctx, char *cm
        return ERROR_OK;
 }
 
-int handle_nand_check_bad_blocks_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_nand_check_bad_blocks_command)
 {
        int first = -1;
        int last = -1;
@@ -1284,7 +1284,7 @@ int handle_nand_check_bad_blocks_command(struct command_context_s *cmd_ctx, char
        return ERROR_OK;
 }
 
-static int handle_nand_write_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_nand_write_command)
 {
        uint32_t offset;
        uint32_t binary_size;
@@ -1451,7 +1451,7 @@ static int handle_nand_write_command(struct command_context_s *cmd_ctx, char *cm
        return ERROR_OK;
 }
 
-static int handle_nand_dump_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_nand_dump_command)
 {
        if (argc < 4)
        {
@@ -1569,7 +1569,7 @@ static int handle_nand_dump_command(struct command_context_s *cmd_ctx, char *cmd
        return ERROR_OK;
 }
 
-static int handle_nand_raw_access_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_nand_raw_access_command)
 {
        if ((argc < 1) || (argc > 2))
        {
index 78ed1854a46db1d39dbd55725b263ff2f68bbf11..aa34aeaeb77458636fe1e167610961cb9893bef6 100644 (file)
@@ -631,7 +631,7 @@ static int pic32mx_auto_probe(struct flash_bank_s *bank)
 }
 
 #if 0
-static int pic32mx_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(pic32mx_handle_part_id_command)
 {
        return ERROR_OK;
 }
@@ -672,7 +672,7 @@ static int pic32mx_info(struct flash_bank_s *bank, char *buf, int buf_size)
 }
 
 #if 0
-int pic32mx_handle_lock_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(pic32mx_handle_lock_command)
 {
        target_t *target = NULL;
        pic32mx_flash_bank_t *pic32mx_info = NULL;
@@ -718,7 +718,7 @@ int pic32mx_handle_lock_command(struct command_context_s *cmd_ctx, char *cmd, ch
        return ERROR_OK;
 }
 
-int pic32mx_handle_unlock_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(pic32mx_handle_unlock_command)
 {
        target_t *target = NULL;
        pic32mx_flash_bank_t *pic32mx_info = NULL;
@@ -808,7 +808,7 @@ static int pic32mx_chip_erase(struct flash_bank_s *bank)
 }
 #endif
 
-static int pic32mx_handle_chip_erase_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(pic32mx_handle_chip_erase_command)
 {
 #if 0
        int i;
@@ -843,7 +843,7 @@ static int pic32mx_handle_chip_erase_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int pic32mx_handle_pgm_word_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(pic32mx_handle_pgm_word_command)
 {
        uint32_t address, value;
        int status, res;
index bd561a61e7f4be539c32f0864f5b143b7de4107f..22d5bc462286259a5e72abb11398b2d199f97315 100644 (file)
@@ -1127,7 +1127,7 @@ static int stellaris_mass_erase(struct flash_bank_s *bank)
        return ERROR_OK;
 }
 
-static int stellaris_handle_mass_erase_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(stellaris_handle_mass_erase_command)
 {
        int i;
 
index 2ca5fa9406e5373b083d2ba7d3076c61a6f538b5..95d15a95189dda15702c6ef103bef8968706fddf 100644 (file)
@@ -780,7 +780,7 @@ static int stm32x_auto_probe(struct flash_bank_s *bank)
 }
 
 #if 0
-static int stm32x_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(stm32x_handle_part_id_command)
 {
        return ERROR_OK;
 }
@@ -892,7 +892,7 @@ static int stm32x_info(struct flash_bank_s *bank, char *buf, int buf_size)
        return ERROR_OK;
 }
 
-static int stm32x_handle_lock_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(stm32x_handle_lock_command)
 {
        target_t *target = NULL;
        stm32x_flash_bank_t *stm32x_info = NULL;
@@ -938,7 +938,7 @@ static int stm32x_handle_lock_command(struct command_context_s *cmd_ctx, char *c
        return ERROR_OK;
 }
 
-static int stm32x_handle_unlock_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(stm32x_handle_unlock_command)
 {
        target_t *target = NULL;
        stm32x_flash_bank_t *stm32x_info = NULL;
@@ -981,7 +981,7 @@ static int stm32x_handle_unlock_command(struct command_context_s *cmd_ctx, char
        return ERROR_OK;
 }
 
-static int stm32x_handle_options_read_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(stm32x_handle_options_read_command)
 {
        uint32_t optionbyte;
        target_t *target = NULL;
@@ -1037,7 +1037,7 @@ static int stm32x_handle_options_read_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int stm32x_handle_options_write_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(stm32x_handle_options_write_command)
 {
        target_t *target = NULL;
        stm32x_flash_bank_t *stm32x_info = NULL;
@@ -1148,7 +1148,7 @@ static int stm32x_mass_erase(struct flash_bank_s *bank)
        return ERROR_OK;
 }
 
-static int stm32x_handle_mass_erase_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(stm32x_handle_mass_erase_command)
 {
        int i;
 
index ed107f313c0862d188109648d8bedd6990f74323..028eab63098048e95dc66da59e1ad5775bd50fbd 100644 (file)
@@ -589,7 +589,7 @@ static int str7x_probe(struct flash_bank_s *bank)
 }
 
 #if 0
-static int str7x_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str7x_handle_part_id_command)
 {
        return ERROR_OK;
 }
@@ -601,7 +601,7 @@ static int str7x_info(struct flash_bank_s *bank, char *buf, int buf_size)
        return ERROR_OK;
 }
 
-static int str7x_handle_disable_jtag_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str7x_handle_disable_jtag_command)
 {
        target_t *target = NULL;
        str7x_flash_bank_t *str7x_info = NULL;
index 893baf531d417976d6461a71b6924c6b013cbfb1..665c1607cccd011c9ccf896f9eb66b6668f9288e 100644 (file)
@@ -619,8 +619,7 @@ static int str9x_probe(struct flash_bank_s *bank)
 }
 
 #if 0
-static int str9x_handle_part_id_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9x_handle_part_id_command)
 {
        return ERROR_OK;
 }
@@ -632,8 +631,7 @@ static int str9x_info(struct flash_bank_s *bank, char *buf, int buf_size)
        return ERROR_OK;
 }
 
-static int str9x_handle_flash_config_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9x_handle_flash_config_command)
 {
        str9x_flash_bank_t *str9x_info;
        target_t *target = NULL;
index 73b9a1d4a54f116f0cd035b4c30008d007bc85c6..3a35ee170660096baed4f6a714f7df5e537931cc 100644 (file)
@@ -726,7 +726,7 @@ static int str9xpec_probe(struct flash_bank_s *bank)
        return ERROR_OK;
 }
 
-static int str9xpec_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9xpec_handle_part_id_command)
 {
        scan_field_t field;
        uint8_t *buffer = NULL;
@@ -777,7 +777,7 @@ static int str9xpec_info(struct flash_bank_s *bank, char *buf, int buf_size)
        return ERROR_OK;
 }
 
-static int str9xpec_handle_flash_options_read_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9xpec_handle_flash_options_read_command)
 {
        uint8_t status;
        str9xpec_flash_controller_t *str9xpec_info = NULL;
@@ -894,7 +894,7 @@ static int str9xpec_write_options(struct flash_bank_s *bank)
        return status;
 }
 
-static int str9xpec_handle_flash_options_write_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9xpec_handle_flash_options_write_command)
 {
        uint8_t status;
 
@@ -917,7 +917,7 @@ static int str9xpec_handle_flash_options_write_command(struct command_context_s
        return ERROR_OK;
 }
 
-static int str9xpec_handle_flash_options_cmap_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9xpec_handle_flash_options_cmap_command)
 {
        str9xpec_flash_controller_t *str9xpec_info = NULL;
 
@@ -946,7 +946,7 @@ static int str9xpec_handle_flash_options_cmap_command(struct command_context_s *
        return ERROR_OK;
 }
 
-static int str9xpec_handle_flash_options_lvdthd_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9xpec_handle_flash_options_lvdthd_command)
 {
        str9xpec_flash_controller_t *str9xpec_info = NULL;
 
@@ -975,7 +975,7 @@ static int str9xpec_handle_flash_options_lvdthd_command(struct command_context_s
        return ERROR_OK;
 }
 
-int str9xpec_handle_flash_options_lvdsel_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9xpec_handle_flash_options_lvdsel_command)
 {
        str9xpec_flash_controller_t *str9xpec_info = NULL;
 
@@ -1004,7 +1004,7 @@ int str9xpec_handle_flash_options_lvdsel_command(struct command_context_s *cmd_c
        return ERROR_OK;
 }
 
-static int str9xpec_handle_flash_options_lvdwarn_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9xpec_handle_flash_options_lvdwarn_command)
 {
        str9xpec_flash_controller_t *str9xpec_info = NULL;
 
@@ -1033,7 +1033,7 @@ static int str9xpec_handle_flash_options_lvdwarn_command(struct command_context_
        return ERROR_OK;
 }
 
-static int str9xpec_handle_flash_lock_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9xpec_handle_flash_lock_command)
 {
        uint8_t status;
 
@@ -1056,7 +1056,7 @@ static int str9xpec_handle_flash_lock_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int str9xpec_handle_flash_unlock_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9xpec_handle_flash_unlock_command)
 {
        uint8_t status;
 
@@ -1079,7 +1079,7 @@ static int str9xpec_handle_flash_unlock_command(struct command_context_s *cmd_ct
        return ERROR_OK;
 }
 
-static int str9xpec_handle_flash_enable_turbo_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9xpec_handle_flash_enable_turbo_command)
 {
        jtag_tap_t *tap0;
        jtag_tap_t *tap1;
@@ -1128,7 +1128,7 @@ static int str9xpec_handle_flash_enable_turbo_command(struct command_context_s *
        return ERROR_OK;
 }
 
-static int str9xpec_handle_flash_disable_turbo_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9xpec_handle_flash_disable_turbo_command)
 {
        jtag_tap_t *tap;
        str9xpec_flash_controller_t *str9xpec_info = NULL;
index 1348697ae286a9b6730dcdc9df0940b809903389..53043cd5bb834043f0f616e00348d492771cc0a1 100644 (file)
@@ -289,7 +289,7 @@ static int tms470_read_part_info(struct flash_bank_s *bank)
 static uint32_t keysSet = 0;
 static uint32_t flashKeys[4];
 
-static int tms470_handle_flash_keyset_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(tms470_handle_flash_keyset_command)
 {
        if (argc > 4)
        {
@@ -353,7 +353,7 @@ static const uint32_t FLASH_KEYS_MIX2[] = { 0x0000ffff, 0x0000ffff,
 
 static int oscMHz = 12;
 
-static int tms470_handle_osc_megahertz_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(tms470_handle_osc_megahertz_command)
 {
        if (argc > 1)
        {
@@ -382,7 +382,7 @@ static int tms470_handle_osc_megahertz_command(struct command_context_s *cmd_ctx
 
 static int plldis = 0;
 
-static int tms470_handle_plldis_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(tms470_handle_plldis_command)
 {
        if (argc > 1)
        {
index e467be0b2d36ad54565fea51a2f0a5f6e19dd131..4ce50855dfa09de2e39388db7c44519abfabf4ab 100644 (file)
@@ -716,8 +716,7 @@ static int jim_capture(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 /* sleep command sleeps for <n> miliseconds
  * this is useful in target startup scripts
  */
-static int handle_sleep_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_sleep_command)
 {
        bool busy = false;
        if (argc == 2)
@@ -750,7 +749,7 @@ static int handle_sleep_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int handle_fast_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_fast_command)
 {
        if (argc != 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
index b3171bc03ff9e83d331f579bf728fd635d54314a..1423462c1088b45458fcc08070cff297caeb2da7 100644 (file)
@@ -57,8 +57,7 @@
 #endif
 
 
-int handle_rm_command(struct command_context_s *cmd_ctx, char *cmd,
-               char **args, int argc)
+COMMAND_HANDLER(handle_rm_command)
 {
        if (argc != 1)
        {
@@ -134,10 +133,7 @@ int loadFile(const char *fileName, void **data, size_t *len)
        return ERROR_OK;
 }
 
-
-
-int handle_cat_command(struct command_context_s *cmd_ctx, char *cmd,
-               char **args, int argc)
+COMMAND_HANDLER(handle_cat_command)
 {
        if (argc != 1)
        {
@@ -162,8 +158,8 @@ int handle_cat_command(struct command_context_s *cmd_ctx, char *cmd,
 
        return ERROR_OK;
 }
-int handle_trunc_command(struct command_context_s *cmd_ctx, char *cmd,
-               char **args, int argc)
+
+COMMAND_HANDLER(handle_trunc_command)
 {
        if (argc != 1)
        {
@@ -179,8 +175,7 @@ int handle_trunc_command(struct command_context_s *cmd_ctx, char *cmd,
        return ERROR_OK;
 }
 
-
-int handle_meminfo_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_meminfo_command)
 {
        static int prev = 0;
        struct mallinfo info;
@@ -205,8 +200,7 @@ int handle_meminfo_command(struct command_context_s *cmd_ctx, char *cmd, char **
 }
 
 
-int handle_append_command(struct command_context_s *cmd_ctx, char *cmd,
-               char **args, int argc)
+COMMAND_HANDLER(handle_append_command)
 {
        if (argc < 1)
        {
@@ -245,7 +239,7 @@ int handle_append_command(struct command_context_s *cmd_ctx, char *cmd,
 
 
 
-int handle_cp_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_cp_command)
 {
        if (argc != 2)
        {
index a8b519af837012e463c7224cdb265abf1bb56ef5..ccc0c01bdb655d4808cd30b274d388cd7853dc7b 100644 (file)
@@ -274,7 +274,7 @@ void log_printf_lf(enum log_levels level, const char *file, int line, const char
  * 2: + INFORMATIONAL MSGS
  * 3: + DEBUG MSGS
  */
-int handle_debug_level_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_debug_level_command)
 {
        if (argc == 1)
        {
@@ -302,7 +302,7 @@ int handle_debug_level_command(struct command_context_s *cmd_ctx, char *cmd, cha
        return ERROR_OK;
 }
 
-int handle_log_output_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_log_output_command)
 {
        if (argc == 1)
        {
index abfaadc95a77393e158010e3b2744e1ff974992d..a34387f8b43df0db78ea98dfc676cbe3e6da010e 100644 (file)
@@ -495,8 +495,7 @@ static int amt_jtagaccel_quit(void)
        return ERROR_OK;
 }
 
-static int amt_jtagaccel_handle_parport_port_command(
-               struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(amt_jtagaccel_handle_parport_port_command)
 {
        if (argc == 1)
        {
@@ -519,7 +518,7 @@ static int amt_jtagaccel_handle_parport_port_command(
        return ERROR_OK;
 }
 
-static int amt_jtagaccel_handle_rtck_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(amt_jtagaccel_handle_rtck_command)
 {
        if (argc == 0)
        {
index 243479db225e70d23b88b3bb21d15416d2e5d788..6d2335698b661aa392291611e3a62ec921282191 100644 (file)
@@ -2798,7 +2798,7 @@ static int ft2232_quit(void)
        return ERROR_OK;
 }
 
-static int ft2232_handle_device_desc_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
+COMMAND_HANDLER(ft2232_handle_device_desc_command)
 {
        char *cp;
        char buf[200];
@@ -2832,7 +2832,7 @@ static int ft2232_handle_device_desc_command(struct command_context_s* cmd_ctx,
        return ERROR_OK;
 }
 
-static int ft2232_handle_serial_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
+COMMAND_HANDLER(ft2232_handle_serial_command)
 {
        if (argc == 1)
        {
@@ -2846,7 +2846,7 @@ static int ft2232_handle_serial_command(struct command_context_s* cmd_ctx, char*
        return ERROR_OK;
 }
 
-static int ft2232_handle_layout_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
+COMMAND_HANDLER(ft2232_handle_layout_command)
 {
        if (argc == 0)
                return ERROR_OK;
@@ -2857,7 +2857,7 @@ static int ft2232_handle_layout_command(struct command_context_s* cmd_ctx, char*
        return ERROR_OK;
 }
 
-static int ft2232_handle_vid_pid_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
+COMMAND_HANDLER(ft2232_handle_vid_pid_command)
 {
        if (argc > MAX_USB_IDS * 2)
        {
@@ -2891,7 +2891,7 @@ static int ft2232_handle_vid_pid_command(struct command_context_s* cmd_ctx, char
        return retval;
 }
 
-static int ft2232_handle_latency_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
+COMMAND_HANDLER(ft2232_handle_latency_command)
 {
        if (argc == 1)
        {
index 35473ab80de3766de3b325859b241bcd33f18b47..07188f4e5cbd6ab26c91aa0c323e0d83f5775550 100644 (file)
@@ -541,7 +541,7 @@ static int gw16012_quit(void)
        return ERROR_OK;
 }
 
-static int gw16012_handle_parport_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(gw16012_handle_parport_port_command)
 {
        if (argc == 1)
        {
index 9b20290237e87e5f6b4f3aa84e989d758807b852..cee7a16956c44d910f0220e1cc618db016835404 100644 (file)
@@ -410,7 +410,7 @@ static int parport_quit(void)
        return ERROR_OK;
 }
 
-static int parport_handle_parport_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(parport_handle_parport_port_command)
 {
        if (argc == 1)
        {
@@ -431,7 +431,7 @@ static int parport_handle_parport_port_command(struct command_context_s *cmd_ctx
        return ERROR_OK;
 }
 
-static int parport_handle_parport_cable_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(parport_handle_parport_cable_command)
 {
        if (argc == 0)
                return ERROR_OK;
@@ -446,7 +446,7 @@ static int parport_handle_parport_cable_command(struct command_context_s *cmd_ct
        return ERROR_OK;
 }
 
-static int parport_handle_write_on_exit_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(parport_handle_write_on_exit_command)
 {
        if (argc != 1)
        {
index 0972223387a9238926901ec44252e63bfe3caead..8789bed254f1f8c611ceb9bb2f56e07c99062d46 100644 (file)
@@ -752,7 +752,7 @@ static int presto_jtag_speed(int speed)
 
 static char *presto_serial;
 
-static int presto_handle_serial_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(presto_handle_serial_command)
 {
        if (argc == 1)
        {
index b86e006abd175af7afec7da1e79ddc73819c7b73..653d3a7ebcb8c4daaf06c1783457cc05afcdac36 100644 (file)
@@ -603,8 +603,7 @@ static int default_srst_asserted(int *srst_asserted)
        return ERROR_OK;
 }
 
-static int handle_interface_list_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_interface_list_command)
 {
        if (strcmp(cmd, "interface_list") == 0 && argc > 0)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -619,8 +618,7 @@ static int handle_interface_list_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int handle_interface_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_interface_command)
 {
        /* check whether the interface is already configured */
        if (jtag_interface)
@@ -664,7 +662,7 @@ static int handle_interface_command(struct command_context_s *cmd_ctx,
        return ERROR_JTAG_INVALID_INTERFACE;
 }
 
-static int handle_scan_chain_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_scan_chain_command)
 {
        jtag_tap_t *tap;
 
@@ -701,7 +699,7 @@ static int handle_scan_chain_command(struct command_context_s *cmd_ctx, char *cm
        return ERROR_OK;
 }
 
-static int handle_reset_config_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_reset_config_command)
 {
        int new_cfg = 0;
        int mask = 0;
@@ -897,8 +895,7 @@ next:
        return ERROR_OK;
 }
 
-static int handle_jtag_nsrst_delay_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_jtag_nsrst_delay_command)
 {
        if (argc > 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -913,8 +910,7 @@ static int handle_jtag_nsrst_delay_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int handle_jtag_ntrst_delay_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_jtag_ntrst_delay_command)
 {
        if (argc > 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -929,8 +925,7 @@ static int handle_jtag_ntrst_delay_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int handle_jtag_nsrst_assert_width_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_jtag_nsrst_assert_width_command)
 {
        if (argc > 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -945,8 +940,7 @@ static int handle_jtag_nsrst_assert_width_command(struct command_context_s *cmd_
        return ERROR_OK;
 }
 
-static int handle_jtag_ntrst_assert_width_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_jtag_ntrst_assert_width_command)
 {
        if (argc > 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -961,7 +955,7 @@ static int handle_jtag_ntrst_assert_width_command(struct command_context_s *cmd_
        return ERROR_OK;
 }
 
-static int handle_jtag_khz_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_jtag_khz_command)
 {
        if (argc > 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -990,7 +984,7 @@ static int handle_jtag_khz_command(struct command_context_s *cmd_ctx, char *cmd,
        return retval;
 }
 
-static int handle_jtag_rclk_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_jtag_rclk_command)
 {
        if (argc > 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -1019,8 +1013,7 @@ static int handle_jtag_rclk_command(struct command_context_s *cmd_ctx, char *cmd
        return retval;
 }
 
-static int handle_jtag_reset_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_jtag_reset_command)
 {
        if (argc != 2)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -1048,8 +1041,7 @@ static int handle_jtag_reset_command(struct command_context_s *cmd_ctx,
        return jtag_execute_queue();
 }
 
-static int handle_runtest_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_runtest_command)
 {
        if (argc != 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -1083,7 +1075,7 @@ static bool scan_is_safe(tap_state_t state)
 }
 
 
-static int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_irscan_command)
 {
        int i;
        scan_field_t *fields;
@@ -1358,7 +1350,7 @@ static int Jim_Command_flush_count(Jim_Interp *interp, int argc, Jim_Obj *const
 }
 
 
-static int handle_verify_ircapture_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_verify_ircapture_command)
 {
        if (argc > 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -1379,7 +1371,7 @@ static int handle_verify_ircapture_command(struct command_context_s *cmd_ctx, ch
        return ERROR_OK;
 }
 
-static int handle_verify_jtag_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_verify_jtag_command)
 {
        if (argc > 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -1400,7 +1392,7 @@ static int handle_verify_jtag_command(struct command_context_s *cmd_ctx, char *c
        return ERROR_OK;
 }
 
-static int handle_tms_sequence_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_tms_sequence_command)
 {
        if (argc > 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
index b00846733aca245488e26e08a6bab47fd0ea0724..decca16c61eecb1fad46c6a35696d922309f2859 100644 (file)
@@ -1325,7 +1325,7 @@ static void vsllink_simple_command(uint8_t command)
        }
 }
 
-static int vsllink_handle_mode_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(vsllink_handle_mode_command)
 {
        if (argc != 1) {
                LOG_ERROR("parameter error, should be one parameter for VID");
@@ -1349,7 +1349,7 @@ static int vsllink_handle_mode_command(struct command_context_s *cmd_ctx, char *
        return ERROR_OK;
 }
 
-static int vsllink_handle_usb_vid_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(vsllink_handle_usb_vid_command)
 {
        if (argc != 1)
        {
@@ -1361,7 +1361,7 @@ static int vsllink_handle_usb_vid_command(struct command_context_s *cmd_ctx, cha
        return ERROR_OK;
 }
 
-static int vsllink_handle_usb_pid_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(vsllink_handle_usb_pid_command)
 {
        if (argc != 1)
        {
@@ -1372,7 +1372,7 @@ static int vsllink_handle_usb_pid_command(struct command_context_s *cmd_ctx, cha
        return ERROR_OK;
 }
 
-static int vsllink_handle_usb_bulkin_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(vsllink_handle_usb_bulkin_command)
 {
        if (argc != 1)
        {
@@ -1387,7 +1387,7 @@ static int vsllink_handle_usb_bulkin_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int vsllink_handle_usb_bulkout_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(vsllink_handle_usb_bulkout_command)
 {
        if (argc != 1)
        {
@@ -1402,7 +1402,7 @@ static int vsllink_handle_usb_bulkout_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int vsllink_handle_usb_interface_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(vsllink_handle_usb_interface_command)
 {
        if (argc != 1)
        {
index 7384065aff0463229700bc7ba00f291030174bda..2a74a46b741b0c2ad762f175d47371f2336a5024 100644 (file)
@@ -67,7 +67,7 @@ static void print_version(void)
 }
 
 /* Give TELNET a way to find out what version this is */
-static int handle_version_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_version_command)
 {
        if (argc != 0)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -109,7 +109,7 @@ static int log_target_callback_event_handler(struct target_s *target, enum targe
 int ioutil_init(struct command_context_s *cmd_ctx);
 
 /* OpenOCD can't really handle failure of this command. Patches welcome! :-) */
-static int handle_init_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_init_command)
 {
 
        if (argc != 0)
index df7e2fdafcf575529b231bc568c937b51c9af76c..c20b936c7ed477a6e97b44977cd4c6714da724e1 100644 (file)
@@ -57,8 +57,7 @@ pld_device_t *get_pld_device_by_num(int num)
 
 /* pld device <driver> [driver_options ...]
  */
-static int handle_pld_device_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_pld_device_command)
 {
        int i;
        int found = 0;
@@ -120,8 +119,7 @@ static int handle_pld_device_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int handle_pld_devices_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_pld_devices_command)
 {
        pld_device_t *p;
        int i = 0;
@@ -140,8 +138,7 @@ static int handle_pld_devices_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int handle_pld_load_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_pld_load_command)
 {
        int retval;
        struct timeval start, end, duration;
index fa646505f7cc74cb140eeaf72f8d6fd21e0ea865..3c6d61fe0c496217befa1c33f1b8359ca0def583 100644 (file)
@@ -177,8 +177,7 @@ static int virtex2_load(struct pld_device_s *pld_device, const char *filename)
        return ERROR_OK;
 }
 
-static int virtex2_handle_read_stat_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(virtex2_handle_read_stat_command)
 {
        pld_device_t *device;
        virtex2_pld_device_t *virtex2_info;
index 21b58d0e4581fde929e99d587c111357b05a5ba9..c0c5d7751b1192639c98f25efc728e143f73c201 100644 (file)
@@ -2249,7 +2249,7 @@ int gdb_init(void)
        return ERROR_OK;
 }
 
-static int handle_gdb_sync_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_gdb_sync_command)
 {
        if (argc != 0)
        {
@@ -2269,12 +2269,12 @@ static int handle_gdb_sync_command(struct command_context_s *cmd_ctx, char *cmd,
 }
 
 /* daemon configuration command gdb_port */
-static int handle_gdb_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_gdb_port_command)
 {
        return server_port_command(cmd_ctx, cmd, args, argc, &gdb_port);
 }
 
-static int handle_gdb_memory_map_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_gdb_memory_map_command)
 {
        if (argc == 1)
        {
@@ -2295,7 +2295,7 @@ static int handle_gdb_memory_map_command(struct command_context_s *cmd_ctx, char
        return ERROR_COMMAND_SYNTAX_ERROR;
 }
 
-static int handle_gdb_flash_program_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_gdb_flash_program_command)
 {
        if (argc == 1)
        {
@@ -2316,7 +2316,7 @@ static int handle_gdb_flash_program_command(struct command_context_s *cmd_ctx, c
        return ERROR_COMMAND_SYNTAX_ERROR;
 }
 
-static int handle_gdb_report_data_abort_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_gdb_report_data_abort_command)
 {
        if (argc == 1)
        {
@@ -2338,7 +2338,7 @@ static int handle_gdb_report_data_abort_command(struct command_context_s *cmd_ct
 }
 
 /* gdb_breakpoint_override */
-static int handle_gdb_breakpoint_override_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_gdb_breakpoint_override_command)
 {
        if (argc == 0)
        {
index 05018694bc375ecf433cc33a4b94c415681ab3c8..c000b7c25e7fb3f45ff965e9dc8a60b65322938a 100644 (file)
@@ -534,8 +534,7 @@ int server_quit(void)
 }
 
 /* tell the server we want to shut down */
-static int handle_shutdown_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_shutdown_command)
 {
        shutdown_openocd = 1;
 
index 2e93e3613a726697b508b80ed9a8298491699d84..3410ca91ef235a0ff9089092cdcfec0405cc197e 100644 (file)
@@ -170,8 +170,7 @@ int tcl_init(void)
        return retval;
 }
 
-static int handle_tcl_port_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_tcl_port_command)
 {
        return server_port_command(cmd_ctx, cmd, args, argc, &tcl_port);
 }
index b77deff139bcaa203611b298bb8849619292180d..c409ec0a1cde62b6309610af0557b6c64cb8496b 100644 (file)
@@ -606,14 +606,12 @@ int telnet_init(char *banner)
 }
 
 /* daemon configuration command telnet_port */
-static int handle_telnet_port_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_telnet_port_command)
 {
        return server_port_command(cmd_ctx, cmd, args, argc, &telnet_port);
 }
 
-static int handle_exit_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_exit_command)
 {
        return ERROR_COMMAND_CLOSE_CONNECTION;
 }
index ba6ed1b779e24cde2a3276ec5b74811acd67cfa4..76b067047e7fb2afbfc88ac5e45dee6372f16c8b 100644 (file)
@@ -301,7 +301,7 @@ int svf_add_statemove(tap_state_t state_to)
        return ERROR_FAIL;
 }
 
-static int handle_svf_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_svf_command)
 {
 #define SVF_NUM_OF_OPTIONS                     1
        int command_num = 0, i;
index fe39d6e8800e241843dc7a902f3f8cf3fd9ddb60..098b0afa31c539916317c68fafe4133e92cb75dd 100644 (file)
@@ -2028,7 +2028,7 @@ static int arm11_handle_bool(struct command_context_s *cmd_ctx,
 }
 
 #define BOOL_WRAPPER(name, print_name) \
-static int arm11_handle_bool_##name(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) \
+COMMAND_HANDLER(arm11_handle_bool_##name) \
 { \
        return arm11_handle_bool(cmd_ctx, cmd, args, argc, &arm11_config_##name, print_name); \
 }
@@ -2038,7 +2038,7 @@ BOOL_WRAPPER(memwrite_error_fatal,                "fatal error mode for memory writes")
 BOOL_WRAPPER(step_irq_enable,                  "IRQs while stepping")
 BOOL_WRAPPER(hardware_step,                    "hardware single step")
 
-static int arm11_handle_vcr(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm11_handle_vcr)
 {
        switch (argc) {
        case 0:
@@ -2185,17 +2185,16 @@ static int arm11_handle_etm_read_write(struct command_context_s *cmd_ctx, char *
        return ERROR_OK;
 }
 
-int arm11_handle_etmr(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm11_handle_etmr)
 {
        return arm11_handle_etm_read_write(cmd_ctx, cmd, args, argc, true);
 }
 
-int arm11_handle_etmw(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm11_handle_etmw)
 {
        return arm11_handle_etm_read_write(cmd_ctx, cmd, args, argc, false);
 }
 
-
 #define ARM11_HANDLER(x)       .x = arm11_##x
 
 target_type_t arm11_target = {
index 6ce798075479eba9a1abdf9aef26ee8818120b99..6a5a4e74789bb7da730e3b3c7a04ad6d5d1d1aa1 100644 (file)
@@ -409,8 +409,7 @@ static int arm720t_target_create(struct target_s *target, Jim_Interp *interp)
        return arm720t_init_arch_info(target, arm720t, target->tap);
 }
 
-static int arm720t_handle_cp15_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm720t_handle_cp15_command)
 {
        int retval;
        target_t *target = get_current_target(cmd_ctx);
index b6606a17de748465eb437d7367c04e17aed82cbe..6a56417e26d1089e9c575331e6af775aed9b28db 100644 (file)
@@ -2871,7 +2871,7 @@ int arm7_9_blank_check_memory(struct target_s *target, uint32_t address, uint32_
        return ERROR_OK;
 }
 
-int handle_arm7_9_write_xpsr_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_arm7_9_write_xpsr_command)
 {
        uint32_t value;
        int spsr;
@@ -2915,7 +2915,7 @@ int handle_arm7_9_write_xpsr_command(struct command_context_s *cmd_ctx, char *cm
        return ERROR_OK;
 }
 
-int handle_arm7_9_write_xpsr_im8_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_arm7_9_write_xpsr_im8_command)
 {
        uint32_t value;
        int rotate;
@@ -2957,7 +2957,7 @@ int handle_arm7_9_write_xpsr_im8_command(struct command_context_s *cmd_ctx, char
        return ERROR_OK;
 }
 
-int handle_arm7_9_write_core_reg_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_arm7_9_write_core_reg_command)
 {
        uint32_t value;
        uint32_t mode;
@@ -2991,7 +2991,7 @@ int handle_arm7_9_write_core_reg_command(struct command_context_s *cmd_ctx, char
        return arm7_9_write_core_reg(target, num, mode, value);
 }
 
-int handle_arm7_9_dbgrq_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_arm7_9_dbgrq_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        armv4_5_common_t *armv4_5;
@@ -3024,7 +3024,7 @@ int handle_arm7_9_dbgrq_command(struct command_context_s *cmd_ctx, char *cmd, ch
        return ERROR_OK;
 }
 
-int handle_arm7_9_fast_memory_access_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_arm7_9_fast_memory_access_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        armv4_5_common_t *armv4_5;
@@ -3057,7 +3057,7 @@ int handle_arm7_9_fast_memory_access_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-int handle_arm7_9_dcc_downloads_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_arm7_9_dcc_downloads_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        armv4_5_common_t *armv4_5;
index e043aee024c69b4937d8737e4a2e2892b5958817..5576f60f092c0ad8053349c308837fffe698143b 100644 (file)
@@ -662,8 +662,7 @@ static int arm920t_target_create(struct target_s *target, Jim_Interp *interp)
        return arm920t_init_arch_info(target, arm920t, target->tap);
 }
 
-static int arm920t_handle_read_cache_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm920t_handle_read_cache_command)
 {
        int retval = ERROR_OK;
        target_t *target = get_current_target(cmd_ctx);
@@ -909,8 +908,7 @@ static int arm920t_handle_read_cache_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int arm920t_handle_read_mmu_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm920t_handle_read_mmu_command)
 {
        int retval = ERROR_OK;
        target_t *target = get_current_target(cmd_ctx);
@@ -1193,8 +1191,7 @@ static int arm920t_handle_read_mmu_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int arm920t_handle_cp15_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm920t_handle_cp15_command)
 {
        int retval;
        target_t *target = get_current_target(cmd_ctx);
@@ -1247,8 +1244,7 @@ static int arm920t_handle_cp15_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int arm920t_handle_cp15i_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm920t_handle_cp15i_command)
 {
        int retval;
        target_t *target = get_current_target(cmd_ctx);
@@ -1315,8 +1311,7 @@ static int arm920t_handle_cp15i_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int arm920t_handle_cache_info_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm920t_handle_cache_info_command)
 {
        int retval;
        target_t *target = get_current_target(cmd_ctx);
index 316f12763cf89e2ce436e45a37affff2831c0b1a..6f347d87d14fdc1e82880226bee8523e690e0bda 100644 (file)
@@ -713,8 +713,7 @@ static int arm926ejs_target_create(struct target_s *target, Jim_Interp *interp)
        return arm926ejs_init_arch_info(target, arm926ejs, target->tap);
 }
 
-static int arm926ejs_handle_cp15_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm926ejs_handle_cp15_command)
 {
        int retval;
        target_t *target = get_current_target(cmd_ctx);
@@ -775,9 +774,7 @@ static int arm926ejs_handle_cp15_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int
-arm926ejs_handle_cache_info_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm926ejs_handle_cache_info_command)
 {
        int retval;
        target_t *target = get_current_target(cmd_ctx);
index 5b464efb7e4f7c74dbcba401674448113309a2a9..e61943a3e96d04aa0e60414602a8cae951d42d20 100644 (file)
@@ -162,8 +162,7 @@ int arm966e_write_cp15(target_t *target, int reg_addr, uint32_t value)
        return ERROR_OK;
 }
 
-static int arm966e_handle_cp15_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm966e_handle_cp15_command)
 {
        int retval;
        target_t *target = get_current_target(cmd_ctx);
index 58b8efd001642bc07ee37a21fc3a8f5502186887..112ec2a46455655b1ad68aedd93e627d9c40ab5f 100644 (file)
@@ -856,8 +856,7 @@ static int arm9tdmi_target_create(struct target_s *target, Jim_Interp *interp)
        return ERROR_OK;
 }
 
-static int handle_arm9tdmi_catch_vectors_command(
-       struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_arm9tdmi_catch_vectors_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct arm7_9_common_s *arm7_9 = target_to_arm7_9(target);
index 0fe9ee4ad610bd0828953b7d5241e87bc8fd3ec8..c0a9c8ab5bb8d509fd9334d8c7ab02dfb62500fb 100644 (file)
@@ -307,7 +307,7 @@ int armv4_5_arch_state(struct target_s *target)
        return ERROR_OK;
 }
 
-int handle_armv4_5_reg_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_armv4_5_reg_command)
 {
        char output[128];
        int output_len;
@@ -359,7 +359,7 @@ int handle_armv4_5_reg_command(struct command_context_s *cmd_ctx, char *cmd, cha
        return ERROR_OK;
 }
 
-int handle_armv4_5_core_state_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_armv4_5_core_state_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct armv4_5_common_s *armv4_5 = target_to_armv4_5(target);
@@ -387,9 +387,7 @@ int handle_armv4_5_core_state_command(struct command_context_s *cmd_ctx, char *c
        return ERROR_OK;
 }
 
-static int
-handle_armv4_5_disassemble_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_armv4_5_disassemble_command)
 {
        int retval = ERROR_OK;
        target_t *target = get_current_target(cmd_ctx);
index 6dfbb162fa70cbc139069527dbfac0fad8f10331..f0679260fc9b7cabe7f9eb59a6aa949ceb077f12 100644 (file)
@@ -230,8 +230,7 @@ int armv7a_arch_state(struct target_s *target)
 }
 
 
-static int handle_dap_baseaddr_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_dap_baseaddr_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct armv7a_common_s *armv7a = target_to_armv7a(target);
@@ -240,8 +239,7 @@ static int handle_dap_baseaddr_command(struct command_context_s *cmd_ctx,
        return dap_baseaddr_command(cmd_ctx, swjdp, args, argc);
 }
 
-static int handle_dap_memaccess_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_dap_memaccess_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct armv7a_common_s *armv7a = target_to_armv7a(target);
@@ -250,8 +248,7 @@ static int handle_dap_memaccess_command(struct command_context_s *cmd_ctx,
        return dap_memaccess_command(cmd_ctx, swjdp, args, argc);
 }
 
-static int handle_dap_apsel_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_dap_apsel_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct armv7a_common_s *armv7a = target_to_armv7a(target);
@@ -260,8 +257,7 @@ static int handle_dap_apsel_command(struct command_context_s *cmd_ctx,
        return dap_apsel_command(cmd_ctx, swjdp, args, argc);
 }
 
-static int handle_dap_apid_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_dap_apid_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct armv7a_common_s *armv7a = target_to_armv7a(target);
@@ -270,8 +266,7 @@ static int handle_dap_apid_command(struct command_context_s *cmd_ctx,
        return dap_apid_command(cmd_ctx, swjdp, args, argc);
 }
 
-static int handle_dap_info_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_dap_info_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct armv7a_common_s *armv7a = target_to_armv7a(target);
@@ -292,9 +287,7 @@ static int handle_dap_info_command(struct command_context_s *cmd_ctx,
        return dap_info_command(cmd_ctx, swjdp, apsel);
 }
 
-static int
-handle_armv7a_disassemble_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_armv7a_disassemble_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct armv4_5_common_s *armv4_5 = target_to_armv4_5(target);
index 0fcee3179b95f24b4abab92bfa0c60d74e79bbee..f6de5e11479fda2f091112d6af006ab7bd38b131 100644 (file)
@@ -745,8 +745,7 @@ int armv7m_blank_check_memory(struct target_s *target,
  * Return the debug ap baseaddress in hexadecimal;
  * no extra output to simplify script processing
  */
-static int handle_dap_baseaddr_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_dap_baseaddr_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct armv7m_common_s *armv7m = target_to_armv7m(target);
@@ -783,8 +782,7 @@ static int handle_dap_baseaddr_command(struct command_context_s *cmd_ctx,
  * Return the debug ap id in hexadecimal;
  * no extra output to simplify script processing
  */
-static int handle_dap_apid_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_dap_apid_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct armv7m_common_s *armv7m = target_to_armv7m(target);
@@ -793,8 +791,7 @@ static int handle_dap_apid_command(struct command_context_s *cmd_ctx,
        return dap_apid_command(cmd_ctx, swjdp, args, argc);
 }
 
-static int handle_dap_apsel_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_dap_apsel_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct armv7m_common_s *armv7m = target_to_armv7m(target);
@@ -803,8 +800,7 @@ static int handle_dap_apsel_command(struct command_context_s *cmd_ctx,
        return dap_apsel_command(cmd_ctx, swjdp, args, argc);
 }
 
-static int handle_dap_memaccess_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_dap_memaccess_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct armv7m_common_s *armv7m = target_to_armv7m(target);
@@ -814,8 +810,7 @@ static int handle_dap_memaccess_command(struct command_context_s *cmd_ctx,
 }
 
 
-static int handle_dap_info_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_dap_info_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct armv7m_common_s *armv7m = target_to_armv7m(target);
index 667c5825230e8a1a5c4891642842d8ddc3896487..3ce861c4529c532870c4c0a200fcbc08232896b7 100644 (file)
@@ -1526,8 +1526,7 @@ static int cortex_a8_target_create(struct target_s *target, Jim_Interp *interp)
        return ERROR_OK;
 }
 
-static int cortex_a8_handle_cache_info_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(cortex_a8_handle_cache_info_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct armv7a_common_s *armv7a = target_to_armv7a(target);
@@ -1537,8 +1536,7 @@ static int cortex_a8_handle_cache_info_command(struct command_context_s *cmd_ctx
 }
 
 
-static int cortex_a8_handle_dbginit_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(cortex_a8_handle_dbginit_command)
 {
        target_t *target = get_current_target(cmd_ctx);
 
index 6c95b4ea541cd1cec08e5bb9a45a1129e8912b94..50842319a7533cb2b40a71d2ccc773ad4442f296 100644 (file)
@@ -1781,9 +1781,7 @@ static int cortex_m3_verify_pointer(struct command_context_s *cmd_ctx,
  * that *only* Thumb2 disassembly matters.  There are also some small
  * additions to Thumb2 that are specific to ARMv7-M.
  */
-static int
-handle_cortex_m3_disassemble_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_cortex_m3_disassemble_command)
 {
        int retval;
        target_t *target = get_current_target(cmd_ctx);
@@ -1835,9 +1833,7 @@ static const struct {
        { "reset",      VC_CORERESET, },
 };
 
-static int
-handle_cortex_m3_vector_catch_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_cortex_m3_vector_catch_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct cortex_m3_common_s *cortex_m3 = target_to_cm3(target);
@@ -1894,9 +1890,7 @@ write:
        return ERROR_OK;
 }
 
-static int
-handle_cortex_m3_mask_interrupts_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_cortex_m3_mask_interrupts_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct cortex_m3_common_s *cortex_m3 = target_to_cm3(target);
index 3a4e3fe459a3dbbf2e8eca5d37b7af482b40c570..c0c485fe2c15e5461e130ceabe79e88c51859245 100644 (file)
@@ -349,7 +349,7 @@ static int etb_write_reg(reg_t *reg, uint32_t value)
        return ERROR_OK;
 }
 
-static int handle_etb_config_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etb_config_command)
 {
        target_t *target;
        jtag_tap_t *tap;
index f01f3666fbac29032a13892fc95d014181760875..0fc924914ff79bb0a059cbf8fb2401c32238d363 100644 (file)
@@ -1248,8 +1248,7 @@ static int handle_etm_tracemode_command_update(
        return ERROR_OK;
 }
 
-static int handle_etm_tracemode_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_tracemode_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct arm *arm = target_to_arm(target);
@@ -1371,8 +1370,7 @@ static int handle_etm_tracemode_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int handle_etm_config_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_config_command)
 {
        target_t *target;
        struct arm *arm;
@@ -1522,8 +1520,7 @@ static int handle_etm_config_command(struct command_context_s *cmd_ctx,
        return etm_register_user_commands(cmd_ctx);
 }
 
-static int handle_etm_info_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_info_command)
 {
        target_t *target;
        struct arm *arm;
@@ -1655,8 +1652,7 @@ static int handle_etm_info_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int handle_etm_status_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_status_command)
 {
        target_t *target;
        struct arm *arm;
@@ -1732,8 +1728,7 @@ static int handle_etm_status_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int handle_etm_image_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_image_command)
 {
        target_t *target;
        struct arm *arm;
@@ -1792,8 +1787,7 @@ static int handle_etm_image_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int handle_etm_dump_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_dump_command)
 {
        fileio_t file;
        target_t *target;
@@ -1861,8 +1855,7 @@ static int handle_etm_dump_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int handle_etm_load_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_load_command)
 {
        fileio_t file;
        target_t *target;
@@ -1946,8 +1939,7 @@ static int handle_etm_load_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int handle_etm_trigger_percent_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_trigger_percent_command)
 {
        target_t *target;
        struct arm *arm;
@@ -1988,8 +1980,7 @@ static int handle_etm_trigger_percent_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int handle_etm_start_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_start_command)
 {
        target_t *target;
        struct arm *arm;
@@ -2037,8 +2028,7 @@ static int handle_etm_start_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int handle_etm_stop_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_stop_command)
 {
        target_t *target;
        struct arm *arm;
@@ -2077,8 +2067,7 @@ static int handle_etm_stop_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int handle_etm_analyze_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_analyze_command)
 {
        target_t *target;
        struct arm *arm;
index 0c5fc111b534e4983b71ee54c8c626d5325159d9..6bb2cde4ff1d49b36db5f7af562d34b29f9ced59 100644 (file)
@@ -25,7 +25,7 @@
 #include "etm_dummy.h"
 
 
-static int handle_etm_dummy_config_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_dummy_config_command)
 {
        target_t *target;
        struct arm *arm;
index e0048e64ce413a0601bb0f6bbac4b733f97b89e0..755e1b69d55734d8bc70f68f754a24e03ee38e5e 100644 (file)
@@ -289,7 +289,7 @@ etm_capture_driver_t oocd_trace_capture_driver =
        .read_trace = oocd_trace_read_trace,
 };
 
-static int handle_oocd_trace_config_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_oocd_trace_config_command)
 {
        target_t *target;
        struct arm *arm;
@@ -326,7 +326,7 @@ static int handle_oocd_trace_config_command(struct command_context_s *cmd_ctx, c
        return ERROR_OK;
 }
 
-static int handle_oocd_trace_status_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_oocd_trace_status_command)
 {
        target_t *target;
        struct arm *arm;
@@ -366,7 +366,7 @@ static int handle_oocd_trace_status_command(struct command_context_s *cmd_ctx, c
        return ERROR_OK;
 }
 
-static int handle_oocd_trace_resync_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_oocd_trace_resync_command)
 {
        target_t *target;
        struct arm *arm;
index 575a99ce0beaf4770a58c2b3edb4526e581d1b12..401f4dfba81ac13ec824781fab76b4424312c4cb 100644 (file)
@@ -1650,7 +1650,7 @@ int target_write_u8(struct target_s *target, uint32_t address, uint8_t value)
        return retval;
 }
 
-static int handle_targets_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_targets_command)
 {
        target_t *target = all_targets;
 
@@ -1862,7 +1862,7 @@ int handle_target(void *priv)
        return retval;
 }
 
-static int handle_reg_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_reg_command)
 {
        target_t *target;
        reg_t *reg = NULL;
@@ -1993,7 +1993,7 @@ static int handle_reg_command(struct command_context_s *cmd_ctx, char *cmd, char
        return ERROR_OK;
 }
 
-static int handle_poll_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_poll_command)
 {
        int retval = ERROR_OK;
        target_t *target = get_current_target(cmd_ctx);
@@ -2035,7 +2035,7 @@ static int handle_poll_command(struct command_context_s *cmd_ctx, char *cmd, cha
        return retval;
 }
 
-static int handle_wait_halt_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_wait_halt_command)
 {
        if (argc > 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -2102,7 +2102,7 @@ int target_wait_state(target_t *target, enum target_state state, int ms)
        return ERROR_OK;
 }
 
-static int handle_halt_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_halt_command)
 {
        LOG_DEBUG("-");
 
@@ -2124,7 +2124,7 @@ static int handle_halt_command(struct command_context_s *cmd_ctx, char *cmd, cha
        return handle_wait_halt_command(cmd_ctx, cmd, args, argc);
 }
 
-static int handle_soft_reset_halt_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_soft_reset_halt_command)
 {
        target_t *target = get_current_target(cmd_ctx);
 
@@ -2135,7 +2135,7 @@ static int handle_soft_reset_halt_command(struct command_context_s *cmd_ctx, cha
        return ERROR_OK;
 }
 
-static int handle_reset_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_reset_command)
 {
        if (argc > 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -2156,7 +2156,7 @@ static int handle_reset_command(struct command_context_s *cmd_ctx, char *cmd, ch
 }
 
 
-static int handle_resume_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_resume_command)
 {
        int current = 1;
        if (argc > 1)
@@ -2178,7 +2178,7 @@ static int handle_resume_command(struct command_context_s *cmd_ctx, char *cmd, c
        return target_resume(target, current, addr, 1, 0);
 }
 
-static int handle_step_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_step_command)
 {
        if (argc > 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -2250,7 +2250,7 @@ static void handle_md_output(struct command_context_s *cmd_ctx,
        }
 }
 
-static int handle_md_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_md_command)
 {
        if (argc < 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -2299,7 +2299,7 @@ static int handle_md_command(struct command_context_s *cmd_ctx, char *cmd, char
        return retval;
 }
 
-static int handle_mw_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_mw_command)
 {
        if (argc < 2)
        {
@@ -2401,7 +2401,7 @@ static int parse_load_image_command_args(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int handle_load_image_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_load_image_command)
 {
        uint8_t *buffer;
        uint32_t buf_cnt;
@@ -2492,7 +2492,7 @@ static int handle_load_image_command(struct command_context_s *cmd_ctx, char *cm
 
 }
 
-static int handle_dump_image_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_dump_image_command)
 {
        fileio_t fileio;
 
@@ -2700,12 +2700,12 @@ done:
        return retval;
 }
 
-static int handle_verify_image_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_verify_image_command)
 {
        return handle_verify_image_command_internal(cmd_ctx, cmd, args, argc, 1);
 }
 
-static int handle_test_image_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_test_image_command)
 {
        return handle_verify_image_command_internal(cmd_ctx, cmd, args, argc, 0);
 }
@@ -2750,8 +2750,7 @@ static int handle_bp_command_set(struct command_context_s *cmd_ctx,
        return retval;
 }
 
-static int handle_bp_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_bp_command)
 {
        if (argc == 0)
                return handle_bp_command_list(cmd_ctx);
@@ -2779,7 +2778,7 @@ static int handle_bp_command(struct command_context_s *cmd_ctx,
        return handle_bp_command_set(cmd_ctx, addr, length, hw);
 }
 
-static int handle_rbp_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_rbp_command)
 {
        if (argc != 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -2793,7 +2792,7 @@ static int handle_rbp_command(struct command_context_s *cmd_ctx, char *cmd, char
        return ERROR_OK;
 }
 
-static int handle_wp_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_wp_command)
 {
        target_t *target = get_current_target(cmd_ctx);
 
@@ -2865,7 +2864,7 @@ static int handle_wp_command(struct command_context_s *cmd_ctx, char *cmd, char
        return retval;
 }
 
-static int handle_rwp_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_rwp_command)
 {
        if (argc != 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -2886,8 +2885,7 @@ static int handle_rwp_command(struct command_context_s *cmd_ctx, char *cmd, char
  * The low-level target implementation must have logged a detailed error
  * which is forwarded to telnet/GDB session.
  */
-static int handle_virt2phys_command(command_context_t *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_virt2phys_command)
 {
        if (argc != 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -3021,7 +3019,7 @@ static void writeGmon(uint32_t *samples, uint32_t sampleNum, const char *filenam
 }
 
 /* profiling samples the CPU PC as quickly as OpenOCD is able, which will be used as a random sampling of PC */
-static int handle_profile_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_profile_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct timeval timeout, now;
@@ -4539,7 +4537,7 @@ static void free_fastload(void)
 
 
 
-static int handle_fast_load_image_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_fast_load_image_command)
 {
        uint8_t *buffer;
        uint32_t buf_cnt;
@@ -4650,7 +4648,7 @@ static int handle_fast_load_image_command(struct command_context_s *cmd_ctx, cha
        return retval;
 }
 
-static int handle_fast_load_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_fast_load_command)
 {
        if (argc > 0)
                return ERROR_COMMAND_SYNTAX_ERROR;
index 5bfd57a429d0d41a75d6dbc7ddb82cfdb90ae438..4bfda5bf700e4219116c7905b1d0f1cc719276e8 100644 (file)
@@ -257,7 +257,7 @@ int delete_debug_msg_receiver(struct command_context_s *cmd_ctx, target_t *targe
        return ERROR_OK;
 }
 
-static int handle_target_request_debugmsgs_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_target_request_debugmsgs_command)
 {
        target_t *target = get_current_target(cmd_ctx);
 
index e74c6160ffff7e68a16d676e729cab5f1658b05c..2c259709e6c05a47c1fc044091f172d474ffa34f 100644 (file)
@@ -47,7 +47,7 @@ int trace_point(target_t *target, uint32_t number)
        return ERROR_OK;
 }
 
-static int handle_trace_point_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_trace_point_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        trace_t *trace = target->trace_info;
@@ -95,7 +95,7 @@ static int handle_trace_point_command(struct command_context_s *cmd_ctx, char *c
        return ERROR_OK;
 }
 
-static int handle_trace_history_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_trace_history_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        trace_t *trace = target->trace_info;
index 0dc18f0baf2503454692b4b6e7003bc96224ddcc..6f2d6ee3dfe7ec562b92e2b06a7e07fc4187cb49 100644 (file)
@@ -2989,9 +2989,7 @@ static int xscale_target_create(struct target_s *target, Jim_Interp *interp)
                        target->variant);
 }
 
-static int
-xscale_handle_debug_handler_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_debug_handler_command)
 {
        target_t *target = NULL;
        xscale_common_t *xscale;
@@ -3031,9 +3029,7 @@ xscale_handle_debug_handler_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int
-xscale_handle_cache_clean_address_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_cache_clean_address_command)
 {
        target_t *target = NULL;
        xscale_common_t *xscale;
@@ -3070,9 +3066,7 @@ xscale_handle_cache_clean_address_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int
-xscale_handle_cache_info_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_cache_info_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct xscale_common_s *xscale = target_to_xscale(target);
@@ -3121,8 +3115,7 @@ static int xscale_mmu(struct target_s *target, int *enabled)
        return ERROR_OK;
 }
 
-static int xscale_handle_mmu_command(command_context_t *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_mmu_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct xscale_common_s *xscale = target_to_xscale(target);
@@ -3157,8 +3150,7 @@ static int xscale_handle_mmu_command(command_context_t *cmd_ctx,
        return ERROR_OK;
 }
 
-static int xscale_handle_idcache_command(command_context_t *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_idcache_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct xscale_common_s *xscale = target_to_xscale(target);
@@ -3211,8 +3203,7 @@ static int xscale_handle_idcache_command(command_context_t *cmd_ctx,
        return ERROR_OK;
 }
 
-static int xscale_handle_vector_catch_command(command_context_t *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_vector_catch_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct xscale_common_s *xscale = target_to_xscale(target);
@@ -3239,8 +3230,7 @@ static int xscale_handle_vector_catch_command(command_context_t *cmd_ctx,
 }
 
 
-static int xscale_handle_vector_table_command(command_context_t *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_vector_table_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct xscale_common_s *xscale = target_to_xscale(target);
@@ -3298,9 +3288,7 @@ static int xscale_handle_vector_table_command(command_context_t *cmd_ctx,
 }
 
 
-static int
-xscale_handle_trace_buffer_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_trace_buffer_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct xscale_common_s *xscale = target_to_xscale(target);
@@ -3379,9 +3367,7 @@ xscale_handle_trace_buffer_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int
-xscale_handle_trace_image_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_trace_image_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct xscale_common_s *xscale = target_to_xscale(target);
@@ -3429,8 +3415,7 @@ xscale_handle_trace_image_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int xscale_handle_dump_trace_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_dump_trace_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct xscale_common_s *xscale = target_to_xscale(target);
@@ -3487,9 +3472,7 @@ static int xscale_handle_dump_trace_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int
-xscale_handle_analyze_trace_buffer_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_analyze_trace_buffer_command)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct xscale_common_s *xscale = target_to_xscale(target);
@@ -3504,8 +3487,7 @@ xscale_handle_analyze_trace_buffer_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int xscale_handle_cp15(command_context_t *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_cp15)
 {
        target_t *target = get_current_target(cmd_ctx);
        struct xscale_common_s *xscale = target_to_xscale(target);
index 909d7a1e76973b95eb876a0d6795237f8b81f7cb..e0756b5032615db7123bc3a4557b5af1f495708a 100644 (file)
@@ -175,7 +175,7 @@ static int xsvf_read_buffer(int num_bits, int fd, uint8_t* buf)
 }
 
 
-static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_xsvf_command)
 {
        uint8_t *dr_out_buf = NULL;                             /* from host to device (TDI) */
        uint8_t *dr_in_buf = NULL;                              /* from device to host (TDO) */