File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- #ifndef _CRIS_ARCH_BYTEORDER_H
2- #define _CRIS_ARCH_BYTEORDER_H
1+ #ifndef _CRIS_ARCH_SWAB_H
2+ #define _CRIS_ARCH_SWAB_H
33
44#include <asm/types.h>
55#include <linux/compiler.h>
66
7+ #define __SWAB_64_THRU_32__
8+
79/* we just define these two (as we can do the swap in a single
810 * asm instruction in CRIS) and the arch-independent files will put
911 * them together into ntohl etc.
1012 */
1113
12- static inline __attribute_const__ __u32 ___arch__swab32 (__u32 x )
14+ static inline __attribute_const__ __u32 __arch_swab32 (__u32 x )
1315{
1416 __asm__ ("swapwb %0" : "=r" (x ) : "0" (x ));
15-
17+
1618 return (x );
1719}
20+ #define __arch_swab32 __arch_swab32
1821
19- static inline __attribute_const__ __u16 ___arch__swab16 (__u16 x )
22+ static inline __attribute_const__ __u16 __arch_swab16 (__u16 x )
2023{
2124 __asm__ ("swapb %0" : "=r" (x ) : "0" (x ));
22-
25+
2326 return (x );
2427}
28+ #define __arch_swab16 __arch_swab16
2529
2630#endif
Load diff This file was deleted.
Original file line number Diff line number Diff line change 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 */
Original file line number Diff line number Diff line change @@ -9,3 +9,4 @@ header-y += sync_serial.h
99
1010unifdef-y += etraxgpio.h
1111unifdef-y += rs485.h
12+ unifdef-y += swab.h
Original file line number Diff line number Diff line change 11#ifndef _CRIS_BYTEORDER_H
22#define _CRIS_BYTEORDER_H
33
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>
235#include <linux/byteorder/little_endian.h>
246
257#endif
Original file line number Diff line number Diff line change 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 */
You can’t perform that action at this time.
0 commit comments