Lines Matching full:region
72 struct ccw_io_region *region = vcdev->io_region; in vfio_ccw_handle_request() local
81 QEMU_BUILD_BUG_ON(sizeof(region->orb_area) != sizeof(ORB)); in vfio_ccw_handle_request()
82 QEMU_BUILD_BUG_ON(sizeof(region->scsw_area) != sizeof(SCSW)); in vfio_ccw_handle_request()
83 QEMU_BUILD_BUG_ON(sizeof(region->irb_area) != sizeof(IRB)); in vfio_ccw_handle_request()
85 memset(region, 0, sizeof(*region)); in vfio_ccw_handle_request()
87 memcpy(region->orb_area, &sch->orb, sizeof(ORB)); in vfio_ccw_handle_request()
88 memcpy(region->scsw_area, &sch->curr_status.scsw, sizeof(SCSW)); in vfio_ccw_handle_request()
91 ret = pwrite(vcdev->vdev.fd, region, in vfio_ccw_handle_request()
97 error_report("vfio-ccw: write I/O region failed with errno=%d", errno); in vfio_ccw_handle_request()
122 struct ccw_schib_region *region = vcdev->schib_region; in vfio_ccw_handle_store() local
126 /* schib region not available so nothing else to do */ in vfio_ccw_handle_store()
127 if (!region) { in vfio_ccw_handle_store()
131 memset(region, 0, sizeof(*region)); in vfio_ccw_handle_store()
132 ret = pread(vcdev->vdev.fd, region, vcdev->schib_region_size, in vfio_ccw_handle_store()
141 error_report("vfio-ccw: store region read failed with errno=%d", errno); in vfio_ccw_handle_store()
149 s = (SCHIB *)region->schib_area; in vfio_ccw_handle_store()
165 struct ccw_cmd_region *region = vcdev->async_cmd_region; in vfio_ccw_handle_clear() local
169 /* Async command region not available, fall back to emulation */ in vfio_ccw_handle_clear()
173 memset(region, 0, sizeof(*region)); in vfio_ccw_handle_clear()
174 region->command = VFIO_CCW_ASYNC_CMD_CSCH; in vfio_ccw_handle_clear()
177 ret = pwrite(vcdev->vdev.fd, region, in vfio_ccw_handle_clear()
183 error_report("vfio-ccw: write cmd region failed with errno=%d", errno); in vfio_ccw_handle_clear()
204 struct ccw_cmd_region *region = vcdev->async_cmd_region; in vfio_ccw_handle_halt() local
208 /* Async command region not available, fall back to emulation */ in vfio_ccw_handle_halt()
212 memset(region, 0, sizeof(*region)); in vfio_ccw_handle_halt()
213 region->command = VFIO_CCW_ASYNC_CMD_HSCH; in vfio_ccw_handle_halt()
216 ret = pwrite(vcdev->vdev.fd, region, in vfio_ccw_handle_halt()
222 error_report("vfio-ccw: write cmd region failed with errno=%d", errno); in vfio_ccw_handle_halt()
250 struct ccw_crw_region *region = vcdev->crw_region; in vfio_ccw_crw_read() local
256 memset(region, 0, sizeof(*region)); in vfio_ccw_crw_read()
257 size = pread(vcdev->vdev.fd, region, vcdev->crw_region_size, in vfio_ccw_crw_read()
261 error_report("vfio-ccw: Read crw region failed with errno=%d", in vfio_ccw_crw_read()
266 if (region->crw == 0) { in vfio_ccw_crw_read()
271 memcpy(&crw, ®ion->crw, sizeof(CRW)); in vfio_ccw_crw_read()
304 struct ccw_io_region *region = vcdev->io_region; in vfio_ccw_io_notifier_handler() local
317 size = pread(vcdev->vdev.fd, region, vcdev->io_region_size, in vfio_ccw_io_notifier_handler()
354 memcpy(&irb, region->irb_area, sizeof(IRB)); in vfio_ccw_io_notifier_handler()
484 * We always expect at least the I/O region to be present. We also in vfio_ccw_get_region()
501 error_setg(errp, "vfio: Unexpected size of the I/O region"); in vfio_ccw_get_region()
508 /* check for the optional async command region */ in vfio_ccw_get_region()
514 error_setg(errp, "vfio: Unexpected size of the async cmd region"); in vfio_ccw_get_region()
526 error_setg(errp, "vfio: Unexpected size of the schib region"); in vfio_ccw_get_region()
539 error_setg(errp, "vfio: Unexpected size of the CRW region"); in vfio_ccw_get_region()