void virtqueue_map_sg(struct iovec *sg, hwaddr *addr,

    size_t num_sg, int is_write)

{

    unsigned int i;

    hwaddr len;



    if (num_sg >= VIRTQUEUE_MAX_SIZE) {

        error_report("virtio: map attempt out of bounds: %zd > %d",

                     num_sg, VIRTQUEUE_MAX_SIZE);

        exit(1);

    }



    for (i = 0; i < num_sg; i++) {

        len = sg[i].iov_len;

        sg[i].iov_base = cpu_physical_memory_map(addr[i], &len, is_write);

        if (sg[i].iov_base == NULL || len != sg[i].iov_len) {

            error_report("virtio: trying to map MMIO memory");

            exit(1);

        }

    }

}

void virtqueue_map_sg(struct iovec *sg, hwaddr *addr,

    size_t num_sg, int is_write)

{

    unsigned int i;

    hwaddr len;



    if (num_sg >= VIRTQUEUE_MAX_SIZE) {

        error_report("virtio: map attempt out of bounds: %zd > %d",

                     num_sg, VIRTQUEUE_MAX_SIZE);

        exit(1);

    }



    for (i = 0; i < num_sg; i++) {

        len = sg[i].iov_len;

        sg[i].iov_base = cpu_physical_memory_map(addr[i], &len, is_write);

        if (sg[i].iov_base == NULL || len != sg[i].iov_len) {

            error_report("virtio: trying to map MMIO memory");

            exit(1);

        }

    }

}

void FUNC_0(struct iovec *VAR_0, hwaddr *VAR_1,

    size_t VAR_2, int VAR_3)

{

    unsigned int VAR_4;

    hwaddr len;



    if (VAR_2 >= VIRTQUEUE_MAX_SIZE) {

        error_report("virtio: map attempt out of bounds: %zd > %d",

                     VAR_2, VIRTQUEUE_MAX_SIZE);

        exit(1);

    }



    for (VAR_4 = 0; VAR_4 < VAR_2; VAR_4++) {

        len = VAR_0[VAR_4].iov_len;

        VAR_0[VAR_4].iov_base = cpu_physical_memory_map(VAR_1[VAR_4], &len, VAR_3);

        if (VAR_0[VAR_4].iov_base == NULL || len != VAR_0[VAR_4].iov_len) {

            error_report("virtio: trying to map MMIO memory");

            exit(1);

        }

    }

}

void FUNC_0(struct iovec *VAR_0, hwaddr *VAR_1,
size_t VAR_2, int VAR_3)
{ unsigned int VAR_4; hwaddr len; if (VAR_2 >= VIRTQUEUE_MAX_SIZE) { error_report("virtio: map attempt out of bounds: %zd > %d",
VAR_2, VIRTQUEUE_MAX_SIZE); exit(1); } for (VAR_4 = 0; VAR_4 < VAR_2; VAR_4++) { len = VAR_0[VAR_4].iov_len; VAR_0[VAR_4].iov_base = cpu_physical_memory_map(VAR_1[VAR_4], &len, VAR_3); if (VAR_0[VAR_4].iov_base == NULL || len != VAR_0[VAR_4].iov_len) { error_report("virtio: trying to map MMIO memory"); exit(1); } } }