From owner-svn-src-all@freebsd.org Fri Jan 26 00:58:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46034ED962C; Fri, 26 Jan 2018 00:58:03 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8D907B1E9; Fri, 26 Jan 2018 00:58:02 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7B76149CF; Fri, 26 Jan 2018 00:58:02 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0Q0w22Z097633; Fri, 26 Jan 2018 00:58:02 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0Q0w268097631; Fri, 26 Jan 2018 00:58:02 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201801260058.w0Q0w268097631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 26 Jan 2018 00:58:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328425 - head/sys/cam/ctl X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/cam/ctl X-SVN-Commit-Revision: 328425 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jan 2018 00:58:03 -0000 Author: jhibbits Date: Fri Jan 26 00:58:02 2018 New Revision: 328425 URL: https://svnweb.freebsd.org/changeset/base/328425 Log: 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 Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c head/sys/cam/ctl/scsi_ctl.c Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_cam_sim.c Fri Jan 26 00:56:09 2018 (r328424) +++ head/sys/cam/ctl/ctl_frontend_cam_sim.c Fri Jan 26 00:58:02 2018 (r328425) @@ -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) { /* Modified: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Fri Jan 26 00:56:09 2018 (r328424) +++ head/sys/cam/ctl/scsi_ctl.c Fri Jan 26 00:58:02 2018 (r328425) @@ -728,7 +728,7 @@ ctlfedata(struct ctlfe_lun_softc *softc, union ctl_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;