Page MenuHomeFreeBSD

D42894.diff
No OneTemporary

D42894.diff

diff --git a/sys/arm/arm/busdma_machdep.c b/sys/arm/arm/busdma_machdep.c
--- a/sys/arm/arm/busdma_machdep.c
+++ b/sys/arm/arm/busdma_machdep.c
@@ -82,8 +82,6 @@
bus_addr_t boundary;
bus_addr_t lowaddr;
bus_addr_t highaddr;
- bus_dma_filter_t *filter;
- void *filterarg;
bus_size_t maxsize;
u_int nsegments;
bus_size_t maxsegsz;
@@ -337,8 +335,7 @@
* exclusion zone of any tag in the ancestry chain.
*
* For exclusions, walk the chain of tags comparing paddr to the exclusion zone
- * within each tag. If the tag has a filter function, use it to decide whether
- * the DMA needs to bounce, otherwise any DMA within the zone bounces.
+ * within each tag.
*/
static int
must_bounce(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t paddr,
@@ -363,9 +360,7 @@
* within the low-highaddr range of the tag that filterfunc belongs to.
*/
while (dmat != NULL && exclusion_bounce(dmat)) {
- if ((paddr >= dmat->lowaddr && paddr <= dmat->highaddr) &&
- (dmat->filter == NULL ||
- dmat->filter(dmat->filterarg, paddr) != 0))
+ if (paddr >= dmat->lowaddr && paddr <= dmat->highaddr)
return (1);
dmat = dmat->parent;
}
@@ -416,8 +411,6 @@
newtag->lowaddr = trunc_page((vm_paddr_t)lowaddr) + (PAGE_SIZE - 1);
newtag->highaddr = trunc_page((vm_paddr_t)highaddr) +
(PAGE_SIZE - 1);
- newtag->filter = filter;
- newtag->filterarg = filterarg;
newtag->maxsize = maxsize;
newtag->nsegments = nsegments;
newtag->maxsegsz = maxsegsz;
@@ -444,15 +437,12 @@
else if (parent->boundary != 0)
newtag->boundary = MIN(parent->boundary,
newtag->boundary);
- if (newtag->filter == NULL) {
- /*
- * Short circuit to looking at our parent directly
- * since we have encapsulated all of its information
- */
- newtag->filter = parent->filter;
- newtag->filterarg = parent->filterarg;
- newtag->parent = parent->parent;
- }
+
+ /*
+ * Short circuit to looking at our parent directly since we
+ * have encapsulated all of its information.
+ */
+ newtag->parent = parent->parent;
if (newtag->parent != NULL)
atomic_add_int(&parent->ref_count, 1);
}
diff --git a/sys/arm64/arm64/busdma_bounce.c b/sys/arm64/arm64/busdma_bounce.c
--- a/sys/arm64/arm64/busdma_bounce.c
+++ b/sys/arm64/arm64/busdma_bounce.c
@@ -241,17 +241,16 @@
static int
bounce_bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
bus_addr_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr,
- bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize,
- int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc,
- void *lockfuncarg, bus_dma_tag_t *dmat)
+ bus_size_t maxsize, int nsegments, bus_size_t maxsegsz, int flags,
+ bus_dma_lock_t *lockfunc, void *lockfuncarg, bus_dma_tag_t *dmat)
{
bus_dma_tag_t newtag;
int error;
*dmat = NULL;
error = common_bus_dma_tag_create(parent != NULL ? &parent->common :
- NULL, alignment, boundary, lowaddr, highaddr, filter, filterarg,
- maxsize, nsegments, maxsegsz, flags, lockfunc, lockfuncarg,
+ NULL, alignment, boundary, lowaddr, highaddr, maxsize, nsegments,
+ maxsegsz, flags, lockfunc, lockfuncarg,
sizeof (struct bus_dma_tag), (void **)&newtag);
if (error != 0)
return (error);
@@ -265,8 +264,7 @@
}
if (parent != NULL) {
- if ((newtag->common.filter != NULL ||
- (parent->bounce_flags & BF_COULD_BOUNCE) != 0))
+ if ((parent->bounce_flags & BF_COULD_BOUNCE) != 0)
newtag->bounce_flags |= BF_COULD_BOUNCE;
/* Copy some flags from the parent */
diff --git a/sys/arm64/arm64/busdma_machdep.c b/sys/arm64/arm64/busdma_machdep.c
--- a/sys/arm64/arm64/busdma_machdep.c
+++ b/sys/arm64/arm64/busdma_machdep.c
@@ -62,12 +62,10 @@
{
while (tc != NULL) {
- if ((paddr > tc->lowaddr && paddr <= tc->highaddr) &&
- (tc->filter == NULL ||
- (*tc->filter)(tc->filterarg, paddr) != 0))
+ if (paddr > tc->lowaddr && paddr <= tc->highaddr)
return (1);
- tc = tc->parent;
+ tc = tc->parent;
}
return (0);
@@ -76,9 +74,9 @@
int
common_bus_dma_tag_create(struct bus_dma_tag_common *parent,
bus_size_t alignment, bus_addr_t boundary, bus_addr_t lowaddr,
- bus_addr_t highaddr, bus_dma_filter_t *filter, void *filterarg,
- bus_size_t maxsize, int nsegments, bus_size_t maxsegsz, int flags,
- bus_dma_lock_t *lockfunc, void *lockfuncarg, size_t sz, void **dmat)
+ bus_addr_t highaddr, bus_size_t maxsize, int nsegments,
+ bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc,
+ void *lockfuncarg, size_t sz, void **dmat)
{
void *newtag;
struct bus_dma_tag_common *common;
@@ -106,8 +104,6 @@
common->boundary = boundary;
common->lowaddr = trunc_page((vm_paddr_t)lowaddr) + (PAGE_SIZE - 1);
common->highaddr = trunc_page((vm_paddr_t)highaddr) + (PAGE_SIZE - 1);
- common->filter = filter;
- common->filterarg = filterarg;
common->maxsize = maxsize;
common->nsegments = nsegments;
common->maxsegsz = maxsegsz;
@@ -133,15 +129,12 @@
common->boundary = MIN(parent->boundary,
common->boundary);
}
- if (common->filter == NULL) {
- /*
- * Short circuit looking at our parent directly
- * since we have encapsulated all of its information
- */
- common->filter = parent->filter;
- common->filterarg = parent->filterarg;
- common->parent = parent->parent;
- }
+
+ /*
+ * Short circuit looking at our parent directly since we have
+ * encapsulated all of its information.
+ */
+ common->parent = parent->parent;
common->domain = parent->domain;
atomic_add_int(&parent->ref_count, 1);
}
@@ -170,13 +163,13 @@
if (parent == NULL) {
error = bus_dma_bounce_impl.tag_create(parent, alignment,
- boundary, lowaddr, highaddr, filter, filterarg, maxsize,
- nsegments, maxsegsz, flags, lockfunc, lockfuncarg, dmat);
+ boundary, lowaddr, highaddr, maxsize, nsegments, maxsegsz,
+ flags, lockfunc, lockfuncarg, dmat);
} else {
tc = (struct bus_dma_tag_common *)parent;
error = tc->impl->tag_create(parent, alignment,
- boundary, lowaddr, highaddr, filter, filterarg, maxsize,
- nsegments, maxsegsz, flags, lockfunc, lockfuncarg, dmat);
+ boundary, lowaddr, highaddr, maxsize, nsegments, maxsegsz,
+ flags, lockfunc, lockfuncarg, dmat);
}
return (error);
}
diff --git a/sys/arm64/include/bus_dma_impl.h b/sys/arm64/include/bus_dma_impl.h
--- a/sys/arm64/include/bus_dma_impl.h
+++ b/sys/arm64/include/bus_dma_impl.h
@@ -36,8 +36,6 @@
bus_addr_t boundary;
bus_addr_t lowaddr;
bus_addr_t highaddr;
- bus_dma_filter_t *filter;
- void *filterarg;
bus_size_t maxsize;
u_int nsegments;
bus_size_t maxsegsz;
@@ -51,8 +49,7 @@
struct bus_dma_impl {
int (*tag_create)(bus_dma_tag_t parent,
bus_size_t alignment, bus_addr_t boundary, bus_addr_t lowaddr,
- bus_addr_t highaddr, bus_dma_filter_t *filter,
- void *filterarg, bus_size_t maxsize, int nsegments,
+ bus_addr_t highaddr, bus_size_t maxsize, int nsegments,
bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc,
void *lockfuncarg, bus_dma_tag_t *dmat);
int (*tag_destroy)(bus_dma_tag_t dmat);
@@ -84,10 +81,9 @@
int bus_dma_run_filter(struct bus_dma_tag_common *dmat, bus_addr_t paddr);
int common_bus_dma_tag_create(struct bus_dma_tag_common *parent,
- bus_size_t alignment,
- bus_addr_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr,
- bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize,
- int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc,
+ bus_size_t alignment, bus_addr_t boundary, bus_addr_t lowaddr,
+ bus_addr_t highaddr, bus_size_t maxsize, int nsegments,
+ bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc,
void *lockfuncarg, size_t sz, void **dmat);
extern struct bus_dma_impl bus_dma_bounce_impl;
diff --git a/sys/dev/iommu/busdma_iommu.c b/sys/dev/iommu/busdma_iommu.c
--- a/sys/dev/iommu/busdma_iommu.c
+++ b/sys/dev/iommu/busdma_iommu.c
@@ -356,9 +356,8 @@
static int
iommu_bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
bus_addr_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr,
- bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize,
- int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc,
- void *lockfuncarg, bus_dma_tag_t *dmat)
+ bus_size_t maxsize, int nsegments, bus_size_t maxsegsz, int flags,
+ bus_dma_lock_t *lockfunc, void *lockfuncarg, bus_dma_tag_t *dmat)
{
struct bus_dma_tag_iommu *newtag, *oldtag;
int error;
@@ -366,9 +365,9 @@
*dmat = NULL;
error = common_bus_dma_tag_create(parent != NULL ?
&((struct bus_dma_tag_iommu *)parent)->common : NULL, alignment,
- boundary, lowaddr, highaddr, filter, filterarg, maxsize,
- nsegments, maxsegsz, flags, lockfunc, lockfuncarg,
- sizeof(struct bus_dma_tag_iommu), (void **)&newtag);
+ boundary, lowaddr, highaddr, maxsize, nsegments, maxsegsz, flags,
+ lockfunc, lockfuncarg, sizeof(struct bus_dma_tag_iommu),
+ (void **)&newtag);
if (error != 0)
goto out;
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
@@ -68,8 +68,6 @@
bus_addr_t boundary;
bus_addr_t lowaddr;
bus_addr_t highaddr;
- bus_dma_filter_t *filter;
- void *filterarg;
bus_size_t maxsize;
bus_size_t maxsegsz;
u_int nsegments;
@@ -129,14 +127,10 @@
retval = 0;
do {
- if (dmat->filter == NULL && dmat->iommu == NULL &&
+ if (dmat->iommu == NULL &&
paddr > dmat->lowaddr && paddr <= dmat->highaddr)
retval = 1;
- if (dmat->filter == NULL &&
- !vm_addr_align_ok(paddr, dmat->alignment))
- retval = 1;
- if (dmat->filter != NULL &&
- (*dmat->filter)(dmat->filterarg, paddr) != 0)
+ if (!vm_addr_align_ok(paddr, dmat->alignment))
retval = 1;
dmat = dmat->parent;
@@ -188,8 +182,6 @@
newtag->boundary = boundary;
newtag->lowaddr = trunc_page((vm_paddr_t)lowaddr) + (PAGE_SIZE - 1);
newtag->highaddr = trunc_page((vm_paddr_t)highaddr) + (PAGE_SIZE - 1);
- newtag->filter = filter;
- newtag->filterarg = filterarg;
newtag->maxsize = maxsize;
newtag->nsegments = nsegments;
newtag->maxsegsz = maxsegsz;
@@ -213,15 +205,12 @@
else if (parent->boundary != 0)
newtag->boundary = MIN(parent->boundary,
newtag->boundary);
- if (newtag->filter == NULL) {
- /*
- * Short circuit looking at our parent directly
- * since we have encapsulated all of its information
- */
- newtag->filter = parent->filter;
- newtag->filterarg = parent->filterarg;
- newtag->parent = parent->parent;
- }
+
+ /*
+ * Short circuit looking at our parent directly since we have
+ * encapsulated all of its information.
+ */
+ newtag->parent = parent->parent;
if (newtag->parent != NULL)
atomic_add_int(&parent->ref_count, 1);
newtag->iommu = parent->iommu;
diff --git a/sys/riscv/include/bus_dma_impl.h b/sys/riscv/include/bus_dma_impl.h
--- a/sys/riscv/include/bus_dma_impl.h
+++ b/sys/riscv/include/bus_dma_impl.h
@@ -36,8 +36,6 @@
bus_addr_t boundary;
bus_addr_t lowaddr;
bus_addr_t highaddr;
- bus_dma_filter_t *filter;
- void *filterarg;
bus_size_t maxsize;
u_int nsegments;
bus_size_t maxsegsz;
@@ -50,8 +48,7 @@
struct bus_dma_impl {
int (*tag_create)(bus_dma_tag_t parent,
bus_size_t alignment, bus_addr_t boundary, bus_addr_t lowaddr,
- bus_addr_t highaddr, bus_dma_filter_t *filter,
- void *filterarg, bus_size_t maxsize, int nsegments,
+ bus_addr_t highaddr, bus_size_t maxsize, int nsegments,
bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc,
void *lockfuncarg, bus_dma_tag_t *dmat);
int (*tag_destroy)(bus_dma_tag_t dmat);
@@ -83,9 +80,8 @@
int common_bus_dma_tag_create(struct bus_dma_tag_common *parent,
bus_size_t alignment,
bus_addr_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr,
- bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize,
- int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc,
- void *lockfuncarg, size_t sz, void **dmat);
+ bus_size_t maxsize, int nsegments, bus_size_t maxsegsz, int flags,
+ bus_dma_lock_t *lockfunc, void *lockfuncarg, size_t sz, void **dmat);
extern struct bus_dma_impl bus_dma_bounce_impl;
diff --git a/sys/riscv/riscv/busdma_bounce.c b/sys/riscv/riscv/busdma_bounce.c
--- a/sys/riscv/riscv/busdma_bounce.c
+++ b/sys/riscv/riscv/busdma_bounce.c
@@ -125,17 +125,16 @@
static int
bounce_bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
bus_addr_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr,
- bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize,
- int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc,
- void *lockfuncarg, bus_dma_tag_t *dmat)
+ bus_size_t maxsize, int nsegments, bus_size_t maxsegsz, int flags,
+ bus_dma_lock_t *lockfunc, void *lockfuncarg, bus_dma_tag_t *dmat)
{
bus_dma_tag_t newtag;
int error;
*dmat = NULL;
error = common_bus_dma_tag_create(parent != NULL ? &parent->common :
- NULL, alignment, boundary, lowaddr, highaddr, filter, filterarg,
- maxsize, nsegments, maxsegsz, flags, lockfunc, lockfuncarg,
+ NULL, alignment, boundary, lowaddr, highaddr, maxsize, nsegments,
+ maxsegsz, flags, lockfunc, lockfuncarg,
sizeof (struct bus_dma_tag), (void **)&newtag);
if (error != 0)
return (error);
@@ -148,8 +147,7 @@
newtag->bounce_flags |= BF_COHERENT;
if (parent != NULL) {
- if ((newtag->common.filter != NULL ||
- (parent->bounce_flags & BF_COULD_BOUNCE) != 0))
+ if ((parent->bounce_flags & BF_COULD_BOUNCE) != 0)
newtag->bounce_flags |= BF_COULD_BOUNCE;
/* Copy some flags from the parent */
diff --git a/sys/riscv/riscv/busdma_machdep.c b/sys/riscv/riscv/busdma_machdep.c
--- a/sys/riscv/riscv/busdma_machdep.c
+++ b/sys/riscv/riscv/busdma_machdep.c
@@ -63,10 +63,8 @@
retval = 0;
do {
- if (((paddr > tc->lowaddr && paddr <= tc->highaddr) ||
- !vm_addr_align_ok(paddr, tc->alignment)) &&
- (tc->filter == NULL ||
- (*tc->filter)(tc->filterarg, paddr) != 0))
+ if ((paddr > tc->lowaddr && paddr <= tc->highaddr) ||
+ !vm_addr_align_ok(paddr, tc->alignment))
retval = 1;
tc = tc->parent;
@@ -77,9 +75,9 @@
int
common_bus_dma_tag_create(struct bus_dma_tag_common *parent,
bus_size_t alignment, bus_addr_t boundary, bus_addr_t lowaddr,
- bus_addr_t highaddr, bus_dma_filter_t *filter, void *filterarg,
- bus_size_t maxsize, int nsegments, bus_size_t maxsegsz, int flags,
- bus_dma_lock_t *lockfunc, void *lockfuncarg, size_t sz, void **dmat)
+ bus_addr_t highaddr, bus_size_t maxsize, int nsegments,
+ bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc,
+ void *lockfuncarg, size_t sz, void **dmat)
{
void *newtag;
struct bus_dma_tag_common *common;
@@ -107,8 +105,6 @@
common->boundary = boundary;
common->lowaddr = trunc_page((vm_paddr_t)lowaddr) + (PAGE_SIZE - 1);
common->highaddr = trunc_page((vm_paddr_t)highaddr) + (PAGE_SIZE - 1);
- common->filter = filter;
- common->filterarg = filterarg;
common->maxsize = maxsize;
common->nsegments = nsegments;
common->maxsegsz = maxsegsz;
@@ -133,15 +129,12 @@
common->boundary = MIN(parent->boundary,
common->boundary);
}
- if (common->filter == NULL) {
- /*
- * Short circuit looking at our parent directly
- * since we have encapsulated all of its information
- */
- common->filter = parent->filter;
- common->filterarg = parent->filterarg;
- common->parent = parent->parent;
- }
+
+ /*
+ * Short circuit looking at our parent directly since we have
+ * encapsulated all of its information.
+ */
+ common->parent = parent->parent;
atomic_add_int(&parent->ref_count, 1);
}
*dmat = common;
@@ -167,13 +160,13 @@
if (parent == NULL) {
error = bus_dma_bounce_impl.tag_create(parent, alignment,
- boundary, lowaddr, highaddr, filter, filterarg, maxsize,
- nsegments, maxsegsz, flags, lockfunc, lockfuncarg, dmat);
+ boundary, lowaddr, highaddr, maxsize, nsegments, maxsegsz,
+ flags, lockfunc, lockfuncarg, dmat);
} else {
tc = (struct bus_dma_tag_common *)parent;
error = tc->impl->tag_create(parent, alignment,
- boundary, lowaddr, highaddr, filter, filterarg, maxsize,
- nsegments, maxsegsz, flags, lockfunc, lockfuncarg, dmat);
+ boundary, lowaddr, highaddr, maxsize, nsegments, maxsegsz,
+ flags, lockfunc, lockfuncarg, dmat);
}
return (error);
}
diff --git a/sys/sys/bus_dma.h b/sys/sys/bus_dma.h
--- a/sys/sys/bus_dma.h
+++ b/sys/sys/bus_dma.h
@@ -161,11 +161,8 @@
* boundary: Boundary that segments cannot cross.
* lowaddr: Low restricted address that cannot appear in a mapping.
* highaddr: High restricted address that cannot appear in a mapping.
- * filtfunc: An optional function to further test if an address
- * within the range of lowaddr and highaddr cannot appear
- * in a mapping.
- * filtfuncarg: An argument that will be passed to filtfunc in addition
- * to the address to test.
+ * filtfunc: (deprecated, must be NULL)
+ * filtfuncarg: (deprecated, must be NULL)
* maxsize: Maximum mapping size supported by this tag.
* nsegments: Number of discontinuities allowed in maps.
* maxsegsz: Maximum size of a segment in the map.
diff --git a/sys/x86/include/busdma_impl.h b/sys/x86/include/busdma_impl.h
--- a/sys/x86/include/busdma_impl.h
+++ b/sys/x86/include/busdma_impl.h
@@ -38,8 +38,6 @@
bus_addr_t boundary;
bus_addr_t lowaddr;
bus_addr_t highaddr;
- bus_dma_filter_t *filter;
- void *filterarg;
bus_size_t maxsize;
u_int nsegments;
bus_size_t maxsegsz;
@@ -53,8 +51,7 @@
struct bus_dma_impl {
int (*tag_create)(bus_dma_tag_t parent,
bus_size_t alignment, bus_addr_t boundary, bus_addr_t lowaddr,
- bus_addr_t highaddr, bus_dma_filter_t *filter,
- void *filterarg, bus_size_t maxsize, int nsegments,
+ bus_addr_t highaddr, bus_size_t maxsize, int nsegments,
bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc,
void *lockfuncarg, bus_dma_tag_t *dmat);
int (*tag_destroy)(bus_dma_tag_t dmat);
@@ -91,9 +88,8 @@
int common_bus_dma_tag_create(struct bus_dma_tag_common *parent,
bus_size_t alignment,
bus_addr_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr,
- bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize,
- int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc,
- void *lockfuncarg, size_t sz, void **dmat);
+ bus_size_t maxsize, int nsegments, bus_size_t maxsegsz, int flags,
+ bus_dma_lock_t *lockfunc, void *lockfuncarg, size_t sz, void **dmat);
extern struct bus_dma_impl bus_dma_bounce_impl;
diff --git a/sys/x86/x86/busdma_bounce.c b/sys/x86/x86/busdma_bounce.c
--- a/sys/x86/x86/busdma_bounce.c
+++ b/sys/x86/x86/busdma_bounce.c
@@ -148,18 +148,17 @@
static int
bounce_bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
bus_addr_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr,
- bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize,
- int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc,
- void *lockfuncarg, bus_dma_tag_t *dmat)
+ bus_size_t maxsize, int nsegments, bus_size_t maxsegsz, int flags,
+ bus_dma_lock_t *lockfunc, void *lockfuncarg, bus_dma_tag_t *dmat)
{
bus_dma_tag_t newtag;
int error;
*dmat = NULL;
error = common_bus_dma_tag_create(parent != NULL ? &parent->common :
- NULL, alignment, boundary, lowaddr, highaddr, filter, filterarg,
- maxsize, nsegments, maxsegsz, flags, lockfunc, lockfuncarg,
- sizeof (struct bus_dma_tag), (void **)&newtag);
+ NULL, alignment, boundary, lowaddr, highaddr, maxsize, nsegments,
+ maxsegsz, flags, lockfunc, lockfuncarg, sizeof(struct bus_dma_tag),
+ (void **)&newtag);
if (error != 0)
return (error);
@@ -175,8 +174,8 @@
newtag->bounce_flags |= BUS_DMA_FORCE_MAP;
#endif
- if (parent != NULL && (newtag->common.filter != NULL ||
- (parent->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0))
+ if (parent != NULL &&
+ (parent->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0)
newtag->bounce_flags |= BUS_DMA_COULD_BOUNCE;
if (newtag->common.lowaddr < ptoa((vm_paddr_t)Maxmem) ||
diff --git a/sys/x86/x86/busdma_machdep.c b/sys/x86/x86/busdma_machdep.c
--- a/sys/x86/x86/busdma_machdep.c
+++ b/sys/x86/x86/busdma_machdep.c
@@ -68,14 +68,12 @@
retval = 0;
do {
- if ((paddr >= BUS_SPACE_MAXADDR ||
+ if (paddr >= BUS_SPACE_MAXADDR ||
(paddr > tc->lowaddr && paddr <= tc->highaddr) ||
- !vm_addr_align_ok(paddr, tc->alignment)) &&
- (tc->filter == NULL ||
- (*tc->filter)(tc->filterarg, paddr) != 0))
+ !vm_addr_align_ok(paddr, tc->alignment))
retval = 1;
- tc = tc->parent;
+ tc = tc->parent;
} while (retval == 0 && tc != NULL);
return (retval);
}
@@ -83,9 +81,9 @@
int
common_bus_dma_tag_create(struct bus_dma_tag_common *parent,
bus_size_t alignment, bus_addr_t boundary, bus_addr_t lowaddr,
- bus_addr_t highaddr, bus_dma_filter_t *filter, void *filterarg,
- bus_size_t maxsize, int nsegments, bus_size_t maxsegsz, int flags,
- bus_dma_lock_t *lockfunc, void *lockfuncarg, size_t sz, void **dmat)
+ bus_addr_t highaddr, bus_size_t maxsize, int nsegments, bus_size_t maxsegsz,
+ int flags, bus_dma_lock_t *lockfunc, void *lockfuncarg, size_t sz,
+ void **dmat)
{
void *newtag;
struct bus_dma_tag_common *common;
@@ -113,8 +111,6 @@
common->boundary = boundary;
common->lowaddr = trunc_page((vm_paddr_t)lowaddr) + (PAGE_SIZE - 1);
common->highaddr = trunc_page((vm_paddr_t)highaddr) + (PAGE_SIZE - 1);
- common->filter = filter;
- common->filterarg = filterarg;
common->maxsize = maxsize;
common->nsegments = nsegments;
common->maxsegsz = maxsegsz;
@@ -139,15 +135,12 @@
common->boundary = MIN(parent->boundary,
common->boundary);
}
- if (common->filter == NULL) {
- /*
- * Short circuit looking at our parent directly
- * since we have encapsulated all of its information
- */
- common->filter = parent->filter;
- common->filterarg = parent->filterarg;
- common->parent = parent->parent;
- }
+
+ /*
+ * Short circuit looking at our parent directly since we have
+ * encapsulated all of its information.
+ */
+ common->parent = parent->parent;
common->domain = parent->domain;
atomic_add_int(&parent->ref_count, 1);
}
@@ -190,13 +183,13 @@
if (parent == NULL) {
error = bus_dma_bounce_impl.tag_create(parent, alignment,
- boundary, lowaddr, highaddr, filter, filterarg, maxsize,
- nsegments, maxsegsz, flags, lockfunc, lockfuncarg, dmat);
+ boundary, lowaddr, highaddr, maxsize, nsegments, maxsegsz,
+ flags, lockfunc, lockfuncarg, dmat);
} else {
tc = (struct bus_dma_tag_common *)parent;
error = tc->impl->tag_create(parent, alignment,
- boundary, lowaddr, highaddr, filter, filterarg, maxsize,
- nsegments, maxsegsz, flags, lockfunc, lockfuncarg, dmat);
+ boundary, lowaddr, highaddr, maxsize, nsegments, maxsegsz,
+ flags, lockfunc, lockfuncarg, dmat);
}
return (error);
}

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 5:49 AM (21 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14690581
Default Alt Text
D42894.diff (22 KB)

Event Timeline