[rtems-libbsd commit] ffec: Use explicit cache synchronization
Sebastian Huber
sebh at rtems.org
Wed Sep 27 09:12:20 UTC 2017
Module: rtems-libbsd
Branch: master
Commit: 9c3473572f294a59ac96d90dda56eebf6a1379da
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=9c3473572f294a59ac96d90dda56eebf6a1379da
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Wed Sep 27 09:38:28 2017 +0200
ffec: Use explicit cache synchronization
---
freebsd/sys/dev/ffec/if_ffec.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/freebsd/sys/dev/ffec/if_ffec.c b/freebsd/sys/dev/ffec/if_ffec.c
index 2fc94a6..f4914ad 100644
--- a/freebsd/sys/dev/ffec/if_ffec.c
+++ b/freebsd/sys/dev/ffec/if_ffec.c
@@ -607,8 +607,12 @@ ffec_setup_txbuf(struct ffec_softc *sc, int idx, struct mbuf **mp)
if (error != 0) {
return (ENOMEM);
}
+#ifndef __rtems__
bus_dmamap_sync(sc->txbuf_tag, sc->txbuf_map[idx].map,
BUS_DMASYNC_PREWRITE);
+#else /* __rtems__ */
+ rtems_cache_flush_multiple_data_lines((void *)seg.ds_addr, seg.ds_len);
+#endif /* __rtems__ */
sc->txbuf_map[idx].mbuf = m;
ffec_setup_txdesc(sc, idx, seg.ds_addr, seg.ds_len);
@@ -771,6 +775,9 @@ ffec_alloc_mbufcl(struct ffec_softc *sc)
m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
m->m_pkthdr.len = m->m_len = m->m_ext.ext_size;
+#ifdef __rtems__
+ rtems_cache_invalidate_multiple_data_lines(m->m_data, m->m_len);
+#endif /* __rtems__ */
return (m);
}
More information about the vc
mailing list