[rtems commit] powerpc/io: Make [out/in] le and be calls conditional

Chris Johns chrisj at rtems.org
Tue Feb 16 20:31:49 UTC 2021


Module:    rtems
Branch:    master
Commit:    6e3c6e044e17286b500bcbba42abe2d0777327a7
Changeset: http://git.rtems.org/rtems/commit/?id=6e3c6e044e17286b500bcbba42abe2d0777327a7

Author:    Chris Johns <chrisj at rtems.org>
Date:      Mon Feb 15 12:01:57 2021 -1000

powerpc/io: Make [out/in] le and be calls conditional

- These calls clash with the Linux IO header in LibBSD. Making these
  conditional here means BSPs build and the imported Linux header is
  untouched.

Updates #4245

---

 bsps/powerpc/include/libcpu/io.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/bsps/powerpc/include/libcpu/io.h b/bsps/powerpc/include/libcpu/io.h
index 521c978..c4e529f 100644
--- a/bsps/powerpc/include/libcpu/io.h
+++ b/bsps/powerpc/include/libcpu/io.h
@@ -107,6 +107,7 @@ static inline void out_be16(volatile uint16_t *addr, uint16_t val)
 	__asm__ __volatile__("sth%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val));
 }
 
+#ifndef in_le32
 static inline uint32_t in_le32(const volatile uint32_t *addr)
 {
 	uint32_t ret;
@@ -115,7 +116,9 @@ static inline uint32_t in_le32(const volatile uint32_t *addr)
 			     "r" (addr), "m" (*addr));
 	return ret;
 }
+#endif
 
+#ifndef in_be32
 static inline uint32_t in_be32(const volatile uint32_t *addr)
 {
 	uint32_t ret;
@@ -123,17 +126,22 @@ static inline uint32_t in_be32(const volatile uint32_t *addr)
 	__asm__ __volatile__("lwz%U1%X1 %0,%1; eieio" : "=r" (ret) : "m" (*addr));
 	return ret;
 }
+#endif
 
+#ifndef out_le32
 static inline void out_le32(volatile uint32_t *addr, uint32_t val)
 {
 	__asm__ __volatile__("stwbrx %1,0,%2; eieio" : "=m" (*addr) :
 			     "r" (val), "r" (addr));
 }
+#endif
 
+#ifndef out_be32
 static inline void out_be32(volatile uint32_t *addr, uint32_t val)
 {
 	__asm__ __volatile__("stw%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val));
 }
+#endif
 
 #endif /* ASM */
 #endif /* _LIBCPU_IO_H */



More information about the vc mailing list