Commit 9fabcc63 authored by Vineet Gupta's avatar Vineet Gupta

ARC: [arcompact] entry.S: Elide extra check/branch in exception ret path

This is done by improving the laddering logic !

Before:

   if Exception
      goto excep_or_pure_k_ret

   if !Interrupt(L2)
      goto l1_chk
   else
      INTERRUPT_EPILOGUE 2

 l1_chk:
   if !Interrupt(L1)  (i.e. pure kernel mode)
      goto excep_or_pure_k_ret
   else
      INTERRUPT_EPILOGUE 1

 excep_or_pure_k_ret:
   EXCEPTION_EPILOGUE

Now:

   if !Interrupt(L1 or L2) (i.e. exception or pure kernel mode)
      goto excep_or_pure_k_ret

  ; guaranteed to be an interrupt
   if !Interrupt(L2)
      goto l1_ret
   else
      INTERRUPT_EPILOGUE 2

 ; by virtue of above, no need to chk for L1 active
 l1_ret:
    INTERRUPT_EPILOGUE 1

 excep_or_pure_k_ret:
    EXCEPTION_EPILOGUE
Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
parent 5f888087
...@@ -333,11 +333,10 @@ END(call_do_page_fault) ...@@ -333,11 +333,10 @@ END(call_do_page_fault)
; Note that we use realtime STATUS32 (not pt_regs->status32) to ; Note that we use realtime STATUS32 (not pt_regs->status32) to
; decide that. ; decide that.
; if Returning from Exception and.f 0, r10, (STATUS_A1_MASK|STATUS_A2_MASK)
btst r10, STATUS_AE_BIT bz .Lexcep_or_pure_K_ret
bnz .Lexcep_ret
; Not Exception so maybe Interrupts (Level 1 or 2) ; Returning from Interrupts (Level 1 or 2)
#ifdef CONFIG_ARC_COMPACT_IRQ_LEVELS #ifdef CONFIG_ARC_COMPACT_IRQ_LEVELS
...@@ -378,8 +377,7 @@ END(call_do_page_fault) ...@@ -378,8 +377,7 @@ END(call_do_page_fault)
st r9, [r10, THREAD_INFO_PREEMPT_COUNT] st r9, [r10, THREAD_INFO_PREEMPT_COUNT]
149: 149:
;return from level 2 INTERRUPT_EPILOGUE 2 ; return from level 2 interrupt
INTERRUPT_EPILOGUE 2
debug_marker_l2: debug_marker_l2:
rtie rtie
...@@ -387,15 +385,11 @@ not_level2_interrupt: ...@@ -387,15 +385,11 @@ not_level2_interrupt:
#endif #endif
bbit0 r10, STATUS_A1_BIT, .Lpure_k_mode_ret INTERRUPT_EPILOGUE 1 ; return from level 1 interrupt
;return from level 1
INTERRUPT_EPILOGUE 1
debug_marker_l1: debug_marker_l1:
rtie rtie
.Lexcep_ret: .Lexcep_or_pure_K_ret:
.Lpure_k_mode_ret:
;this case is for syscalls or Exceptions or pure kernel mode ;this case is for syscalls or Exceptions or pure kernel mode
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment