svn commit: r328850 - head/sys/dev/mpr

Justin Hibbits jhibbits at FreeBSD.org
Sun Feb 4 15:37:59 UTC 2018


Author: jhibbits
Date: Sun Feb  4 15:37:58 2018
New Revision: 328850
URL: https://svnweb.freebsd.org/changeset/base/328850

Log:
  Minimal changes for MPR to build on architectures with physical addresses larger than virtual
  
  Summary:
  Some architectures use large (36-bit) physical addresses, with smaller
  virtual addresses.  Casting between vm_paddr_t (or bus_addr_t) and void * is
  considered illegal, so cast through uintptr_t.  No functional change on existing
  platforms.
  
  Reviewed By:	scottl
  Differential Revision:	https://reviews.freebsd.org/D14042

Modified:
  head/sys/dev/mpr/mpr.c

Modified: head/sys/dev/mpr/mpr.c
==============================================================================
--- head/sys/dev/mpr/mpr.c	Sun Feb  4 14:49:55 2018	(r328849)
+++ head/sys/dev/mpr/mpr.c	Sun Feb  4 15:37:58 2018	(r328850)
@@ -2763,7 +2763,7 @@ mpr_build_nvme_prp(struct mpr_softc *sc, struct mpr_co
 	prp_entry_phys = prp_page_phys;
 
 	/* Get physical address and length of the data buffer. */
-	paddr = (bus_addr_t)data;
+	paddr = (bus_addr_t)(uintptr_t)data;
 	if (data_in_sz)
 		length = data_in_sz;
 	else
@@ -2947,7 +2947,7 @@ mpr_check_pcie_native_sgl(struct mpr_softc *sc, struct
 		else if ((buff_len > (PAGE_SIZE * 4)) &&
 		    (buff_len <= (PAGE_SIZE * 5)) )
 		{
-			msg_phys = (uint64_t *)segs[0].ds_addr;
+			msg_phys = (uint64_t *)(uintptr_t)segs[0].ds_addr;
 			first_page_offset =
 			    ((uint32_t)(uint64_t)(uintptr_t)msg_phys &
 			    page_mask);


More information about the svn-src-all mailing list