Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102724187
D42852.id130862.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D42852.id130862.diff
View Options
diff --git a/share/man/man9/bus_dma.9 b/share/man/man9/bus_dma.9
--- a/share/man/man9/bus_dma.9
+++ b/share/man/man9/bus_dma.9
@@ -373,7 +373,7 @@
The filter function should return zero if any mapping in this range
can be accommodated by the device and non-zero otherwise.
.Pp
-.Em Note: The use of filters is deprecated. Proper operation is not guaranteed.
+.Em Note: The use of filters is no longer supported and will result in an error.
.It Vt bus_dma_segment_t
A machine-dependent type that describes individual
DMA segments.
@@ -611,26 +611,10 @@
is used to bounce requests that would otherwise conflict with
the exclusion window.
.It Fa filtfunc
-Optional filter function (may be
-.Dv NULL )
-to be called for any attempt to
-map memory into the window described by
-.Fa lowaddr
-and
-.Fa highaddr .
-A filter function is only required when the single window described
-by
-.Fa lowaddr
-and
-.Fa highaddr
-cannot adequately describe the constraints of the device.
-The filter function will be called for every machine page
-that overlaps the exclusion window.
-.Pp
-.Em Note: The use of filters is deprecated. Proper operation is not guaranteed.
+Formerly the optional filter function; must be
+.Dv NULL .
.It Fa filtfuncarg
-Argument passed to all calls to the filter function for this tag.
-May be
+Must be
.Dv NULL .
.It Fa maxsize
Maximum size, in bytes, of the sum of all segment lengths in a given
@@ -689,6 +673,14 @@
.Er ENOMEM
if sufficient memory is not available for tag creation
or allocating mapping resources.
+Returns
+.Er EINVAL
+if either
+.Fa filtfunc
+or
+.Fa filtarg
+arguments are not
+.Dv NULL .
.It Fn bus_dma_tag_destroy "dmat"
Deallocate the DMA tag
.Fa dmat
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
@@ -398,6 +398,10 @@
/* Return a NULL tag on failure */
*dmat = NULL;
+ /* Filters are no longer supported. */
+ if (filter != NULL || filterarg != NULL)
+ return (EINVAL);
+
newtag = (bus_dma_tag_t)malloc(sizeof(*newtag), M_BUSDMA,
M_ZERO | M_NOWAIT);
if (newtag == NULL) {
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
@@ -164,6 +164,10 @@
struct bus_dma_tag_common *tc;
int error;
+ /* Filters are no longer supported. */
+ if (filter != NULL || filterarg != NULL)
+ return (EINVAL);
+
if (parent == NULL) {
error = bus_dma_bounce_impl.tag_create(parent, alignment,
boundary, lowaddr, highaddr, filter, filterarg, maxsize,
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
@@ -168,6 +168,10 @@
return (EINVAL);
}
+ /* Filters are no longer supported. */
+ if (filter != NULL || filterarg != NULL)
+ return (EINVAL);
+
/* Return a NULL tag on failure */
*dmat = NULL;
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
@@ -161,6 +161,10 @@
struct bus_dma_tag_common *tc;
int error;
+ /* Filters are no longer supported. */
+ if (filter != NULL || filterarg != NULL)
+ return (EINVAL);
+
if (parent == NULL) {
error = bus_dma_bounce_impl.tag_create(parent, alignment,
boundary, lowaddr, highaddr, filter, filterarg, maxsize,
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
@@ -184,6 +184,10 @@
struct bus_dma_tag_common *tc;
int error;
+ /* Filters are no longer supported. */
+ if (filter != NULL || filterarg != NULL)
+ return (EINVAL);
+
if (parent == NULL) {
error = bus_dma_bounce_impl.tag_create(parent, alignment,
boundary, lowaddr, highaddr, filter, filterarg, maxsize,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 9:33 AM (1 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14674125
Default Alt Text
D42852.id130862.diff (3 KB)
Attached To
Mode
D42852: busdma: Prevent the use of filters with bus_dma_tag_create()
Attached
Detach File
Event Timeline
Log In to Comment