From fda3bc1c8c8a5f6452c13aa057826529c2f19420 Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Fri, 24 Jun 2016 07:56:48 -0700 Subject: [PATCH] nios2: _Swap(): optimize irq unlock If the CPU lacks certain features the only writable bit in the status register is the PIE bit, so just write the saved value back. Change-Id: I91537ff640aa9977d19587c4b0ae414028752341 Signed-off-by: Andrew Boie --- arch/nios2/core/swap.S | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/nios2/core/swap.S b/arch/nios2/core/swap.S index bb0724ea810..bac3167ee57 100644 --- a/arch/nios2/core/swap.S +++ b/arch/nios2/core/swap.S @@ -103,6 +103,10 @@ BRANCH_LABEL(next_chosen) * key was supplied as argument to _Swap() */ ldw r3, __tTCS_coopReg_OFFSET + __t_coop_key_OFFSET(r11) +#if (NIOS2_NUM_OF_SHADOW_REG_SETS > 0) || \ + (defined NIOS2_EIC_PRESENT) || \ + (defined NIOS2_MMU_PRESENT) || \ + (defined NIOS2_MPU_PRESENT) andi r3, r3, NIOS2_STATUS_PIE_MSK beq r3, zero, no_unlock rdctl r3, status @@ -110,7 +114,9 @@ BRANCH_LABEL(next_chosen) wrctl status, r3 BRANCH_LABEL(no_unlock) - +#else + wrctl status, r3 +#endif ret