From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>
Subject: [dpdk-dev] [PATCH 2/2] kernel/freebsd: update contigmem for FreeBSD 13
Date: Fri, 3 Jan 2020 11:52:43 +0000 [thread overview]
Message-ID: <20200103115243.59502-3-bruce.richardson@intel.com> (raw)
In-Reply-To: <20200103115243.59502-1-bruce.richardson@intel.com>
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 <bruce.richardson@intel.com>
---
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
next prev parent reply other threads:[~2020-01-03 11:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-03 11:52 [dpdk-dev] [PATCH 0/2] Fix build with FreeBSD 13-CURRENT Bruce Richardson
2020-01-03 11:52 ` [dpdk-dev] [PATCH 1/2] eal/freebsd: update CPU macro for FreeBSD 13 support Bruce Richardson
2020-01-03 11:52 ` Bruce Richardson [this message]
2020-01-20 16:47 ` [dpdk-dev] [PATCH 0/2] Fix build with FreeBSD 13-CURRENT Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200103115243.59502-3-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).