fixed warning (and also potential bug when >4G of mem is emulated) for USB code

This commit is contained in:
Stanislav Shwartsman 2017-03-18 07:26:26 +00:00
parent 29e9b54cfd
commit c24d5bfa94

View File

@ -349,20 +349,16 @@ static BX_CPP_INLINE struct USBAsync *container_of_usb_packet(void *ptr)
// dword read / write helper functions
static BX_CPP_INLINE void get_dwords(Bit32u addr, Bit32u *buf, int num)
static BX_CPP_INLINE void get_dwords(bx_phy_address addr, Bit32u *buf, int num)
{
int i;
for (i = 0; i < num; i++, buf++, addr += sizeof(*buf)) {
for (int i = 0; i < num; i++, buf++, addr += sizeof(*buf)) {
DEV_MEM_READ_PHYSICAL(addr, 4, (Bit8u*)buf);
}
}
static BX_CPP_INLINE void put_dwords(Bit32u addr, Bit32u *buf, int num)
static BX_CPP_INLINE void put_dwords(bx_phy_address addr, Bit32u *buf, int num)
{
int i;
for (i = 0; i < num; i++, buf++, addr += sizeof(*buf)) {
for (int i = 0; i < num; i++, buf++, addr += sizeof(*buf)) {
DEV_MEM_WRITE_PHYSICAL(addr, 4, (Bit8u*)buf);
}
}