summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2005-05-27 23:48:25 +0000
committerJason Wright <jason@cvs.openbsd.org>2005-05-27 23:48:25 +0000
commit022be2461175f0833c9da0d878d41f2d60a6d21e (patch)
tree2f8a89bb8acb092fb023fcbda0945c702beb3504 /sys/arch
parent1de243e7059839cc216d5dc05198313a7b7f018f (diff)
oops, need to get the boundary from the map when allocating gart addresses
(fixes borked pciide chipsets)
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/amd64/pci/iommu.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/arch/amd64/pci/iommu.c b/sys/arch/amd64/pci/iommu.c
index abc066d9328..bd941976ea8 100644
--- a/sys/arch/amd64/pci/iommu.c
+++ b/sys/arch/amd64/pci/iommu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iommu.c,v 1.7 2005/05/27 21:44:54 art Exp $ */
+/* $OpenBSD: iommu.c,v 1.8 2005/05/27 23:48:24 jason Exp $ */
/*
* Copyright (c) 2005 Jason L. Wright (jason@thought.net)
@@ -129,7 +129,8 @@ void amdgart_invalidate(void);
void amdgart_probe(struct pcibus_attach_args *);
int amdgart_initpte(pci_chipset_tag_t, pcitag_t, paddr_t, psize_t, psize_t);
void amdgart_dumpregs(void);
-int amdgart_iommu_map(struct extent *, paddr_t, paddr_t *, psize_t);
+int amdgart_iommu_map(bus_dmamap_t, struct extent *, paddr_t,
+ paddr_t *, psize_t);
int amdgart_iommu_unmap(struct extent *, paddr_t, psize_t);
int amdgart_reload(struct extent *, bus_dmamap_t);
int amdgart_ok(pci_chipset_tag_t, pcitag_t);
@@ -408,7 +409,7 @@ amdgart_reload(struct extent *ex, bus_dmamap_t dmam)
opa = dmam->dm_segs[i].ds_addr;
len = dmam->dm_segs[i].ds_len;
- err = amdgart_iommu_map(ex, opa, &npa, len);
+ err = amdgart_iommu_map(dmam, ex, opa, &npa, len);
if (err) {
for (j = 0; j < i - 1; j++)
amdgart_iommu_unmap(ex, opa, len);
@@ -420,7 +421,8 @@ amdgart_reload(struct extent *ex, bus_dmamap_t dmam)
}
int
-amdgart_iommu_map(struct extent *ex, paddr_t opa, paddr_t *npa, psize_t len)
+amdgart_iommu_map(bus_dmamap_t dmam, struct extent *ex, paddr_t opa,
+ paddr_t *npa, psize_t len)
{
paddr_t base, end, idx;
psize_t alen;
@@ -431,7 +433,7 @@ amdgart_iommu_map(struct extent *ex, paddr_t opa, paddr_t *npa, psize_t len)
base = trunc_page(opa);
end = roundup(opa + len, PAGE_SIZE);
alen = end - base;
- err = extent_alloc(ex, alen, PAGE_SIZE, 0, EX_NOBOUNDARY,
+ err = extent_alloc(ex, alen, PAGE_SIZE, 0, dmam->_dm_boundary,
EX_NOWAIT, &res);
if (err) {
printf("GART: extent_alloc %d\n", err);