On Sunday 15 November 2009, Zach Welch wrote:
> > 
> > Or maybe I was.  Given that it copies everything, why
> > is there code *after* the copy mangling the last byte?
> > Wouldn't that only be correct when the code copied
> > all but the trailing partial byte?
> 
> It masks the last byte, ensuring any trailing bits are 0.
> Without it, the bits after the 'trailing' will have been copied beyond
> the bits intended: copy buf=0xff, len=3 should give 0x07 and not 0xff.
> Right?  That's what the old code did, in a really confusing manner.

Chalk it up to a flakey model for handling bitfields, then.

My model is that if I've got a buffer, and am told to
stuff N bits into it at a particular location, then
only N bits will change.

Instead, we seem to change N ... then zero up to seven
bits in the last byte.



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

Reply via email to