fix hardware byte swapping to work in little endian mode as well
authorGabor Juhos <juhosg@openwrt.org>
Sat, 23 Jun 2007 05:30:31 +0000 (05:30 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Sat, 23 Jun 2007 05:30:31 +0000 (05:30 +0000)
SVN-Revision: 7712

target/linux/adm5120-2.6/files/arch/mips/adm5120/adm5120_info.c
target/linux/adm5120-2.6/patches/008-adm5120_hardware_swab.patch

index fea52ffca04fbced5130f2a5f4249bc14537bfee..570244b24d4fd49da9418800f7fdd946566b33d2 100644 (file)
@@ -904,12 +904,12 @@ void __init adm5120_swab_test(void)
        u32     t1,t2;
 
        t1 = 0x1234;
-       t2 = swab16(t1);
+       t2 = __arch__swab16(t1);
        printk("hardware swab16 test %s, data:0x%04X, result:0x%04X\n",
                (t2 == 0x3412) ? "passed" :"failed", t1, t2);
 
        t1 = 0x12345678;
-       t2 = swab32(t1);
+       t2 = __arch__swab32(t1);
        printk("hardware swab32 test %s, data:0x%08X, result:0x%08X\n",
                (t2 == 0x78563412) ? "passed" :"failed", t1, t2);
 
index a71dba2d0383a1fd5fbeea3aca949875c0aaf74a..6b0fe55edf6461bdbf336b01fb58c100b926f530 100644 (file)
@@ -9,7 +9,7 @@
 +static __inline__ __attribute_const__ __u16 ___adm5120__swab16(__u16 x)
 +{
 +      __asm__ (
-+      "       sw      %2, 0xC8(%1)                    \n"
++      "       sh      %2, 0xCA(%1)                    \n"
 +      "       lhu     %0, 0xCC(%1)                    \n"
 +      : "=r" (x)
 +      : "r" (0xB2000000), "r" (x));