microblaze: Fix unaligned exception for little endian platform
authorMichal Simek <monstr@monstr.eu>
Wed, 29 Dec 2010 13:34:46 +0000 (14:34 +0100)
committerMichal Simek <monstr@monstr.eu>
Mon, 3 Jan 2011 09:08:29 +0000 (10:08 +0100)
Half word unaligned accesses need to be fixed.

Signed-off-by: Michal Simek <monstr@monstr.eu>
arch/microblaze/kernel/hw_exception_handler.S

index 781195438ee6fcce8eca7044905025cca57ace11..25f6e07d8de883c701a8113da277b56f3a9f86de 100644 (file)
@@ -945,11 +945,20 @@ store3:   sbi     r3, r4, 2;
 store4:        sbi     r3, r4, 3;      /* Delay slot */
 ex_shw_vm:
        /* Store the lower half-word, byte-by-byte into destination address */
+#ifdef __MICROBLAZEEL__
+       lbui    r3, r5, 0;
+store5:        sbi     r3, r4, 0;
+       lbui    r3, r5, 1;
+       brid    ret_from_exc;
+store6:        sbi     r3, r4, 1;      /* Delay slot */
+#else
        lbui    r3, r5, 2;
 store5:        sbi     r3, r4, 0;
        lbui    r3, r5, 3;
        brid    ret_from_exc;
 store6:        sbi     r3, r4, 1;      /* Delay slot */
+#endif
+
 ex_sw_end_vm:                  /* Exception handling of store word, ends. */
 
 /* We have to prevent cases that get/put_user macros get unaligned pointer