diff options
author | Jiri Gaisler <jiri@gaisler.se> | 2019-01-21 11:27:07 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-01-22 12:50:09 +0100 |
commit | c1dcd6af56b7174a1fabd421efbaf566cb997f8b (patch) | |
tree | aa3143efd7e38407e13ca198a7edae0c07477142 | |
parent | grlib: use cpu-independent routines for uncached access (diff) | |
download | rtems-c1dcd6af56b7174a1fabd421efbaf566cb997f8b.tar.bz2 |
grlib: make memory coherency cpu-independent
Update #3678.
-rw-r--r-- | bsps/include/grlib/grlib_impl.h | 5 | ||||
-rw-r--r-- | bsps/shared/grlib/spw/grspw.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/bsps/include/grlib/grlib_impl.h b/bsps/include/grlib/grlib_impl.h index dd6bcc64b7..e795e7f844 100644 --- a/bsps/include/grlib/grlib_impl.h +++ b/bsps/include/grlib/grlib_impl.h @@ -121,6 +121,9 @@ RTEMS_INLINE_ROUTINE unsigned int grlib_read_uncached32(unsigned int address) ); return tmp; } + +#define GRLIB_DMA_IS_CACHE_COHERENT CPU_SPARC_HAS_SNOOPING + #else static unsigned char __inline__ grlib_read_uncached8(unsigned int address) @@ -140,6 +143,8 @@ RTEMS_INLINE_ROUTINE unsigned int grlib_read_uncached32(unsigned int address) return tmp; } +#define GRLIB_DMA_IS_CACHE_COHERENT 1 + #endif extern struct ambapp_bus ambapp_plb; diff --git a/bsps/shared/grlib/spw/grspw.c b/bsps/shared/grlib/spw/grspw.c index 586bb2537c..2e1e8e90e9 100644 --- a/bsps/shared/grlib/spw/grspw.c +++ b/bsps/shared/grlib/spw/grspw.c @@ -1893,7 +1893,7 @@ static int grspw_hw_receive(GRSPW_DEV *pDev, char *b, int c) { if (rxlen > c) { rxlen = c; } - if (CPU_SPARC_HAS_SNOOPING) { + if (GRLIB_DMA_IS_CACHE_COHERENT) { /* if ( 1 ) {*/ /*printf("RX_MEMCPY(0x%x, 0x%x, 0x%x)\n", (unsigned int)b, (unsigned int)(rxb+pDev->rxbufcur), (unsigned int)rxlen);*/ memcpy(b, rxb+pDev->rxbufcur, rxlen); |