diff options
author | Zachary T Welch <zw@superlucidity.net> | 2009-11-09 23:56:52 -0800 |
---|---|---|
committer | Zachary T Welch <zw@superlucidity.net> | 2009-11-13 10:51:45 -0800 |
commit | cfc4d5c6b7b6f8f82dc5bbf3ee661c179814666e (patch) | |
tree | f129c414d90f81a2caf6054ab7bbcd1306ac1f26 /src/flash | |
parent | ddb6138ed428f666064d26bb08036de3afe44bc8 (diff) | |
download | openocd+libswd-cfc4d5c6b7b6f8f82dc5bbf3ee661c179814666e.tar.gz openocd+libswd-cfc4d5c6b7b6f8f82dc5bbf3ee661c179814666e.tar.bz2 openocd+libswd-cfc4d5c6b7b6f8f82dc5bbf3ee661c179814666e.tar.xz openocd+libswd-cfc4d5c6b7b6f8f82dc5bbf3ee661c179814666e.zip |
use COMMAND_HANDLER macro to define all commands
Diffstat (limited to 'src/flash')
-rw-r--r-- | src/flash/at91sam3.c | 9 | ||||
-rw-r--r-- | src/flash/at91sam7.c | 2 | ||||
-rw-r--r-- | src/flash/avrf.c | 2 | ||||
-rw-r--r-- | src/flash/flash.c | 24 | ||||
-rw-r--r-- | src/flash/lpc2000.c | 2 | ||||
-rw-r--r-- | src/flash/lpc2900.c | 18 | ||||
-rw-r--r-- | src/flash/lpc3180_nand_controller.c | 2 | ||||
-rw-r--r-- | src/flash/mflash.c | 11 | ||||
-rw-r--r-- | src/flash/nand.c | 18 | ||||
-rw-r--r-- | src/flash/pic32mx.c | 10 | ||||
-rw-r--r-- | src/flash/stellaris.c | 2 | ||||
-rw-r--r-- | src/flash/stm32x.c | 12 | ||||
-rw-r--r-- | src/flash/str7x.c | 4 | ||||
-rw-r--r-- | src/flash/str9x.c | 6 | ||||
-rw-r--r-- | src/flash/str9xpec.c | 22 | ||||
-rw-r--r-- | src/flash/tms470.c | 6 |
16 files changed, 68 insertions, 82 deletions
diff --git a/src/flash/at91sam3.c b/src/flash/at91sam3.c index 714e8b8b..804a35b4 100644 --- a/src/flash/at91sam3.c +++ b/src/flash/at91sam3.c @@ -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; diff --git a/src/flash/at91sam7.c b/src/flash/at91sam7.c index 134c9e56..4cd27056 100644 --- a/src/flash/at91sam7.c +++ b/src/flash/at91sam7.c @@ -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; diff --git a/src/flash/avrf.c b/src/flash/avrf.c index b0459093..6badb2d1 100644 --- a/src/flash/avrf.c +++ b/src/flash/avrf.c @@ -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; diff --git a/src/flash/flash.c b/src/flash/flash.c index 1a04e123..d3889b9b 100644 --- a/src/flash/flash.c +++ b/src/flash/flash.c @@ -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; diff --git a/src/flash/lpc2000.c b/src/flash/lpc2000.c index e71629e5..4d4d9a2a 100644 --- a/src/flash/lpc2000.c +++ b/src/flash/lpc2000.c @@ -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]; diff --git a/src/flash/lpc2900.c b/src/flash/lpc2900.c index 379b4e87..945fc9a2 100644 --- a/src/flash/lpc2900.c +++ b/src/flash/lpc2900.c @@ -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) { diff --git a/src/flash/lpc3180_nand_controller.c b/src/flash/lpc3180_nand_controller.c index f02c8807..4b120779 100644 --- a/src/flash/lpc3180_nand_controller.c +++ b/src/flash/lpc3180_nand_controller.c @@ -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[] = diff --git a/src/flash/mflash.c b/src/flash/mflash.c index 5a392a4d..5a9b7c35 100644 --- a/src/flash/mflash.c +++ b/src/flash/mflash.c @@ -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; diff --git a/src/flash/nand.c b/src/flash/nand.c index 4d32d25d..181700d0 100644 --- a/src/flash/nand.c +++ b/src/flash/nand.c @@ -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)) { diff --git a/src/flash/pic32mx.c b/src/flash/pic32mx.c index 78ed1854..aa34aeae 100644 --- a/src/flash/pic32mx.c +++ b/src/flash/pic32mx.c @@ -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; diff --git a/src/flash/stellaris.c b/src/flash/stellaris.c index bd561a61..22d5bc46 100644 --- a/src/flash/stellaris.c +++ b/src/flash/stellaris.c @@ -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; diff --git a/src/flash/stm32x.c b/src/flash/stm32x.c index 2ca5fa94..95d15a95 100644 --- a/src/flash/stm32x.c +++ b/src/flash/stm32x.c @@ -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; diff --git a/src/flash/str7x.c b/src/flash/str7x.c index ed107f31..028eab63 100644 --- a/src/flash/str7x.c +++ b/src/flash/str7x.c @@ -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; diff --git a/src/flash/str9x.c b/src/flash/str9x.c index 893baf53..665c1607 100644 --- a/src/flash/str9x.c +++ b/src/flash/str9x.c @@ -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; diff --git a/src/flash/str9xpec.c b/src/flash/str9xpec.c index 73b9a1d4..3a35ee17 100644 --- a/src/flash/str9xpec.c +++ b/src/flash/str9xpec.c @@ -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; diff --git a/src/flash/tms470.c b/src/flash/tms470.c index 1348697a..53043cd5 100644 --- a/src/flash/tms470.c +++ b/src/flash/tms470.c @@ -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) { |