From 1548f9815dabaaa7b84754b99c99b76ff7f9f11e Mon Sep 17 00:00:00 2001 From: juhosg Date: Sat, 30 Jun 2007 15:03:56 +0000 Subject: [adm5120] move 2.6.22 specific patches into the right place git-svn-id: svn://svn.openwrt.org/openwrt/trunk@7797 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../patches-2.6.22/008-adm5120_hardware_swab.patch | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 target/linux/adm5120-2.6/patches-2.6.22/008-adm5120_hardware_swab.patch (limited to 'target/linux/adm5120-2.6/patches-2.6.22/008-adm5120_hardware_swab.patch') diff --git a/target/linux/adm5120-2.6/patches-2.6.22/008-adm5120_hardware_swab.patch b/target/linux/adm5120-2.6/patches-2.6.22/008-adm5120_hardware_swab.patch new file mode 100644 index 000000000..c0fd645b5 --- /dev/null +++ b/target/linux/adm5120-2.6/patches-2.6.22/008-adm5120_hardware_swab.patch @@ -0,0 +1,40 @@ +Index: linux-2.6.22-rc6/include/asm-mips/byteorder.h +=================================================================== +--- linux-2.6.22-rc6.orig/include/asm-mips/byteorder.h ++++ linux-2.6.22-rc6/include/asm-mips/byteorder.h +@@ -58,6 +58,35 @@ static __inline__ __attribute_const__ __ + + #endif /* CONFIG_CPU_MIPSR2 */ + ++#ifdef CONFIG_ADM5120_HARDWARE_SWAB ++ ++static __inline__ __attribute_const__ __u16 ___adm5120__swab16(__u16 x) ++{ ++ __asm__ ( ++ " sh %2, 0xCA(%1) \n" ++ " lhu %0, 0xCC(%1) \n" ++ : "=r" (x) ++ : "r" (0xB2000000), "r" (x)); ++ ++ return x; ++} ++ ++static __inline__ __attribute_const__ __u32 ___adm5120__swab32(__u32 x) ++{ ++ __asm__ ( ++ " sw %2, 0xC8(%1) \n" ++ " lw %0, 0xCC(%1) \n" ++ : "=r" (x) ++ : "r" (0xB2000000), "r" (x)); ++ ++ return x; ++} ++ ++#define __arch__swab16(x) ___adm5120__swab16(x) ++#define __arch__swab32(x) ___adm5120__swab32(x) ++ ++#endif /* CONFIG_ADM5120_HARDWARE_SWAB */ ++ + #if !defined(__STRICT_ANSI__) || defined(__KERNEL__) + # define __BYTEORDER_HAS_U64__ + # define __SWAB_64_THRU_32__ -- cgit v1.2.3