From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 11DE4A04F3; Fri, 3 Jan 2020 12:55:43 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CDB2B1D17D; Fri, 3 Jan 2020 12:55:38 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 20AFC1D179 for ; Fri, 3 Jan 2020 12:55:36 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jan 2020 03:55:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,390,1571727600"; d="scan'208";a="244882092" Received: from silpixa00383876.ir.intel.com (HELO silpixa00383876.ger.corp.intel.com) ([10.237.222.110]) by fmsmga004.fm.intel.com with ESMTP; 03 Jan 2020 03:55:36 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Date: Fri, 3 Jan 2020 11:52:43 +0000 Message-Id: <20200103115243.59502-3-bruce.richardson@intel.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200103115243.59502-1-bruce.richardson@intel.com> References: <20200103115243.59502-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 2/2] kernel/freebsd: update contigmem for FreeBSD 13 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- kernel/freebsd/contigmem/contigmem.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel/freebsd/contigmem/contigmem.c b/kernel/freebsd/contigmem/contigmem.c index 64e0a7fec..7ea0bc617 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; } -- 2.24.1