On Fri, Jul 8, 2011 at 1:19 PM, Andreas Fritiofson
<andreas.fritiof...@gmail.com> wrote:
> I looked briefly at the memory read functions in mips32_dmaacc.c and
> mips32_pracc.c and it looks like the type usage is a bit confused. The
> difference between the *_read_mem{32,16,8} functions should only be what
> kind of access is made *on the target*.
How do we determine that ?

I thought that it is kept in the "size" parameter, and
mips32_pracc_read_mem is doing exactly this :

int mips32_pracc_read_mem(struct mips_ejtag *ejtag_info, uint32_t
addr, int size, int count, void *buf)
{
        switch (size)
        {
                case 1:
                        return mips32_pracc_read_mem8(ejtag_info, addr, count, 
(uint8_t*)buf);
                case 2:
                        return mips32_pracc_read_mem16(ejtag_info, addr, count, 
(uint16_t*)buf);
                case 4:
                        if (count == 1)
                                return mips32_pracc_read_u32(ejtag_info, addr, 
(uint32_t*)buf);
                        else
                                return mips32_pracc_read_mem32(ejtag_info, 
addr, count, (uint32_t*)buf);
        }

        return ERROR_OK;
}

> Host data buffer type should be
> identical, preferrably void*, with no alignment requirement, and count
> should be in number of bytes.

Problem is not in the mips32_pracc.c, thought, but when you come back
to mips_m4k_read_memory(), in which buf is uint8_t*.

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

Reply via email to