1414#include <asm/types.h>
1515#include <linux/compiler.h>
1616
17- static __inline__ __attribute_const__ __u32 ___arch__swab32 (__u32 x )
17+ #ifdef __XTENSA_EL__
18+ # define __LITTLE_ENDIAN
19+ #elif defined(__XTENSA_EB__ )
20+ # define __BIG_ENDIAN
21+ #else
22+ # error processor byte order undefined!
23+ #endif
24+
25+ #define __SWAB_64_THRU_32__
26+
27+ static inline __attribute_const__ __u32 __arch_swab32 (__u32 x )
1828{
1929 __u32 res ;
2030 /* instruction sequence from Xtensa ISA release 2/2000 */
@@ -28,8 +38,9 @@ static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
2838 );
2939 return res ;
3040}
41+ #define __arch_swab32 __arch_swab32
3142
32- static __inline__ __attribute_const__ __u16 ___arch__swab16 (__u16 x )
43+ static inline __attribute_const__ __u16 __arch_swab16 (__u16 x )
3344{
3445 /* Given that 'short' values are signed (i.e., can be negative),
3546 * we cannot assume that the upper 16-bits of the register are
@@ -62,21 +73,8 @@ static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 x)
6273
6374 return res ;
6475}
76+ #define __arch_swab16 __arch_swab16
6577
66- #define __arch__swab32 (x ) ___arch__swab32(x)
67- #define __arch__swab16 (x ) ___arch__swab16(x)
68-
69- #if !defined(__STRICT_ANSI__ ) || defined(__KERNEL__ )
70- # define __BYTEORDER_HAS_U64__
71- # define __SWAB_64_THRU_32__
72- #endif
73-
74- #ifdef __XTENSA_EL__
75- # include <linux/byteorder/little_endian.h>
76- #elif defined(__XTENSA_EB__ )
77- # include <linux/byteorder/big_endian.h>
78- #else
79- # error processor byte order undefined!
80- #endif
78+ #include <linux/byteorder.h>
8179
8280#endif /* _XTENSA_BYTEORDER_H */
0 commit comments