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>
17 # define __SWAB_64_THRU_32__
21 static inline __u64 __arch_swab64p(const __u64 *x)
25 asm volatile("lrvg %0,%1" : "=d" (result) : "m" (*x));
28 #define __arch_swab64p __arch_swab64p
30 static inline __u64 __arch_swab64(__u64 x)
34 asm volatile("lrvgr %0,%1" : "=d" (result) : "d" (x));
37 #define __arch_swab64 __arch_swab64
39 static inline void __arch_swab64s(__u64 *x)
41 *x = __arch_swab64p(x);
43 #define __arch_swab64s __arch_swab64s
44 #endif /* __s390x__ */
46 static inline __u32 __arch_swab32p(const __u32 *x)
56 : "=&d" (result) : "a" (x), "m" (*x) : "cc");
59 : "=d" (result) : "m" (*x));
60 #endif /* __s390x__ */
63 #define __arch_swab32p __arch_swab32p
66 static inline __u32 __arch_swab32(__u32 x)
70 asm volatile("lrvr %0,%1" : "=d" (result) : "d" (x));
73 #define __arch_swab32 __arch_swab32
74 #endif /* __s390x__ */
76 static inline __u16 __arch_swab16p(const __u16 *x)
84 : "=&d" (result) : "a" (x), "m" (*x) : "cc");
87 : "=d" (result) : "m" (*x));
88 #endif /* __s390x__ */
91 #define __arch_swab16p __arch_swab16p
93 #include <linux/byteorder.h>
95 #endif /* _S390_BYTEORDER_H */