GNU Linux-libre 4.14.290-gnu1
[releases.git] / arch / cris / include / arch-v32 / arch / swab.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_CRIS_ARCH_SWAB_H
3 #define _ASM_CRIS_ARCH_SWAB_H
4
5 #include <asm/types.h>
6
7 #define __SWAB_64_THRU_32__
8
9 static inline __const__ __u32
10 __arch_swab32(__u32 x)
11 {
12         __asm__ __volatile__ ("swapwb %0" : "=r" (x) : "0" (x));
13         return (x);
14 }
15 #define __arch_swab32 __arch_swab32
16
17 static inline __const__ __u16
18 __arch_swab16(__u16 x)
19 {
20         __asm__ __volatile__ ("swapb %0" : "=r" (x) : "0" (x));
21         return (x);
22 }
23 #define __arch_swab16 __arch_swab16
24
25 #endif /* _ASM_CRIS_ARCH_SWAB_H */