Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102956375
D41027.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D41027.diff
View Options
diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c
--- a/sys/kern/subr_bus_dma.c
+++ b/sys/kern/subr_bus_dma.c
@@ -557,19 +557,19 @@
switch (mem->md_type) {
case MEMDESC_VADDR:
error = _bus_dmamap_load_buffer(dmat, map, mem->u.md_vaddr,
- mem->md_opaque, kernel_pmap, flags, NULL, &nsegs);
+ mem->md_len, kernel_pmap, flags, NULL, &nsegs);
break;
case MEMDESC_PADDR:
error = _bus_dmamap_load_phys(dmat, map, mem->u.md_paddr,
- mem->md_opaque, flags, NULL, &nsegs);
+ mem->md_len, flags, NULL, &nsegs);
break;
case MEMDESC_VLIST:
error = _bus_dmamap_load_vlist(dmat, map, mem->u.md_list,
- mem->md_opaque, kernel_pmap, &nsegs, flags, 0, SIZE_T_MAX);
+ mem->md_nseg, kernel_pmap, &nsegs, flags, 0, SIZE_T_MAX);
break;
case MEMDESC_PLIST:
error = _bus_dmamap_load_plist(dmat, map, mem->u.md_list,
- mem->md_opaque, &nsegs, flags);
+ mem->md_nseg, &nsegs, flags);
break;
case MEMDESC_BIO:
error = _bus_dmamap_load_bio(dmat, map, mem->u.md_bio,
diff --git a/sys/kern/subr_msan.c b/sys/kern/subr_msan.c
--- a/sys/kern/subr_msan.c
+++ b/sys/kern/subr_msan.c
@@ -1505,7 +1505,7 @@
BUS_DMASYNC_PREWRITE) {
switch (desc->md_type) {
case MEMDESC_VADDR:
- kmsan_check(desc->u.md_vaddr, desc->md_opaque,
+ kmsan_check(desc->u.md_vaddr, desc->md_len,
"dmasync");
break;
case MEMDESC_BIO:
@@ -1524,7 +1524,7 @@
if ((op & BUS_DMASYNC_POSTREAD) != 0) {
switch (desc->md_type) {
case MEMDESC_VADDR:
- kmsan_mark(desc->u.md_vaddr, desc->md_opaque,
+ kmsan_mark(desc->u.md_vaddr, desc->md_len,
KMSAN_STATE_INITED);
break;
case MEMDESC_BIO:
diff --git a/sys/sys/memdesc.h b/sys/sys/memdesc.h
--- a/sys/sys/memdesc.h
+++ b/sys/sys/memdesc.h
@@ -50,7 +50,10 @@
struct uio *md_uio;
struct mbuf *md_mbuf;
} u;
- size_t md_opaque; /* type specific data. */
+ union { /* type specific data. */
+ size_t md_len; /* VADDR, PADDR */
+ int md_nseg; /* VLIST, PLIST */
+ };
uint32_t md_type; /* Type of memory. */
};
@@ -68,7 +71,7 @@
struct memdesc mem;
mem.u.md_vaddr = vaddr;
- mem.md_opaque = len;
+ mem.md_len = len;
mem.md_type = MEMDESC_VADDR;
return (mem);
@@ -80,7 +83,7 @@
struct memdesc mem;
mem.u.md_paddr = paddr;
- mem.md_opaque = len;
+ mem.md_len = len;
mem.md_type = MEMDESC_PADDR;
return (mem);
@@ -92,7 +95,7 @@
struct memdesc mem;
mem.u.md_list = vlist;
- mem.md_opaque = sglist_cnt;
+ mem.md_nseg = sglist_cnt;
mem.md_type = MEMDESC_VLIST;
return (mem);
@@ -104,7 +107,7 @@
struct memdesc mem;
mem.u.md_list = plist;
- mem.md_opaque = sglist_cnt;
+ mem.md_nseg = sglist_cnt;
mem.md_type = MEMDESC_PLIST;
return (mem);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 20, 4:30 AM (21 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14730258
Default Alt Text
D41027.diff (2 KB)
Attached To
Mode
D41027: memdesc: Replace md_opaque with a union of type-specific fields.
Attached
Detach File
Event Timeline
Log In to Comment