Page MenuHomeFreeBSD

D55315.diff
No OneTemporary

D55315.diff

diff --git a/sys/powerpc/include/bus_dma_impl.h b/sys/powerpc/include/bus_dma_impl.h
--- a/sys/powerpc/include/bus_dma_impl.h
+++ b/sys/powerpc/include/bus_dma_impl.h
@@ -42,6 +42,7 @@
int flags;
bus_dma_lock_t *lockfunc;
void *lockfuncarg;
+ int domain;
};
struct bus_dma_impl {
diff --git a/sys/powerpc/powerpc/busdma_bounce.c b/sys/powerpc/powerpc/busdma_bounce.c
--- a/sys/powerpc/powerpc/busdma_bounce.c
+++ b/sys/powerpc/powerpc/busdma_bounce.c
@@ -34,6 +34,7 @@
#include <sys/systm.h>
#include <sys/malloc.h>
#include <sys/bus.h>
+#include <sys/domainset.h>
#include <sys/interrupt.h>
#include <sys/kernel.h>
#include <sys/ktr.h>
@@ -49,6 +50,7 @@
#include <vm/vm_kern.h>
#include <vm/vm_page.h>
#include <vm/vm_map.h>
+#include <vm/vm_phys.h>
#include <machine/atomic.h>
#include <machine/bus.h>
@@ -80,6 +82,7 @@
/* XXX TODO: bounce flags? */
#define dmat_bounce_flags(dmat) (0)
#define dmat_boundary(dmat) ((dmat)->common.boundary)
+#define dmat_domain(dmat) ((dmat)->common.domain)
#define dmat_flags(dmat) ((dmat)->common.flags)
#define dmat_highaddr(dmat) ((dmat)->common.highaddr)
#define dmat_lowaddr(dmat) ((dmat)->common.lowaddr)
@@ -219,6 +222,8 @@
newtag->iommu = parent->iommu;
newtag->iommu_cookie = parent->iommu_cookie;
+ newtag->common.domain = vm_phys_domain_match(newtag->common.domain, 0ul,
+ newtag->common.lowaddr);
}
if (newtag->common.lowaddr < ptoa((vm_paddr_t)Maxmem) && newtag->iommu == NULL)
diff --git a/sys/powerpc/powerpc/busdma_machdep.c b/sys/powerpc/powerpc/busdma_machdep.c
--- a/sys/powerpc/powerpc/busdma_machdep.c
+++ b/sys/powerpc/powerpc/busdma_machdep.c
@@ -49,6 +49,7 @@
#include <vm/vm_kern.h>
#include <vm/vm_page.h>
#include <vm/vm_map.h>
+#include <vm/vm_phys.h>
#include <machine/atomic.h>
#include <machine/bus.h>
@@ -129,7 +130,10 @@
struct bus_dma_tag_common *tc;
tc = (struct bus_dma_tag_common *)dmat;
-
+ domain = vm_phys_domain_match(domain, 0ul, tc->lowaddr);
+ /* Only call the callback if it changes. */
+ if (domain == tc->domain)
+ return (0);
+ tc->domain = domain;
return (tc->impl->tag_set_domain(dmat, domain));
}
-

File Metadata

Mime Type
text/plain
Expires
Tue, Feb 24, 1:43 PM (3 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28971144
Default Alt Text
D55315.diff (2 KB)

Event Timeline