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 clearly do not know the code well enough and I have no facilities to test such a thing.... I trust you here though. -- Øyvind Harboe - Can Zylin Consulting help on your project? US toll free 1-866-980-3434 / International +47 51 87 40 27 http://www.zylin.com/ _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development