On Thu, Jul 7, 2011 at 11:04 PM, Michael Schwingen <rincew...@discworld.dascon.de> wrote: > Am 07/07/2011 10:41 PM, schrieb Mahr, Stefan: >> 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 > Not sure about this. > > Without having a look at the code, I would expect a function with > read_mem32 in the name to return a 32-bit value, not a byte array, and I > would expect to get a 32-bit value without a cast.
Which cast exacly are you mentioning, and in which function ? static int mips32_pracc_read_mem32(struct mips_ejtag *ejtag_info, uint32_t addr, int count, uint32_t *buf) does not do any casting and returns 32-bit value. > > Especially if this is used in 10 places, this looks like there *is* a > need for a function that returns swapped 32-bit values, only the > function uses the wrong data types. I have seen some things that can be avoided in mips32_pracc code. Can you point me exactly to the places, I can not seem to get the particular problem... BR, Drasko _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development