]> git.sur5r.net Git - openocd/commitdiff
use FLASH_BANK_COMMAND_HANDLER macro
authorZachary T Welch <zw@superlucidity.net>
Tue, 10 Nov 2009 09:41:30 +0000 (01:41 -0800)
committerZachary T Welch <zw@superlucidity.net>
Fri, 13 Nov 2009 18:51:46 +0000 (10:51 -0800)
Defines all flash_bank_command handlers using the new macro.

18 files changed:
src/flash/aduc702x.c
src/flash/at91sam3.c
src/flash/at91sam7.c
src/flash/avrf.c
src/flash/cfi.c
src/flash/ecos.c
src/flash/faux.c
src/flash/lpc2000.c
src/flash/lpc288x.c
src/flash/lpc2900.c
src/flash/ocl.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

index 7d6fa24ed4d77530bbe1fccd4ca20e92342ca35b..0e862e9b8397d1feacf1b0bc3e614862b2f312c6 100644 (file)
@@ -61,7 +61,7 @@ typedef struct
 
 /* flash bank aduc702x 0 0 0 0 <target#>
  * The ADC7019-28 devices all have the same flash layout */
-static int aduc702x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank)
+FLASH_BANK_COMMAND_HANDLER(aduc702x_flash_bank_command)
 {
        aduc702x_flash_bank_t *nbank;
 
index 804a35b44be37c80fc863268e345370c426e62f4..7e6b4567de65fd40b17ec2edb61bea3890d98e40 100644 (file)
@@ -1641,12 +1641,7 @@ sam3_protect_check(struct flash_bank_s *bank)
        return ERROR_OK;
 }
 
-static int
-sam3_flash_bank_command(struct command_context_s *cmd_ctx,
-                           char *cmd,
-                           char **args,
-                           int argc,
-                           struct flash_bank_s *bank)
+FLASH_BANK_COMMAND_HANDLER(sam3_flash_bank_command)
 {
        struct sam3_chip *pChip;
 
index 4cd270560664b2d92dfcb536c21a01fb9ea11d62..266be06875a30984d86103de05207f8a97c5aa37 100644 (file)
@@ -711,7 +711,7 @@ static int at91sam7_protect_check(struct flash_bank_s *bank)
        return ERROR_OK;
 }
 
-static int at91sam7_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank)
+FLASH_BANK_COMMAND_HANDLER(at91sam7_flash_bank_command)
 {
        flash_bank_t *t_bank = bank;
        at91sam7_flash_bank_t *at91sam7_info;
index 6badb2d1035dfaee5f7570ee793df7e7e8340e7c..35d31fb05478593bfcba9e795503d77baa540fd7 100644 (file)
@@ -180,7 +180,7 @@ static int avr_jtagprg_writeflashpage(avr_common_t *avr, uint8_t *page_buf, uint
        return ERROR_OK;
 }
 
-static int avrf_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank)
+FLASH_BANK_COMMAND_HANDLER(avrf_flash_bank_command)
 {
        avrf_flash_bank_t *avrf_info;
 
index b448a300b9b72dbd4916fea240c460d66d62596f..08c43580e0403316403fd402ccc8d47efe13d6cf 100644 (file)
@@ -601,7 +601,7 @@ static int cfi_register_commands(struct command_context_s *cmd_ctx)
 
 /* flash_bank cfi <base> <size> <chip_width> <bus_width> <target#> [options]
  */
-static int cfi_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank)
+FLASH_BANK_COMMAND_HANDLER(cfi_flash_bank_command)
 {
        cfi_flash_bank_t *cfi_info;
        int i;
index 401fdf2bc8fb05b5c102af533dc9f5112bccbc90..2c3190a126a860250017f5c373877c1c37496d94 100644 (file)
@@ -104,7 +104,7 @@ flash_errmsg(int err)
 
 /* flash bank ecosflash <base> <size> <chip_width> <bus_width> <target#> <driverPath>
  */
-static int ecosflash_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank)
+FLASH_BANK_COMMAND_HANDLER(ecosflash_flash_bank_command)
 {
        ecosflash_flash_bank_t *info;
 
index 474dee5b3b5f68be136bb4c4eb76328f31afc883..b997b8733ac67663797631a4147d63b48930f466 100644 (file)
@@ -37,7 +37,7 @@ static const int sectorSize = 0x10000;
 
 /* flash bank faux <base> <size> <chip_width> <bus_width> <target#> <driverPath>
  */
-static int faux_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank)
+FLASH_BANK_COMMAND_HANDLER(faux_flash_bank_command)
 {
        faux_flash_bank_t *info;
 
index 4d4d9a2aee6e997b064e6c317969e4bd9c125dbe..0481355c5f0185bea148c9d6c2b1b09f930b6bee 100644 (file)
@@ -419,7 +419,7 @@ static int lpc2000_iap_blank_check(struct flash_bank_s *bank, int first, int las
 /*
  * flash bank lpc2000 <base> <size> 0 0 <target#> <lpc_variant> <cclk> [calc_checksum]
  */
-static int lpc2000_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank)
+FLASH_BANK_COMMAND_HANDLER(lpc2000_flash_bank_command)
 {
        lpc2000_flash_bank_t *lpc2000_info;
 
index 36444fb1a4e0e4dc8c6ffa784c82ef6518820c73..3c3e1e484621d290e569690ff122efc918260924 100644 (file)
@@ -165,7 +165,7 @@ static int lpc288x_protect_check(struct flash_bank_s *bank)
 }
 
 /* flash_bank LPC288x 0 0 0 0 <target#> <cclk> */
-static int lpc288x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank)
+FLASH_BANK_COMMAND_HANDLER(lpc288x_flash_bank_command)
 {
        lpc288x_flash_bank_t *lpc288x_info;
 
index 945fc9a24862171ef75a7196db55c4605c38c657..953a62a142ddb9a8f4d8bdccd4de1fe7b7c1bb31 100644 (file)
@@ -1016,9 +1016,7 @@ static int lpc2900_register_commands(struct command_context_s *cmd_ctx)
 
 
 /// Evaluate flash bank command.
-static int lpc2900_flash_bank_command(struct command_context_s *cmd_ctx,
-                                      char *cmd, char **args, int argc,
-                                      struct flash_bank_s *bank)
+FLASH_BANK_COMMAND_HANDLER(lpc2900_flash_bank_command)
 {
        lpc2900_flash_bank_t *lpc2900_info;
 
index 51ccc9616b610d232f0a63399f80f55991ba6cef..63e9282fc1adca48d22afd8938ee06de891f06c9 100644 (file)
@@ -44,7 +44,7 @@ static int ocl_protect_check(struct flash_bank_s *bank)
 }
 
 /* flash_bank ocl 0 0 0 0 <target#> */
-static int ocl_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank)
+FLASH_BANK_COMMAND_HANDLER(ocl_flash_bank_command)
 {
        int retval;
        armv4_5_common_t *armv4_5;
index aa34aeaeb77458636fe1e167610961cb9893bef6..1408fe9cc5b3dc6af1ca7a91c0521cb67cf0b3a4 100644 (file)
@@ -62,7 +62,7 @@ static int pic32mx_write_word(struct flash_bank_s *bank, uint32_t address, uint3
 
 /* flash bank pic32mx <base> <size> 0 0 <target#>
  */
-static int pic32mx_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank)
+FLASH_BANK_COMMAND_HANDLER(pic32mx_flash_bank_command)
 {
        pic32mx_flash_bank_t *pic32mx_info;
 
index 22d5bc462286259a5e72abb11398b2d199f97315..d66b9a8a880a68697b4fc6ccea9622a2a73521fa 100644 (file)
@@ -213,7 +213,7 @@ static char * StellarisClassname[5] =
 
 /* flash_bank stellaris <base> <size> 0 0 <target#>
  */
-static int stellaris_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank)
+FLASH_BANK_COMMAND_HANDLER(stellaris_flash_bank_command)
 {
        stellaris_flash_bank_t *stellaris_info;
 
index 95d15a95189dda15702c6ef103bef8968706fddf..41b9008f70495f763fc95c7b7a072dd533a315a7 100644 (file)
@@ -33,7 +33,7 @@ static int stm32x_mass_erase(struct flash_bank_s *bank);
 
 /* flash bank stm32x <base> <size> 0 0 <target#>
  */
-static int stm32x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank)
+FLASH_BANK_COMMAND_HANDLER(stm32x_flash_bank_command)
 {
        stm32x_flash_bank_t *stm32x_info;
 
index 028eab63098048e95dc66da59e1ad5775bd50fbd..9738180e01f3065cdcd0dcaf51f7a1cd0c5a6ba0 100644 (file)
@@ -109,7 +109,7 @@ static int str7x_build_block_list(struct flash_bank_s *bank)
 
 /* flash bank str7x <base> <size> 0 0 <target#> <str71_variant>
  */
-static int str7x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank)
+FLASH_BANK_COMMAND_HANDLER(str7x_flash_bank_command)
 {
        str7x_flash_bank_t *str7x_info;
 
index 665c1607cccd011c9ccf896f9eb66b6668f9288e..cdee571939881fbc125f2c8d9c687d980942dcfa 100644 (file)
@@ -116,8 +116,7 @@ static int str9x_build_block_list(struct flash_bank_s *bank)
 
 /* flash bank str9x <base> <size> 0 0 <target#>
  */
-static int str9x_flash_bank_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc, struct flash_bank_s *bank)
+FLASH_BANK_COMMAND_HANDLER(str9x_flash_bank_command)
 {
        str9x_flash_bank_t *str9x_info;
 
index 3a35ee170660096baed4f6a714f7df5e537931cc..4056ba7e5c392e1128226c100877262ccf3a4827 100644 (file)
@@ -235,7 +235,7 @@ static int str9xpec_build_block_list(struct flash_bank_s *bank)
 
 /* flash bank str9x <base> <size> 0 0 <target#>
  */
-static int str9xpec_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank)
+FLASH_BANK_COMMAND_HANDLER(str9xpec_flash_bank_command)
 {
        str9xpec_flash_controller_t *str9xpec_info;
        armv4_5_common_t *armv4_5 = NULL;
index 53043cd5bb834043f0f616e00348d492771cc0a1..d33ccd6793303fbd9ae7cb05d7d1c5c6c1c69860 100644 (file)
@@ -1222,7 +1222,7 @@ static int tms470_info(struct flash_bank_s *bank, char *buf, int buf_size)
  * [options...]
  */
 
-static int tms470_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank)
+FLASH_BANK_COMMAND_HANDLER(tms470_flash_bank_command)
 {
        bank->driver_priv = malloc(sizeof(tms470_flash_bank_t));