From e4c054cada07bf780fbb750bfd630ec6c03d6d99 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Harboe?= Date: Tue, 28 Jun 2011 18:09:48 +0200 Subject: [PATCH] dsp5680xx: fix compilation problems use a more specific global variable name than "context", which can easily conflict with other things. --- src/target/dsp5680xx.c | 63 ++++++++++++++++++++++-------------------- src/target/dsp5680xx.h | 4 ++- 2 files changed, 36 insertions(+), 31 deletions(-) diff --git a/src/target/dsp5680xx.c b/src/target/dsp5680xx.c index 9afda424..97cd0f42 100644 --- a/src/target/dsp5680xx.c +++ b/src/target/dsp5680xx.c @@ -28,6 +28,9 @@ #include "target_type.h" #include "dsp5680xx.h" +struct dsp5680xx_common dsp5680xx_context; + + #define err_check(retval,err_msg) if(retval != ERROR_OK){LOG_ERROR("%s: %d %s.",__FUNCTION__,__LINE__,err_msg);return retval;} #define err_check_propagate(retval) if(retval!=ERROR_OK){return retval;} @@ -62,7 +65,7 @@ static int dsp5680xx_drscan(struct target * target, uint8_t * data_to_shift_into //can i send as many bits as i want? //is the casting necessary? jtag_add_plain_dr_scan(len,data_to_shift_into_dr,data_shifted_out_of_dr, TAP_IDLE); - if(context.flush){ + if(dsp5680xx_context.flush){ retval = dsp5680xx_execute_queue(); err_check_propagate(retval); } @@ -94,7 +97,7 @@ static int dsp5680xx_irscan(struct target * target, uint32_t * data_to_shift_int //can i send as many bits as i want? //is the casting necessary? jtag_add_plain_ir_scan(ir_len,(uint8_t *)data_to_shift_into_ir,(uint8_t *)data_shifted_out_of_ir, TAP_IDLE); - if(context.flush){ + if(dsp5680xx_context.flush){ retval = dsp5680xx_execute_queue(); err_check_propagate(retval); } @@ -505,7 +508,7 @@ static int eonce_pc_store(struct target * target){ retval = eonce_rx_lower_data(target,(uint16_t *)&tmp); err_check_propagate(retval); LOG_USER("PC value: 0x%06X\n",tmp); - context.stored_pc = (uint32_t)tmp; + dsp5680xx_context.stored_pc = (uint32_t)tmp; return ERROR_OK; } @@ -516,8 +519,8 @@ static int dsp5680xx_target_create(struct target *target, Jim_Interp * interp){ } static int dsp5680xx_init_target(struct command_context *cmd_ctx, struct target *target){ - context.stored_pc = 0; - context.flush = 1; + dsp5680xx_context.stored_pc = 0; + dsp5680xx_context.flush = 1; LOG_DEBUG("target initiated!"); //TODO core tap must be enabled before running these commands, currently this is done in the .cfg tcl script. return ERROR_OK; @@ -739,12 +742,12 @@ static int dsp5680xx_read(struct target * target, uint32_t address, unsigned siz retval = dsp5680xx_convert_address(&address, &pmem); err_check_propagate(retval); - context.flush = 0; + dsp5680xx_context.flush = 0; int counter = FLUSH_COUNT_READ_WRITE; for (unsigned i=0; iarch_info; -- 2.39.5