1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _CRIS_ARCH_SWAB_H
3 #define _CRIS_ARCH_SWAB_H
6 #include <linux/compiler.h>
8 #define __SWAB_64_THRU_32__
10 /* we just define these two (as we can do the swap in a single
11 * asm instruction in CRIS) and the arch-independent files will put
12 * them together into ntohl etc.
15 static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
17 __asm__ ("swapwb %0" : "=r" (x) : "0" (x));
21 #define __arch_swab32 __arch_swab32
23 static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
25 __asm__ ("swapb %0" : "=r" (x) : "0" (x));
29 #define __arch_swab16 __arch_swab16