From 77baa2256d9dc0c02436d2fb7d669f2a10e824b4 Mon Sep 17 00:00:00 2001 From: Justin Hibbits Date: Sun, 4 Feb 2018 15:37:58 +0000 Subject: [PATCH] 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 --- sys/dev/mpr/mpr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/mpr/mpr.c b/sys/dev/mpr/mpr.c index 6aff753edc7b..0cfb46d9d445 100644 --- a/sys/dev/mpr/mpr.c +++ b/sys/dev/mpr/mpr.c @@ -2763,7 +2763,7 @@ mpr_build_nvme_prp(struct mpr_softc *sc, struct mpr_command *cm, 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 mpr_command *cm, 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);