summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroga <oga@openbsd.org>2010-05-20 05:46:53 +0000
committeroga <oga@openbsd.org>2010-05-20 05:46:53 +0000
commitc4b776a943e5680397f4d358a0d0d388fbb5d66c (patch)
treeb54dbaf68f49e5733752de68697c43a11a017752
parentDon't dereference cp to shut gcc4 up (the intent anyway). (diff)
downloadwireguard-openbsd-c4b776a943e5680397f4d358a0d0d388fbb5d66c.tar.xz
wireguard-openbsd-c4b776a943e5680397f4d358a0d0d388fbb5d66c.zip
Force max physical memory allocation for bus_dmamem_alloc() to be 4gig
for now. When we get bouncebuffers/decent iommu this can be revised to either fall back (bouncebuffers) or just grab any memory (iommu), but for now it is one less thing to worry about for turning bigmem back on. ok kettenis@ and beck@
-rw-r--r--sys/arch/amd64/amd64/bus_dma.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/bus_dma.c b/sys/arch/amd64/amd64/bus_dma.c
index 415664738bb..c4fca4afe72 100644
--- a/sys/arch/amd64/amd64/bus_dma.c
+++ b/sys/arch/amd64/amd64/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.31 2010/04/08 00:55:25 oga Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.32 2010/05/20 05:46:53 oga Exp $ */
/* $NetBSD: bus_dma.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $ */
/*-
@@ -418,8 +418,14 @@ _bus_dmamem_alloc(bus_dma_tag_t t, bus_size_t size, bus_size_t alignment,
int flags)
{
+ /*
+ * XXX in the presence of decent (working) iommus and bouncebuffers
+ * we can then fallback this allocation to a range of { 0, -1 }.
+ * However for now we err on the side of caution and allocate dma
+ * memory under the 4gig boundary.
+ */
return (_bus_dmamem_alloc_range(t, size, alignment, boundary,
- segs, nsegs, rsegs, flags, (paddr_t)0, (paddr_t)-1));
+ segs, nsegs, rsegs, flags, (paddr_t)0, (paddr_t)0xffffffff));
}
/*