Index: bsps/include/grlib/grlib_impl.h
===================================================================
--- bsps/include/grlib/grlib_impl.h	(revision 5981c8ca9fcb6aa4b4c614268c9348b910cdba36)
+++ bsps/include/grlib/grlib_impl.h	(revision 9b2b389e8d6c9a871a3d5de882fc48b13bc9f1ac)
@@ -91,4 +91,56 @@
 #endif
 
+#ifdef __sparc__
+
+RTEMS_INLINE_ROUTINE unsigned char grlib_read_uncached8(unsigned int address)
+{
+       unsigned char tmp;
+       __asm__ (" lduba [%1]1, %0 "
+           : "=r"(tmp)
+           : "r"(address)
+       );
+       return tmp;
+}
+
+RTEMS_INLINE_ROUTINE unsigned short grlib_read_uncached16(unsigned int addr) {
+       unsigned short tmp;
+       __asm__ (" lduha [%1]1, %0 "
+         : "=r"(tmp)
+         : "r"(addr)
+       );
+       return tmp;
+}
+
+
+RTEMS_INLINE_ROUTINE unsigned int grlib_read_uncached32(unsigned int address)
+{
+	unsigned int tmp;
+	__asm__ (" lda [%1]1, %0 "
+	        : "=r"(tmp)
+	        : "r"(address)
+	);
+	return tmp;
+}
+#else
+
+static unsigned char __inline__ grlib_read_uncached8(unsigned int address)
+{
+	unsigned char tmp = (*(volatile unsigned char *)(address));
+	return tmp;
+}
+
+static __inline__ unsigned short grlib_read_uncached16(unsigned int address) {
+	unsigned short tmp = (*(volatile unsigned short *)(address));
+	return tmp;
+}
+
+RTEMS_INLINE_ROUTINE unsigned int grlib_read_uncached32(unsigned int address)
+{
+	unsigned int tmp = (*(volatile unsigned int *)(address));
+	return tmp;
+}
+
+#endif
+
 extern struct ambapp_bus ambapp_plb;
 
Index: bsps/shared/grlib/1553/b1553brm.c
===================================================================
--- bsps/shared/grlib/1553/b1553brm.c	(revision 5981c8ca9fcb6aa4b4c614268c9348b910cdba36)
+++ bsps/shared/grlib/1553/b1553brm.c	(revision 9b2b389e8d6c9a871a3d5de882fc48b13bc9f1ac)
@@ -60,13 +60,5 @@
 
 #define READ_REG(address) (*(volatile unsigned int *)address)
-#define READ_DMA(address) _BRM_REG_READ16((unsigned int)address)
-static __inline__ unsigned short _BRM_REG_READ16(unsigned int addr) {
-	unsigned short tmp;
-	__asm__ (" lduha [%1]1, %0 "
-	  : "=r"(tmp)
-	  : "r"(addr)
-	);
-	return tmp;
-}
+#define READ_DMA(address) grlib_read_uncached16((unsigned int)address)
 
 static rtems_device_driver brm_initialize(rtems_device_major_number major, rtems_device_minor_number minor, void *arg);
Index: bsps/shared/grlib/1553/b1553rt.c
===================================================================
--- bsps/shared/grlib/1553/b1553rt.c	(revision 5981c8ca9fcb6aa4b4c614268c9348b910cdba36)
+++ bsps/shared/grlib/1553/b1553rt.c	(revision 9b2b389e8d6c9a871a3d5de882fc48b13bc9f1ac)
@@ -53,14 +53,5 @@
 #endif
 
-#define READ_DMA(address) _READ16((unsigned int)address)
-
-static __inline__ unsigned short _READ16(unsigned int addr) {
-    unsigned short tmp;
-    asm(" lduha [%1]1, %0 "
-        : "=r"(tmp)
-        : "r"(addr)
-	);
-    return tmp;
-}
+#define READ_DMA(address) grlib_read_uncached16((unsigned int)address)
 
 static rtems_device_driver rt_initialize(rtems_device_major_number major, rtems_device_minor_number minor, void *arg);
Index: bsps/shared/grlib/can/grcan.c
===================================================================
--- bsps/shared/grlib/can/grcan.c	(revision 5981c8ca9fcb6aa4b4c614268c9348b910cdba36)
+++ bsps/shared/grlib/can/grcan.c	(revision 9b2b389e8d6c9a871a3d5de882fc48b13bc9f1ac)
@@ -166,5 +166,5 @@
 
 #ifdef GRCAN_REG_BYPASS_CACHE
-#define READ_REG(address) _grcan_read_nocache((unsigned int)(address))
+#define READ_REG(address) grlib_read_uncached32((unsigned int)(address))
 #else
 #define READ_REG(address) (*(volatile unsigned int *)(address))
@@ -172,30 +172,9 @@
 
 #ifdef GRCAN_DMA_BYPASS_CACHE
-#define READ_DMA_WORD(address) _grcan_read_nocache((unsigned int)(address))
-#define READ_DMA_BYTE(address) _grcan_read_nocache_byte((unsigned int)(address))
-static unsigned char __inline__ _grcan_read_nocache_byte(unsigned int address)
-{
-	unsigned char tmp;
-	__asm__ (" lduba [%1]1, %0 "
-	    : "=r"(tmp)
-	    : "r"(address)
-	);
-	return tmp;
-}
+#define READ_DMA_WORD(address) grlib_read_uncached32((unsigned int)(address))
+#define READ_DMA_BYTE(address) grlib_read_uncached8((unsigned int)(address))
 #else
 #define READ_DMA_WORD(address) (*(volatile unsigned int *)(address))
 #define READ_DMA_BYTE(address) (*(volatile unsigned char *)(address))
-#endif
-
-#if defined(GRCAN_REG_BYPASS_CACHE) || defined(GRCAN_DMA_BYPASS_CACHE)
-static unsigned int __inline__ _grcan_read_nocache(unsigned int address)
-{
-	unsigned int tmp;
-	__asm__ (" lda [%1]1, %0 "
-	        : "=r"(tmp)
-	        : "r"(address)
-	);
-	return tmp;
-}
 #endif
 
Index: bsps/shared/grlib/pci/grpci2dma.c
===================================================================
--- bsps/shared/grlib/pci/grpci2dma.c	(revision 5981c8ca9fcb6aa4b4c614268c9348b910cdba36)
+++ bsps/shared/grlib/pci/grpci2dma.c	(revision 9b2b389e8d6c9a871a3d5de882fc48b13bc9f1ac)
@@ -99,5 +99,5 @@
 #define BD_WRITE(addr, val) (*(volatile unsigned int *)(addr) = (unsigned int)(val))
 /*#define BD_READ(addr) (*(volatile unsigned int *)(addr))*/
-#define BD_READ(addr) leon_r32_no_cache((unsigned long)(addr))
+#define BD_READ(addr) grlib_read_uncached32((unsigned long)(addr))
 #define REG_WRITE(addr, val) (*(volatile unsigned int *)(addr) = (unsigned int)(val))
 #define REG_READ(addr) (*(volatile unsigned int *)(addr))
Index: bsps/shared/grlib/spw/grspw.c
===================================================================
--- bsps/shared/grlib/spw/grspw.c	(revision 5981c8ca9fcb6aa4b4c614268c9348b910cdba36)
+++ bsps/shared/grlib/spw/grspw.c	(revision 9b2b389e8d6c9a871a3d5de882fc48b13bc9f1ac)
@@ -153,30 +153,7 @@
 #define _MEM_READ32(address) (*(volatile unsigned int *)(address))
 #else
-static inline unsigned int _SPW_READ(volatile void *addr) {
-        unsigned int tmp;
-        __asm__ (" lda [%1]1, %0 "
-            : "=r"(tmp)
-            : "r"(addr)
-           );
-        return tmp;
-}
-
-static inline unsigned int _MEM_READ8(volatile void *addr) {
-        unsigned int tmp;
-        __asm__ (" lduba [%1]1, %0 "
-            : "=r"(tmp)
-            : "r"(addr)
-           );
-        return tmp;
-}
-
-static inline unsigned int _MEM_READ32(volatile void *addr) {
-        unsigned int tmp;
-        __asm__ (" lda [%1]1, %0 "
-            : "=r"(tmp)
-            : "r"(addr)
-           );
-        return tmp;
-}
+#define _SPW_READ(address) grlib_read_uncached32((unsigned int) address)
+#define _MEM_READ8(address) grlib_read_uncached8((unsigned int) address)
+#define _MEM_READ32(address) grlib_read_uncached32((unsigned int) address)
 #endif
 
Index: bsps/shared/grlib/spw/grspw_pkt.c
===================================================================
--- bsps/shared/grlib/spw/grspw_pkt.c	(revision 5981c8ca9fcb6aa4b4c614268c9348b910cdba36)
+++ bsps/shared/grlib/spw/grspw_pkt.c	(revision 9b2b389e8d6c9a871a3d5de882fc48b13bc9f1ac)
@@ -316,5 +316,5 @@
 #define BD_WRITE(addr, val) (*(volatile unsigned int *)(addr) = (unsigned int)(val))
 /*#define BD_READ(addr) (*(volatile unsigned int *)(addr))*/
-#define BD_READ(addr) leon_r32_no_cache((unsigned long)(addr))
+#define BD_READ(addr) grlib_read_uncached32((unsigned long)(addr))
 #define REG_WRITE(addr, val) (*(volatile unsigned int *)(addr) = (unsigned int)(val))
 #define REG_READ(addr) (*(volatile unsigned int *)(addr))
