On Wed, Jun 29, 2011 at 9:17 PM, Rodrigo Rosa <rodrigorosa...@gmail.com>wrote:

> On Wed, Jun 29, 2011 at 12:44 AM, Øyvind Harboe <oyvind.har...@zylin.com>
> wrote:
> > This is disturbing. Why switch to global variables?
> >
> > +static uint32_t data_read_dummy;
> >  static int jtag_data_write(struct target * target, uint32_t instr,int
> > num_bits, uint32_t * data_read){
> >   int retval;
> > -  uint32_t data_read_dummy;
> >
>
> i did this to have mem to dump the data read at the time the queue is
> flushed
> i do not care about this data, but i need somewhere to dump it
> (otherwise it'll segfault). multiple instances of the target would not
> cause trouble, since i do not care about this data, so it could be
> overwritten and it would no break anything.


It should be safe to pass null as read pointer if you want to discard the
data from the scan. This is also explicitly stated in dsp5680xx_drscan().

However, jtag_data_write does use the data:
  if(data_read != NULL)
    *data_read = data_read_dummy;

This doesn't seem right, because the queue hasn't been executed yet and so
data_read_dummy has a bogus value. Bug?

/Andreas
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to