/* Equivalent to cpu_physical_memory_rw(addr + (req->df ? -1 : +1) * req->size * i, val, req->size, 0/1) except without the integer overflow problems.  */
static void rw_phys_req_item(hwaddr addr, ioreq_t *req, uint32_t i, void *val, int rw)
/* Equivalent to cpu_physical_memory_rw(addr + (req->df ? -1 : +1) * req->size * i, val, req->size, 0/1) except without the integer overflow problems.  */
static void rw_phys_req_item(hwaddr addr, ioreq_t *req, uint32_t i, void *val, int rw)
{
    hwaddr offset = (hwaddr)req->size * i;
    if (req->df) {
        addr -= offset;
    } else {
        addr += offset;
    }
    cpu_physical_memory_rw(addr, val, req->size, rw);
}