summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64/dev
diff options
context:
space:
mode:
authorKurt Miller <kurt@cvs.openbsd.org>2005-06-07 20:40:02 +0000
committerKurt Miller <kurt@cvs.openbsd.org>2005-06-07 20:40:02 +0000
commit356ff6faae5bf36cdf99f863a37efe25013080f9 (patch)
treef49ea99cdcd5b5d983094ff732da3c4d8b363e72 /sys/arch/sparc64/dev
parent3cfae91f6071be87a5ff4440f8f925014a9eb82b (diff)
revert previous commit and unbreak sparc64.
okay deraadt
Diffstat (limited to 'sys/arch/sparc64/dev')
-rw-r--r--sys/arch/sparc64/dev/iommu.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/arch/sparc64/dev/iommu.c b/sys/arch/sparc64/dev/iommu.c
index d72f5246fb9..60558c52c01 100644
--- a/sys/arch/sparc64/dev/iommu.c
+++ b/sys/arch/sparc64/dev/iommu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iommu.c,v 1.37 2005/06/02 01:27:39 mickey Exp $ */
+/* $OpenBSD: iommu.c,v 1.38 2005/06/07 20:40:01 kurt Exp $ */
/* $NetBSD: iommu.c,v 1.47 2002/02/08 20:03:45 eeh Exp $ */
/*
@@ -582,7 +582,7 @@ iommu_dvmamap_create(bus_dma_tag_t t, bus_dma_tag_t t0, struct strbuf_ctl *sb,
if (ret)
return (ret);
- ims = iommu_iomap_create((size + PAGE_MASK) >> PAGE_SHIFT);
+ ims = iommu_iomap_create(nsegments);
if (ims == NULL) {
bus_dmamap_destroy(t0, map);
@@ -1696,6 +1696,9 @@ iommu_iomap_create(int n)
struct strbuf_flush *sbf;
vaddr_t va;
+ if (n < 64)
+ n = 64;
+
ims = malloc(sizeof(*ims) + (n - 1) * sizeof(ims->ims_map.ipm_map[0]),
M_DEVBUF, M_NOWAIT);
if (ims == NULL)