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

cris: introduce asm/swab.h

Adjust the arch overrides to the new names as well.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Harvey Harrison and committed by
Linus Torvalds
aa0effbd 5bf431fa

+44 -45
+10 -6
arch/cris/include/arch-v10/arch/byteorder.h arch/cris/include/arch-v10/arch/swab.h
··· 1 - #ifndef _CRIS_ARCH_BYTEORDER_H 2 - #define _CRIS_ARCH_BYTEORDER_H 1 + #ifndef _CRIS_ARCH_SWAB_H 2 + #define _CRIS_ARCH_SWAB_H 3 3 4 4 #include <asm/types.h> 5 5 #include <linux/compiler.h> 6 + 7 + #define __SWAB_64_THRU_32__ 6 8 7 9 /* we just define these two (as we can do the swap in a single 8 10 * asm instruction in CRIS) and the arch-independent files will put 9 11 * them together into ntohl etc. 10 12 */ 11 13 12 - static inline __attribute_const__ __u32 ___arch__swab32(__u32 x) 14 + static inline __attribute_const__ __u32 __arch_swab32(__u32 x) 13 15 { 14 16 __asm__ ("swapwb %0" : "=r" (x) : "0" (x)); 15 - 17 + 16 18 return(x); 17 19 } 20 + #define __arch_swab32 __arch_swab32 18 21 19 - static inline __attribute_const__ __u16 ___arch__swab16(__u16 x) 22 + static inline __attribute_const__ __u16 __arch_swab16(__u16 x) 20 23 { 21 24 __asm__ ("swapb %0" : "=r" (x) : "0" (x)); 22 - 25 + 23 26 return(x); 24 27 } 28 + #define __arch_swab16 __arch_swab16 25 29 26 30 #endif
-20
arch/cris/include/arch-v32/arch/byteorder.h
··· 1 - #ifndef _ASM_CRIS_ARCH_BYTEORDER_H 2 - #define _ASM_CRIS_ARCH_BYTEORDER_H 3 - 4 - #include <asm/types.h> 5 - 6 - static inline __const__ __u32 7 - ___arch__swab32(__u32 x) 8 - { 9 - __asm__ __volatile__ ("swapwb %0" : "=r" (x) : "0" (x)); 10 - return (x); 11 - } 12 - 13 - static inline __const__ __u16 14 - ___arch__swab16(__u16 x) 15 - { 16 - __asm__ __volatile__ ("swapb %0" : "=r" (x) : "0" (x)); 17 - return (x); 18 - } 19 - 20 - #endif /* _ASM_CRIS_ARCH_BYTEORDER_H */
+24
arch/cris/include/arch-v32/arch/swab.h
··· 1 + #ifndef _ASM_CRIS_ARCH_SWAB_H 2 + #define _ASM_CRIS_ARCH_SWAB_H 3 + 4 + #include <asm/types.h> 5 + 6 + #define __SWAB_64_THRU_32__ 7 + 8 + static inline __const__ __u32 9 + __arch_swab32(__u32 x) 10 + { 11 + __asm__ __volatile__ ("swapwb %0" : "=r" (x) : "0" (x)); 12 + return (x); 13 + } 14 + #define __arch_swab32 __arch_swab32 15 + 16 + static inline __const__ __u16 17 + __arch_swab16(__u16 x) 18 + { 19 + __asm__ __volatile__ ("swapb %0" : "=r" (x) : "0" (x)); 20 + return (x); 21 + } 22 + #define __arch_swab16 __arch_swab16 23 + 24 + #endif /* _ASM_CRIS_ARCH_SWAB_H */
+1
arch/cris/include/asm/Kbuild
··· 9 9 10 10 unifdef-y += etraxgpio.h 11 11 unifdef-y += rs485.h 12 + unifdef-y += swab.h
+1 -19
arch/cris/include/asm/byteorder.h
··· 1 1 #ifndef _CRIS_BYTEORDER_H 2 2 #define _CRIS_BYTEORDER_H 3 3 4 - #ifdef __GNUC__ 5 - 6 - #ifdef __KERNEL__ 7 - #include <arch/byteorder.h> 8 - 9 - /* defines are necessary because the other files detect the presence 10 - * of a defined __arch_swab32, not an inline 11 - */ 12 - #define __arch__swab32(x) ___arch__swab32(x) 13 - #define __arch__swab16(x) ___arch__swab16(x) 14 - #endif /* __KERNEL__ */ 15 - 16 - #if !defined(__STRICT_ANSI__) || defined(__KERNEL__) 17 - # define __BYTEORDER_HAS_U64__ 18 - # define __SWAB_64_THRU_32__ 19 - #endif 20 - 21 - #endif /* __GNUC__ */ 22 - 4 + #include <asm/swab.h> 23 5 #include <linux/byteorder/little_endian.h> 24 6 25 7 #endif
+8
arch/cris/include/asm/swab.h
··· 1 + #ifndef _CRIS_SWAB_H 2 + #define _CRIS_SWAB_H 3 + 4 + #ifdef __KERNEL__ 5 + #include <arch/swab.h> 6 + #endif /* __KERNEL__ */ 7 + 8 + #endif /* _CRIS_SWAB_H */