perf tools: Streamline bpf examples and headers installation
[linux/fpc-iii.git] / arch / m68k / include / uapi / asm / swab.h
blob9ef4fafba7d46519add52d70a8751d1ecaad5049
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef _M68K_SWAB_H
3 #define _M68K_SWAB_H
5 #include <linux/types.h>
6 #include <linux/compiler.h>
8 #define __SWAB_64_THRU_32__
10 #if defined (__mcfisaaplus__) || defined (__mcfisac__)
11 static inline __attribute_const__ __u32 __arch_swab32(__u32 val)
13 __asm__("byterev %0" : "=d" (val) : "0" (val));
14 return val;
17 #define __arch_swab32 __arch_swab32
18 #elif !defined(__mcoldfire__)
20 static inline __attribute_const__ __u32 __arch_swab32(__u32 val)
22 __asm__("rolw #8,%0; swap %0; rolw #8,%0" : "=d" (val) : "0" (val));
23 return val;
25 #define __arch_swab32 __arch_swab32
26 #endif
28 #endif /* _M68K_SWAB_H */