On Thu, Jul 7, 2011 at 10:41 PM, Mahr, Stefan <stefan.m...@sphairon.com> wrote: >>>>> If alignment is not guaranteed, casting from uint32 to void would cause >>>>> problems too, wouldn't it? >>>> Why? >>> >>> Sorry for confusion. I meant the casting within "mips32_pracc_read_mem". >>> This >>> is also a cast from void* to uint32_t*. If there will be an alignment >>> error, it will >>> occur here too. >> >> That's correct. There is no way to know from the code context, is there? >> >> No documentation either. > > Probably the best way would be to remove endianness swapping from > mips_m4k_read_memory > and put it to mips32_pracc/dma_read_mem32/16. Same for write. > > pro: mips32_pracc_read_mem32, ... will return a byte array in target > endianness, so no cast necessary. > con: Add swapping to at least 10 seperate functions
I am not keen to have code repetition in MIPS32 PrAcc code, which is already bloated and very difficult to maintain... I think we should well understand what is happening here before resolving the problem in the most elegant manner. BR, Drasko _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development