summaryrefslogtreecommitdiffstats
path: root/rtemsbsd/include/machine
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 /rtemsbsd/include/machine
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 'rtemsbsd/include/machine')
-rw-r--r--rtemsbsd/include/machine/rtems-bsd-bus-dma.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/rtemsbsd/include/machine/rtems-bsd-bus-dma.h b/rtemsbsd/include/machine/rtems-bsd-bus-dma.h
index ac970537..e9566882 100644
--- a/rtemsbsd/include/machine/rtems-bsd-bus-dma.h
+++ b/rtemsbsd/include/machine/rtems-bsd-bus-dma.h
@@ -75,6 +75,9 @@ struct bus_dma_tag {
struct bus_dmamap {
void *buffer_begin;
bus_size_t buffer_size;
+ int flags;
+/* OK to flush / invalidate the complete cache line */
+#define DMAMAP_CACHE_ALIGNED (1 << 0)
};
int