aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Hibbits <jhibbits@FreeBSD.org>2018-01-26 00:58:02 +0000
committerJustin Hibbits <jhibbits@FreeBSD.org>2018-01-26 00:58:02 +0000
commita99028fc70be602db425c092b70dd0221e253bb3 (patch)
tree68336802058898c5d35bebf1ad3b641f379e1e3d
parent51bd6f96189b825492d8732a50840de12fd0903a (diff)
downloadsrc-a99028fc70be602db425c092b70dd0221e253bb3.tar.gz
src-a99028fc70be602db425c092b70dd0221e253bb3.zip
Minimum changes for ctl to build on architectures with non-matching physical and
virtual address sizes Summary: Some architectures use physical addresses larger than virtual. This is the minimal changeset needed to get CAM/CTL to build on these targets. No functional changes. More changes would likely be needed for this to be fully functional on said platforms, but they can be made when needed. Reviewed By: mav, chuck Differential Revision: https://reviews.freebsd.org/D14041
Notes
Notes: svn path=/head/; revision=328425
-rw-r--r--sys/cam/ctl/ctl_frontend_cam_sim.c4
-rw-r--r--sys/cam/ctl/scsi_ctl.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/sys/cam/ctl/ctl_frontend_cam_sim.c b/sys/cam/ctl/ctl_frontend_cam_sim.c
index 71938e3db0a6..839c3b9b60c6 100644
--- a/sys/cam/ctl/ctl_frontend_cam_sim.c
+++ b/sys/cam/ctl/ctl_frontend_cam_sim.c
@@ -354,7 +354,7 @@ cfcs_datamove(union ctl_io *io)
case CAM_DATA_VADDR:
cam_sglist = &cam_sg_entry;
cam_sglist[0].ds_len = ccb->csio.dxfer_len;
- cam_sglist[0].ds_addr = (bus_addr_t)ccb->csio.data_ptr;
+ cam_sglist[0].ds_addr = (bus_addr_t)(uintptr_t)ccb->csio.data_ptr;
cam_sg_count = 1;
cam_sg_start = 0;
cam_sg_offset = io->scsiio.kern_rel_offset;
@@ -382,7 +382,7 @@ cfcs_datamove(union ctl_io *io)
len_to_copy = MIN(cam_sglist[i].ds_len - cam_watermark,
ctl_sglist[j].len - ctl_watermark);
- cam_ptr = (uint8_t *)cam_sglist[i].ds_addr;
+ cam_ptr = (uint8_t *)(uintptr_t)cam_sglist[i].ds_addr;
cam_ptr = cam_ptr + cam_watermark;
if (io->io_hdr.flags & CTL_FLAG_BUS_ADDR) {
/*
diff --git a/sys/cam/ctl/scsi_ctl.c b/sys/cam/ctl/scsi_ctl.c
index b604e2bb9563..cf8ff2fb9188 100644
--- a/sys/cam/ctl/scsi_ctl.c
+++ b/sys/cam/ctl/scsi_ctl.c
@@ -728,7 +728,7 @@ ctlfedata(struct ctlfe_lun_softc *softc, union ctl_io *io,
cam_sglist = cmd_info->cam_sglist;
*dxfer_len = 0;
for (i = 0; i < io->scsiio.kern_sg_entries - idx; i++) {
- cam_sglist[i].ds_addr = (bus_addr_t)ctl_sglist[i + idx].addr + off;
+ cam_sglist[i].ds_addr = (bus_addr_t)(uintptr_t)ctl_sglist[i + idx].addr + off;
if (ctl_sglist[i + idx].len - off <= bus_softc->maxio - *dxfer_len) {
cam_sglist[i].ds_len = ctl_sglist[idx + i].len - off;
*dxfer_len += cam_sglist[i].ds_len;