grlib: make memory coherency cpu-independent

Update #3678.
This commit is contained in:
Jiri Gaisler
2019-01-21 11:27:07 +01:00
committed by Sebastian Huber
parent 9b2b389e8d
commit c1dcd6af56
2 changed files with 6 additions and 1 deletions

View File

@@ -121,6 +121,9 @@ RTEMS_INLINE_ROUTINE unsigned int grlib_read_uncached32(unsigned int address)
); );
return tmp; return tmp;
} }
#define GRLIB_DMA_IS_CACHE_COHERENT CPU_SPARC_HAS_SNOOPING
#else #else
static unsigned char __inline__ grlib_read_uncached8(unsigned int address) 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; return tmp;
} }
#define GRLIB_DMA_IS_CACHE_COHERENT 1
#endif #endif
extern struct ambapp_bus ambapp_plb; extern struct ambapp_bus ambapp_plb;

View File

@@ -1893,7 +1893,7 @@ static int grspw_hw_receive(GRSPW_DEV *pDev, char *b, int c) {
if (rxlen > c) { if (rxlen > c) {
rxlen = c; rxlen = c;
} }
if (CPU_SPARC_HAS_SNOOPING) { if (GRLIB_DMA_IS_CACHE_COHERENT) {
/* if ( 1 ) {*/ /* if ( 1 ) {*/
/*printf("RX_MEMCPY(0x%x, 0x%x, 0x%x)\n", (unsigned int)b, (unsigned int)(rxb+pDev->rxbufcur), (unsigned int)rxlen);*/ /*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); memcpy(b, rxb+pDev->rxbufcur, rxlen);