Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137914159
D3012.id54425.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D3012.id54425.diff
View Options
Index: head/sys/sys/bus_dma.h
===================================================================
--- head/sys/sys/bus_dma.h
+++ head/sys/sys/bus_dma.h
@@ -282,13 +282,25 @@
void bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map);
/*
- * Perform a synchronization operation on the given map.
+ * Perform a synchronization operation on the given map. If the map
+ * is NULL we have a fully IO-coherent system. On every ARM architecture
+ * there must be a memory barrier placed to ensure that all data
+ * accesses are visible before going any further.
*/
void _bus_dmamap_sync(bus_dma_tag_t, bus_dmamap_t, bus_dmasync_op_t);
+#if defined(__arm__)
+ #define __BUS_DMAMAP_SYNC_DEFAULT mb();
+#elif defined(__aarch64__)
+ #define __BUS_DMAMAP_SYNC_DEFAULT dmb(sy);
+#else
+ #define __BUS_DMAMAP_SYNC_DEFAULT {}
+#endif
#define bus_dmamap_sync(dmat, dmamap, op) \
do { \
if ((dmamap) != NULL) \
_bus_dmamap_sync(dmat, dmamap, op); \
+ else \
+ __BUS_DMAMAP_SYNC_DEFAULT \
} while (0)
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 28, 4:36 AM (18 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26274181
Default Alt Text
D3012.id54425.diff (1 KB)
Attached To
Mode
D3012: Add memory barrier to bus_dmamap_sync
Attached
Detach File
Event Timeline
Log In to Comment