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 13:09:11 +0200
commitcdd6003eb8ad3989deab5bfd8cdb1efbffecde22 (patch)
tree2a5c21a2c64dfb563d8a8fca614eacd120db55cf /freebsd/sys/sys/bus_dma.h
parentimx: Use RTEMS GPIO driver instead of FreeBSD one (diff)
downloadrtems-libbsd-cdd6003eb8ad3989deab5bfd8cdb1efbffecde22.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 eb2bc42d..31d7756f 100644
--- a/freebsd/sys/sys/bus_dma.h
+++ b/freebsd/sys/sys/bus_dma.h
@@ -105,6 +105,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;