License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[sfrench/cifs-2.6.git] / arch / cris / include / arch-v10 / arch / swab.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _CRIS_ARCH_SWAB_H
3 #define _CRIS_ARCH_SWAB_H
4
5 #include <asm/types.h>
6 #include <linux/compiler.h>
7
8 #define __SWAB_64_THRU_32__
9
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.
13  */
14
15 static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
16 {
17         __asm__ ("swapwb %0" : "=r" (x) : "0" (x));
18
19         return(x);
20 }
21 #define __arch_swab32 __arch_swab32
22
23 static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
24 {
25         __asm__ ("swapb %0" : "=r" (x) : "0" (x));
26
27         return(x);
28 }
29 #define __arch_swab16 __arch_swab16
30
31 #endif