patch-2.1.115 linux/include/asm-ppc/byteorder.h

Next file: linux/include/asm-ppc/cache.h
Previous file: linux/include/asm-ppc/bootinfo.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/byteorder.h linux/include/asm-ppc/byteorder.h
@@ -1,34 +1,38 @@
 #ifndef _PPC_BYTEORDER_H
 #define _PPC_BYTEORDER_H
 
+/*
+ *  $Id: byteorder.h,v 1.13 1998/08/03 19:05:11 geert Exp $
+ */
+
 #include <asm/types.h>
 
 #ifdef __GNUC__
 
-extern inline unsigned ld_le16(volatile unsigned short *addr)
+extern __inline__ unsigned ld_le16(volatile unsigned short *addr)
 {
 	unsigned val;
 
-	asm volatile("lhbrx %0,0,%1" : "=r" (val) : "r" (addr));
+	__asm__ __volatile__ ("lhbrx %0,0,%1" : "=r" (val) : "r" (addr));
 	return val;
 }
 
-extern inline void st_le16(volatile unsigned short *addr, unsigned val)
+extern __inline__ void st_le16(volatile unsigned short *addr, unsigned val)
 {
-	asm volatile("sthbrx %0,0,%1" : : "r" (val), "r" (addr) : "memory");
+	__asm__ __volatile__ ("sthbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr));
 }
 
-extern inline unsigned ld_le32(volatile unsigned *addr)
+extern __inline__ unsigned ld_le32(volatile unsigned *addr)
 {
 	unsigned val;
 
-	asm volatile("lwbrx %0,0,%1" : "=r" (val) : "r" (addr));
+	__asm__ __volatile__ ("lwbrx %0,0,%1" : "=r" (val) : "r" (addr));
 	return val;
 }
 
-extern inline void st_le32(volatile unsigned *addr, unsigned val)
+extern __inline__ void st_le32(volatile unsigned *addr, unsigned val)
 {
-	asm volatile("stwbrx %0,0,%1" : : "r" (val), "r" (addr) : "memory");
+	__asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr));
 }
 
 /* alas, egcs sounds like it has a bug in this code that doesn't use the
@@ -43,7 +47,7 @@
 {
 	__u16 result;
 
-	asm("rlwimi %0,%1,8,16,23"
+	__asm__("rlwimi %0,%1,8,16,23"
 	    : "=r" (result)
 	    : "r" (value), "0" (value >> 8));
 	return result;
@@ -53,7 +57,7 @@
 {
 	__u32 result;
 
-	asm("rlwimi %0,%1,24,16,23\n\t"
+	__asm__("rlwimi %0,%1,24,16,23\n\t"
 	    "rlwimi %0,%1,8,8,15\n\t"
 	    "rlwimi %0,%1,24,0,7"
 	    : "=r" (result)
@@ -76,6 +80,9 @@
 
 #endif /* __GNUC__ */
 
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#define __BYTEORDER_HAS_U64__
+#endif
 #include <linux/byteorder/big_endian.h>
 
 #endif /* _PPC_BYTEORDER_H */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov