From: Bruce Richardson Date: Fri, 3 Jan 2020 11:52:43 +0000 (+0000) Subject: contigmem: update for FreeBSD 13 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=03bff90ccfd6ad347f1e50901caf47890872ca28;p=dpdk.git contigmem: update for FreeBSD 13 FreeBSD 13 has changed the definition of vm_page_replace so we need to have slightly different code paths around this function depending on the BSD version. Signed-off-by: Bruce Richardson --- diff --git a/kernel/freebsd/contigmem/contigmem.c b/kernel/freebsd/contigmem/contigmem.c index 64e0a7fecd..7ea0bc6177 100644 --- a/kernel/freebsd/contigmem/contigmem.c +++ b/kernel/freebsd/contigmem/contigmem.c @@ -297,19 +297,22 @@ contigmem_cdev_pager_fault(vm_object_t object, vm_ooffset_t offset, int prot, VM_OBJECT_WLOCK(object); vm_page_updatefake(page, paddr, memattr); } else { - vm_page_t mret; /* * Replace the passed in reqpage page with our own fake page and * free up the original page. */ page = vm_page_getfake(paddr, memattr); VM_OBJECT_WLOCK(object); - mret = vm_page_replace(page, object, (*mres)->pindex); +#if __FreeBSD__ >= 13 + vm_page_replace(page, object, (*mres)->pindex, *mres); +#else + vm_page_t mret = vm_page_replace(page, object, (*mres)->pindex); KASSERT(mret == *mres, ("invalid page replacement, old=%p, ret=%p", *mres, mret)); vm_page_lock(mret); vm_page_free(mret); vm_page_unlock(mret); +#endif *mres = page; }