aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/include/asm/byteorder.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/include/asm/byteorder.h')
-rw-r--r--arch/sparc/include/asm/byteorder.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/arch/sparc/include/asm/byteorder.h b/arch/sparc/include/asm/byteorder.h
new file mode 100644
index 000000000000..bcd83aa351c5
--- /dev/null
+++ b/arch/sparc/include/asm/byteorder.h
@@ -0,0 +1,57 @@
+#ifndef _SPARC_BYTEORDER_H
+#define _SPARC_BYTEORDER_H
+
+#include <asm/types.h>
+#include <asm/asi.h>
+
+#ifdef __GNUC__
+
+#ifdef CONFIG_SPARC32
+#define __SWAB_64_THRU_32__
+#endif
+
+#ifdef CONFIG_SPARC64
+
+static inline __u16 ___arch__swab16p(const __u16 *addr)
+{
+ __u16 ret;
+
+ __asm__ __volatile__ ("lduha [%1] %2, %0"
+ : "=r" (ret)
+ : "r" (addr), "i" (ASI_PL));
+ return ret;
+}
+
+static inline __u32 ___arch__swab32p(const __u32 *addr)
+{
+ __u32 ret;
+
+ __asm__ __volatile__ ("lduwa [%1] %2, %0"
+ : "=r" (ret)
+ : "r" (addr), "i" (ASI_PL));
+ return ret;
+}
+
+static inline __u64 ___arch__swab64p(const __u64 *addr)
+{
+ __u64 ret;
+
+ __asm__ __volatile__ ("ldxa [%1] %2, %0"
+ : "=r" (ret)
+ : "r" (addr), "i" (ASI_PL));
+ return ret;
+}
+
+#define __arch__swab16p(x) ___arch__swab16p(x)
+#define __arch__swab32p(x) ___arch__swab32p(x)
+#define __arch__swab64p(x) ___arch__swab64p(x)
+
+#endif /* CONFIG_SPARC64 */
+
+#define __BYTEORDER_HAS_U64__
+
+#endif
+
+#include <linux/byteorder/big_endian.h>
+
+#endif /* _SPARC_BYTEORDER_H */
drivers/scsi/nsp32.c?id=610b5962c0f7f35dd45f8a870637dc745b309a66&follow=1'>[PATCH] nsp32 needs updating for scsi_hn_getAlan Cox1-5/+3 2002-10-27[PATCH] resurrect the NCR53c406aAlan Cox2-806/+777 2002-10-27[PATCH] ncr53c8xxx needs updating for scsi_hn_getAlan Cox1-9/+4 2002-10-27[PATCH] inia100 just has to lose a next: NULLAlan Cox1-2/+1 2002-10-27[PATCH] fix all the IRQ breakage on the in2000Alan Cox2-14/+13 2002-10-27[PATCH] initial eata driver updatesAlan Cox4-88/+216 2002-10-27[PATCH] fix aic7xxx on gcc 3.2 warning spewAlan Cox1-20/+20 2002-10-27[PATCH] move advansys from pcibios to pci_Alan Cox1-23/+11 2002-10-27[PATCH] ressurect the aha1740 driverAlan Cox1-12/+19 2002-10-27[PATCH] move 53c7,8xx to pci_ not pcibiosAlan Cox2-11/+7 2002-10-27[PATCH] small scsi compile fixesAlan Cox7-24/+15 2002-10-27[PATCH] MCA bus basic cleanupsAlan Cox8-1540/+1323 2002-10-18Linux v2.5.44v2.5.44Linus Torvalds1-1/+1 2002-10-18[PATCH] device removalPatrick Mochel2-3/+4