1 #ifndef _S390_BYTEORDER_H
2 #define _S390_BYTEORDER_H
5 * include/asm-s390/byteorder.h
8 * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
9 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
12 #include <asm/types.h>
16 static __inline__ __const__ __u64 ___arch__swab64(__u64 x)
20 __asm__ __volatile__ (
22 : "=&d" (result) : "m" (x) );
26 static __inline__ __const__ __u64 ___arch__swab64p(__u64 *x)
30 __asm__ __volatile__ (
32 : "=d" (result) : "m" (*x) );
36 static __inline__ void ___arch__swab64s(__u64 *x)
38 __asm__ __volatile__ (
44 static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
48 __asm__ __volatile__ (
50 : "=&d" (result) : "m" (x) );
54 static __inline__ __const__ __u32 ___arch__swab32p(__u32 *x)
58 __asm__ __volatile__ (
60 : "=d" (result) : "m" (*x) );
64 static __inline__ void ___arch__swab32s(__u32 *x)
66 __asm__ __volatile__ (
69 : "+m" (*x) : : "0" );
72 static __inline__ __const__ __u16 ___arch__swab16(__u16 x)
76 __asm__ __volatile__ (
78 : "=d" (result) : "m" (x) );
82 static __inline__ __const__ __u16 ___arch__swab16p(__u16 *x)
86 __asm__ __volatile__ (
88 : "=d" (result) : "m" (*x) );
92 static __inline__ void ___arch__swab16s(__u16 *x)
94 __asm__ __volatile__ (
97 : "+m" (*x) : : "0" );
100 #define __arch__swab64(x) ___arch__swab64(x)
101 #define __arch__swab32(x) ___arch__swab32(x)
102 #define __arch__swab16(x) ___arch__swab16(x)
103 #define __arch__swab64p(x) ___arch__swab64p(x)
104 #define __arch__swab32p(x) ___arch__swab32p(x)
105 #define __arch__swab16p(x) ___arch__swab16p(x)
106 #define __arch__swab64s(x) ___arch__swab64s(x)
107 #define __arch__swab32s(x) ___arch__swab32s(x)
108 #define __arch__swab16s(x) ___arch__swab16s(x)
110 #define __BYTEORDER_HAS_U64__
112 #endif /* __GNUC__ */
114 #include <linux/byteorder/big_endian.h>
116 #endif /* _S390_BYTEORDER_H */