summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/sys/bus_dma.h
diff options
context:
space:
mode:
authorChristian Mauderer <christian.mauderer@embedded-brains.de>2020-04-02 16:42:43 +0200
committerChristian Mauderer <christian.mauderer@embedded-brains.de>2020-07-29 11:19:14 +0200
commit4820ccecc92f850333dbf01cc2dedfa31329e474 (patch)
treeae1a8fe22c6f0ecd17cf02ff3193418de495e009 /freebsd/sys/sys/bus_dma.h
parentimx: Use RTEMS GPIO driver instead of FreeBSD one (diff)
downloadrtems-libbsd-4820ccecc92f850333dbf01cc2dedfa31329e474.tar.bz2
busdma: Option to round to cache lines on sync
Some targets support only flushing or invalidating complete cache lines. In this cases misaligned buffers might lead to unexpected results. This patch adds a flag that allows drivers to signal to the bus dma driver that it is OK to round a buffer to the next full cache line. That's for example necessary if a driver wants to send out 14 byte via a USB DMA. Only the driver knows whether these 14 bytes are located in an otherwise unused cache line aligned buffer.
Diffstat (limited to '')
-rw-r--r--freebsd/sys/sys/bus_dma.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/freebsd/sys/sys/bus_dma.h b/freebsd/sys/sys/bus_dma.h
index e99d8ece..d5a08be0 100644
--- a/freebsd/sys/sys/bus_dma.h
+++ b/freebsd/sys/sys/bus_dma.h
@@ -107,6 +107,12 @@
#define BUS_DMA_KEEP_PG_OFFSET 0x400
#define BUS_DMA_LOAD_MBUF 0x800
+#ifdef __rtems__
+/*
+ * Hint that the start address and size can be aligned to the next cache line.
+ */
+#define BUS_DMA_DO_CACHE_LINE_BLOW_UP 0x80000000
+#endif /* __rtems__ */
/* Forwards needed by prototypes below. */
union ccb;