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

parisc: use the new byteorder headers

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Matthew Wilcox <willy@debian.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>

authored by

Harvey Harrison and committed by
Kyle McMartin
d2e6675f df8e5bc6

+12 -25
+12 -25
arch/parisc/include/asm/byteorder.h
··· 4 4 #include <asm/types.h> 5 5 #include <linux/compiler.h> 6 6 7 - #ifdef __GNUC__ 7 + #define __BIG_ENDIAN 8 + #define __SWAB_64_THRU_32__ 8 9 9 - static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 x) 10 + static inline __attribute_const__ __u16 __arch_swab16(__u16 x) 10 11 { 11 12 __asm__("dep %0, 15, 8, %0\n\t" /* deposit 00ab -> 0bab */ 12 13 "shd %%r0, %0, 8, %0" /* shift 000000ab -> 00ba */ ··· 15 14 : "0" (x)); 16 15 return x; 17 16 } 17 + #define __arch_swab16 __arch_swab16 18 18 19 - static __inline__ __attribute_const__ __u32 ___arch__swab24(__u32 x) 19 + static inline __attribute_const__ __u32 __arch_swab24(__u32 x) 20 20 { 21 21 __asm__("shd %0, %0, 8, %0\n\t" /* shift xabcxabc -> cxab */ 22 22 "dep %0, 15, 8, %0\n\t" /* deposit cxab -> cbab */ ··· 27 25 return x; 28 26 } 29 27 30 - static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x) 28 + static inline __attribute_const__ __u32 __arch_swab32(__u32 x) 31 29 { 32 30 unsigned int temp; 33 31 __asm__("shd %0, %0, 16, %1\n\t" /* shift abcdabcd -> cdab */ ··· 37 35 : "0" (x)); 38 36 return x; 39 37 } 40 - 38 + #define __arch_swab32 __arch_swab32 41 39 42 40 #if BITS_PER_LONG > 32 43 41 /* ··· 50 48 ** HSHR 67452301 -> *6*4*2*0 into %0 51 49 ** OR %0 | %1 -> 76543210 into %0 (all done!) 52 50 */ 53 - static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 x) { 51 + static inline __attribute_const__ __u64 __arch_swab64(__u64 x) 52 + { 54 53 __u64 temp; 55 54 __asm__("permh,3210 %0, %0\n\t" 56 55 "hshl %0, 8, %1\n\t" ··· 61 58 : "0" (x)); 62 59 return x; 63 60 } 64 - #define __arch__swab64(x) ___arch__swab64(x) 65 - #define __BYTEORDER_HAS_U64__ 66 - #elif !defined(__STRICT_ANSI__) 67 - static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 x) 68 - { 69 - __u32 t1 = ___arch__swab32((__u32) x); 70 - __u32 t2 = ___arch__swab32((__u32) (x >> 32)); 71 - return (((__u64) t1 << 32) | t2); 72 - } 73 - #define __arch__swab64(x) ___arch__swab64(x) 74 - #define __BYTEORDER_HAS_U64__ 75 - #endif 61 + #define __arch_swab64 __arch_swab64 62 + #endif /* BITS_PER_LONG > 32 */ 76 63 77 - #define __arch__swab16(x) ___arch__swab16(x) 78 - #define __arch__swab24(x) ___arch__swab24(x) 79 - #define __arch__swab32(x) ___arch__swab32(x) 80 - 81 - #endif /* __GNUC__ */ 82 - 83 - #include <linux/byteorder/big_endian.h> 64 + #include <linux/byteorder.h> 84 65 85 66 #endif /* _PARISC_BYTEORDER_H */