aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64/byteorder.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-sparc64/byteorder.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/asm-sparc64/byteorder.h')
-rw-r--r--include/asm-sparc64/byteorder.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/include/asm-sparc64/byteorder.h b/include/asm-sparc64/byteorder.h
new file mode 100644
index 000000000000..c69b08af5fe0
--- /dev/null
+++ b/include/asm-sparc64/byteorder.h
@@ -0,0 +1,50 @@
1/* $Id: byteorder.h,v 1.8 1997/12/18 02:44:14 ecd Exp $ */
2#ifndef _SPARC64_BYTEORDER_H
3#define _SPARC64_BYTEORDER_H
4
5#include <asm/types.h>
6#include <asm/asi.h>
7
8#ifdef __GNUC__
9
10static __inline__ __u16 ___arch__swab16p(const __u16 *addr)
11{
12 __u16 ret;
13
14 __asm__ __volatile__ ("lduha [%1] %2, %0"
15 : "=r" (ret)
16 : "r" (addr), "i" (ASI_PL));
17 return ret;
18}
19
20static __inline__ __u32 ___arch__swab32p(const __u32 *addr)
21{
22 __u32 ret;
23
24 __asm__ __volatile__ ("lduwa [%1] %2, %0"
25 : "=r" (ret)
26 : "r" (addr), "i" (ASI_PL));
27 return ret;
28}
29
30static __inline__ __u64 ___arch__swab64p(const __u64 *addr)
31{
32 __u64 ret;
33
34 __asm__ __volatile__ ("ldxa [%1] %2, %0"
35 : "=r" (ret)
36 : "r" (addr), "i" (ASI_PL));
37 return ret;
38}
39
40#define __arch__swab16p(x) ___arch__swab16p(x)
41#define __arch__swab32p(x) ___arch__swab32p(x)
42#define __arch__swab64p(x) ___arch__swab64p(x)
43
44#define __BYTEORDER_HAS_U64__
45
46#endif /* __GNUC__ */
47
48#include <linux/byteorder/big_endian.h>
49
50#endif /* _SPARC64_BYTEORDER_H */