aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2015-10-08 08:22:27 -0400
committerVineet Gupta <vgupta@synopsys.com>2015-10-17 08:18:23 -0400
commit9fabcc636bf57dcb9c6fc5b1f34861c548944fd4 (patch)
treea3924e140769864304736e3f8354e62761bf693c
parent5f888087455c5199195c2ba17b91ac7285a33921 (diff)
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: Vineet Gupta <vgupta@synopsys.com>
-rw-r--r--arch/arc/kernel/entry-compact.S18
1 files changed, 6 insertions, 12 deletions
diff --git a/arch/arc/kernel/entry-compact.S b/arch/arc/kernel/entry-compact.S
index d9087a1236eb..5221f194602b 100644
--- a/arch/arc/kernel/entry-compact.S
+++ b/arch/arc/kernel/entry-compact.S
@@ -333,11 +333,10 @@ END(call_do_page_fault)
333 ; Note that we use realtime STATUS32 (not pt_regs->status32) to 333 ; Note that we use realtime STATUS32 (not pt_regs->status32) to
334 ; decide that. 334 ; decide that.
335 335
336 ; if Returning from Exception 336 and.f 0, r10, (STATUS_A1_MASK|STATUS_A2_MASK)
337 btst r10, STATUS_AE_BIT 337 bz .Lexcep_or_pure_K_ret
338 bnz .Lexcep_ret
339 338
340 ; Not Exception so maybe Interrupts (Level 1 or 2) 339 ; Returning from Interrupts (Level 1 or 2)
341 340
342#ifdef CONFIG_ARC_COMPACT_IRQ_LEVELS 341#ifdef CONFIG_ARC_COMPACT_IRQ_LEVELS
343 342
@@ -378,8 +377,7 @@ END(call_do_page_fault)
378 st r9, [r10, THREAD_INFO_PREEMPT_COUNT] 377 st r9, [r10, THREAD_INFO_PREEMPT_COUNT]
379 378
380149: 379149:
381 ;return from level 2 380 INTERRUPT_EPILOGUE 2 ; return from level 2 interrupt
382 INTERRUPT_EPILOGUE 2
383debug_marker_l2: 381debug_marker_l2:
384 rtie 382 rtie
385 383
@@ -387,15 +385,11 @@ not_level2_interrupt:
387 385
388#endif 386#endif
389 387
390 bbit0 r10, STATUS_A1_BIT, .Lpure_k_mode_ret 388 INTERRUPT_EPILOGUE 1 ; return from level 1 interrupt
391
392 ;return from level 1
393 INTERRUPT_EPILOGUE 1
394debug_marker_l1: 389debug_marker_l1:
395 rtie 390 rtie
396 391
397.Lexcep_ret: 392.Lexcep_or_pure_K_ret:
398.Lpure_k_mode_ret:
399 393
400 ;this case is for syscalls or Exceptions or pure kernel mode 394 ;this case is for syscalls or Exceptions or pure kernel mode
401 395