static int vfio_ccw_handle_request(ORB *orb, SCSW *scsw, void *data)

{

    S390CCWDevice *cdev = data;

    VFIOCCWDevice *vcdev = DO_UPCAST(VFIOCCWDevice, cdev, cdev);

    struct ccw_io_region *region = vcdev->io_region;

    int ret;



    QEMU_BUILD_BUG_ON(sizeof(region->orb_area) != sizeof(ORB));

    QEMU_BUILD_BUG_ON(sizeof(region->scsw_area) != sizeof(SCSW));

    QEMU_BUILD_BUG_ON(sizeof(region->irb_area) != sizeof(IRB));



    memset(region, 0, sizeof(*region));



    memcpy(region->orb_area, orb, sizeof(ORB));

    memcpy(region->scsw_area, scsw, sizeof(SCSW));



again:

    ret = pwrite(vcdev->vdev.fd, region,

                 vcdev->io_region_size, vcdev->io_region_offset);

    if (ret != vcdev->io_region_size) {

        if (errno == EAGAIN) {

            goto again;

        }

        error_report("vfio-ccw: wirte I/O region failed with errno=%d", errno);

        return -errno;

    }



    return region->ret_code;

}

static int vfio_ccw_handle_request(ORB *orb, SCSW *scsw, void *data)

{

    S390CCWDevice *cdev = data;

    VFIOCCWDevice *vcdev = DO_UPCAST(VFIOCCWDevice, cdev, cdev);

    struct ccw_io_region *region = vcdev->io_region;

    int ret;



    QEMU_BUILD_BUG_ON(sizeof(region->orb_area) != sizeof(ORB));

    QEMU_BUILD_BUG_ON(sizeof(region->scsw_area) != sizeof(SCSW));

    QEMU_BUILD_BUG_ON(sizeof(region->irb_area) != sizeof(IRB));



    memset(region, 0, sizeof(*region));



    memcpy(region->orb_area, orb, sizeof(ORB));

    memcpy(region->scsw_area, scsw, sizeof(SCSW));



again:

    ret = pwrite(vcdev->vdev.fd, region,

                 vcdev->io_region_size, vcdev->io_region_offset);

    if (ret != vcdev->io_region_size) {

        if (errno == EAGAIN) {

            goto again;

        }

        error_report("vfio-ccw: wirte I/O region failed with errno=%d", errno);

        return -errno;

    }



    return region->ret_code;

}

    int ret;     int ret;     int ret; static int vfio_ccw_handle_request(ORB *orb, SCSW *scsw, void *data)     S390CCWDevice *cdev = data;     memcpy(region->orb_area, orb, sizeof(ORB));     memcpy(region->scsw_area, scsw, sizeof(SCSW));         return -errno;     return region->ret_code;
static int FUNC_0(ORB *VAR_0, SCSW *VAR_1, void *VAR_2)

{

    S390CCWDevice *cdev = VAR_2;

    VFIOCCWDevice *vcdev = DO_UPCAST(VFIOCCWDevice, cdev, cdev);

    struct ccw_io_region *VAR_3 = vcdev->io_region;

    int VAR_4;



    QEMU_BUILD_BUG_ON(sizeof(VAR_3->orb_area) != sizeof(ORB));

    QEMU_BUILD_BUG_ON(sizeof(VAR_3->scsw_area) != sizeof(SCSW));

    QEMU_BUILD_BUG_ON(sizeof(VAR_3->irb_area) != sizeof(IRB));



    memset(VAR_3, 0, sizeof(*VAR_3));



    memcpy(VAR_3->orb_area, VAR_0, sizeof(ORB));

    memcpy(VAR_3->scsw_area, VAR_1, sizeof(SCSW));



again:

    VAR_4 = pwrite(vcdev->vdev.fd, VAR_3,

                 vcdev->io_region_size, vcdev->io_region_offset);

    if (VAR_4 != vcdev->io_region_size) {

        if (errno == EAGAIN) {

            goto again;

        }

        error_report("vfio-ccw: wirte I/O VAR_3 failed with errno=%d", errno);

        return -errno;

    }



    return VAR_3->ret_code;

}

static int FUNC_0(ORB *VAR_0, SCSW *VAR_1, void *VAR_2)
{ S390CCWDevice *cdev = VAR_2; VFIOCCWDevice *vcdev = DO_UPCAST(VFIOCCWDevice, cdev, cdev); struct ccw_io_region *VAR_3 = vcdev->io_region; int VAR_4; QEMU_BUILD_BUG_ON(sizeof(VAR_3->orb_area) != sizeof(ORB)); QEMU_BUILD_BUG_ON(sizeof(VAR_3->scsw_area) != sizeof(SCSW)); QEMU_BUILD_BUG_ON(sizeof(VAR_3->irb_area) != sizeof(IRB)); memset(VAR_3, 0, sizeof(*VAR_3)); memcpy(VAR_3->orb_area, VAR_0, sizeof(ORB)); memcpy(VAR_3->scsw_area, VAR_1, sizeof(SCSW)); again:
VAR_4 = pwrite(vcdev->vdev.fd, VAR_3,
vcdev->io_region_size, vcdev->io_region_offset); if (VAR_4 != vcdev->io_region_size) { if (errno == EAGAIN) { goto again; } error_report("vfio-ccw: wirte I/O VAR_3 failed with errno=%d", errno); return -errno; } return VAR_3->ret_code; }