]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
ARC: Reduce #ifdef'ery for unaligned access emulation
authorVineet Gupta <vgupta@synopsys.com>
Wed, 18 Sep 2013 12:38:01 +0000 (18:08 +0530)
committerVineet Gupta <vgupta@synopsys.com>
Wed, 6 Nov 2013 05:11:39 +0000 (10:41 +0530)
Emulation not enabled is treated as if the fixup failed, so no need for
special #ifdef checks.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
arch/arc/include/asm/unaligned.h
arch/arc/kernel/entry.S
arch/arc/kernel/traps.c

index 60702f3751d2bd7077286fbb929f86c676558e1e..3e5f071bc00c7541cebf06ea00855ad53719d359 100644 (file)
@@ -22,7 +22,8 @@ static inline int
 misaligned_fixup(unsigned long address, struct pt_regs *regs,
                 struct callee_regs *cregs)
 {
-       return 0;
+       /* Not fixed */
+       return 1;
 }
 #endif
 
index eb3f3c5a700a4fbb3323286d01683bbe3c8d0b46..daa0e7990270a6b8ba38de8cf2c0764a620fbb60 100644 (file)
@@ -366,7 +366,6 @@ ARC_ENTRY EV_TLBProtV
        ;========== (6b) Non aligned access ============
 4:
 
-#ifdef  CONFIG_ARC_MISALIGN_ACCESS
        SAVE_CALLEE_SAVED_USER
        mov r2, sp              ; callee_regs
 
@@ -375,9 +374,6 @@ ARC_ENTRY EV_TLBProtV
        ; TBD: optimize - do this only if a callee reg was involved
        ; either a dst of emulated LD/ST or src with address-writeback
        RESTORE_CALLEE_SAVED_USER
-#else
-       bl  do_misaligned_error
-#endif
 
        b   ret_from_exception
 
index e21692d2fdabc35a5f1120bb26bec82c828c4d0c..3eadfdabc32295008aa899d74dab4057173ea19e 100644 (file)
@@ -84,19 +84,18 @@ DO_ERROR_INFO(SIGBUS, "Invalid Mem Access", do_memory_error, BUS_ADRERR)
 DO_ERROR_INFO(SIGTRAP, "Breakpoint Set", trap_is_brkpt, TRAP_BRKPT)
 DO_ERROR_INFO(SIGBUS, "Misaligned Access", do_misaligned_error, BUS_ADRALN)
 
-#ifdef CONFIG_ARC_MISALIGN_ACCESS
 /*
  * Entry Point for Misaligned Data access Exception, for emulating in software
  */
 int do_misaligned_access(unsigned long address, struct pt_regs *regs,
                         struct callee_regs *cregs)
 {
+       /* If emulation not enabled, or failed, kill the task */
        if (misaligned_fixup(address, regs, cregs) != 0)
                return do_misaligned_error(address, regs);
 
        return 0;
 }
-#endif
 
 /*
  * Entry point for miscll errors such as Nested Exceptions