Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xtensa: use the new byteorder headers

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>

authored by

Harvey Harrison and committed by
Chris Zankel
206ead28 a75952b7

+15 -17
+15 -17
include/asm-xtensa/byteorder.h
··· 14 14 #include <asm/types.h> 15 15 #include <linux/compiler.h> 16 16 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) 18 28 { 19 29 __u32 res; 20 30 /* instruction sequence from Xtensa ISA release 2/2000 */ ··· 38 28 ); 39 29 return res; 40 30 } 31 + #define __arch_swab32 __arch_swab32 41 32 42 - static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 x) 33 + static inline __attribute_const__ __u16 __arch_swab16(__u16 x) 43 34 { 44 35 /* Given that 'short' values are signed (i.e., can be negative), 45 36 * we cannot assume that the upper 16-bits of the register are ··· 73 62 74 63 return res; 75 64 } 65 + #define __arch_swab16 __arch_swab16 76 66 77 - #define __arch__swab32(x) ___arch__swab32(x) 78 - #define __arch__swab16(x) ___arch__swab16(x) 79 - 80 - #if !defined(__STRICT_ANSI__) || defined(__KERNEL__) 81 - # define __BYTEORDER_HAS_U64__ 82 - # define __SWAB_64_THRU_32__ 83 - #endif 84 - 85 - #ifdef __XTENSA_EL__ 86 - # include <linux/byteorder/little_endian.h> 87 - #elif defined(__XTENSA_EB__) 88 - # include <linux/byteorder/big_endian.h> 89 - #else 90 - # error processor byte order undefined! 91 - #endif 67 + #include <linux/byteorder.h> 92 68 93 69 #endif /* _XTENSA_BYTEORDER_H */