diff options
author | Andreas Fritiofson <andreas.fritiofson@gmail.com> | 2014-03-10 22:23:07 +0100 |
---|---|---|
committer | Spencer Oliver <spen@spen-soft.co.uk> | 2014-03-17 12:47:18 +0000 |
commit | 565f8481c7b71614a05d79ab79af8610d2535a81 (patch) | |
tree | e37bd29bd71c8c83046a4b91536405542e722d84 /src/target | |
parent | cd091c36305d9d2de838c7ba145ee7547e4e1640 (diff) | |
download | riscv-openocd-565f8481c7b71614a05d79ab79af8610d2535a81.zip riscv-openocd-565f8481c7b71614a05d79ab79af8610d2535a81.tar.gz riscv-openocd-565f8481c7b71614a05d79ab79af8610d2535a81.tar.bz2 |
flash: Constify write buffer
Change-Id: Ic812098d3ed5a2992c26bb57d08ae350e2c5d5d8
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/2040
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src/target')
-rw-r--r-- | src/target/dsp5680xx.c | 6 | ||||
-rw-r--r-- | src/target/dsp5680xx.h | 2 | ||||
-rw-r--r-- | src/target/target.c | 2 | ||||
-rw-r--r-- | src/target/target.h | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/src/target/dsp5680xx.c b/src/target/dsp5680xx.c index f72d336..8a58cab 100644 --- a/src/target/dsp5680xx.c +++ b/src/target/dsp5680xx.c @@ -1524,7 +1524,7 @@ static int dsp5680xx_checksum_memory(struct target *t, uint32_t a, uint32_t s, * * @return */ -static int perl_crc(uint8_t *buff8, uint32_t word_count) +static int perl_crc(const uint8_t *buff8, uint32_t word_count) { uint16_t checksum = 0xffff; @@ -1983,14 +1983,14 @@ const uint16_t pgm_write_pflash[] = { 0x8A46, 0x0013, 0x807D, 0xE700, const uint32_t pgm_write_pflash_length = 31; -int dsp5680xx_f_wr(struct target *t, uint8_t *b, uint32_t a, uint32_t count, +int dsp5680xx_f_wr(struct target *t, const uint8_t *b, uint32_t a, uint32_t count, int is_flash_lock) { struct target *target = t; uint32_t address = a; - uint8_t *buffer = b; + const uint8_t *buffer = b; int retval = ERROR_OK; diff --git a/src/target/dsp5680xx.h b/src/target/dsp5680xx.h index 1b71009..cb3bf2a 100644 --- a/src/target/dsp5680xx.h +++ b/src/target/dsp5680xx.h @@ -317,7 +317,7 @@ static inline struct dsp5680xx_common *target_to_dsp5680xx(struct target * * @return */ -int dsp5680xx_f_wr(struct target *target, uint8_t * buffer, uint32_t address, +int dsp5680xx_f_wr(struct target *target, const uint8_t * buffer, uint32_t address, uint32_t count, int is_flash_lock); /** diff --git a/src/target/target.c b/src/target/target.c index 43c897d..c09dfd8 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -853,7 +853,7 @@ done: */ int target_run_flash_async_algorithm(struct target *target, - uint8_t *buffer, uint32_t count, int block_size, + const uint8_t *buffer, uint32_t count, int block_size, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, uint32_t buffer_start, uint32_t buffer_size, diff --git a/src/target/target.h b/src/target/target.h index 3ce164a..8e1c8f9 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -474,7 +474,7 @@ int target_wait_algorithm(struct target *target, * */ int target_run_flash_async_algorithm(struct target *target, - uint8_t *buffer, uint32_t count, int block_size, + const uint8_t *buffer, uint32_t count, int block_size, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, uint32_t buffer_start, uint32_t buffer_size, |