Commit 6f881eae authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Michael Ellerman

powerpc/64: Cleanup __check_irq_replay()

Move the clearing of irq_happened bits into the condition where they
were found to be set. This reduces instruction count slightly, and
reduces stores into irq_happened.
Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent c05f0be8
...@@ -143,9 +143,10 @@ notrace unsigned int __check_irq_replay(void) ...@@ -143,9 +143,10 @@ notrace unsigned int __check_irq_replay(void)
*/ */
unsigned char happened = local_paca->irq_happened; unsigned char happened = local_paca->irq_happened;
/* Clear bit 0 which we wouldn't clear otherwise */
local_paca->irq_happened &= ~PACA_IRQ_HARD_DIS;
if (happened & PACA_IRQ_HARD_DIS) { if (happened & PACA_IRQ_HARD_DIS) {
/* Clear bit 0 which we wouldn't clear otherwise */
local_paca->irq_happened &= ~PACA_IRQ_HARD_DIS;
/* /*
* We may have missed a decrementer interrupt if hard disabled. * We may have missed a decrementer interrupt if hard disabled.
* Check the decrementer register in case we had a rollover * Check the decrementer register in case we had a rollover
...@@ -173,39 +174,39 @@ notrace unsigned int __check_irq_replay(void) ...@@ -173,39 +174,39 @@ notrace unsigned int __check_irq_replay(void)
* This is a higher priority interrupt than the others, so * This is a higher priority interrupt than the others, so
* replay it first. * replay it first.
*/ */
local_paca->irq_happened &= ~PACA_IRQ_HMI; if (happened & PACA_IRQ_HMI) {
if (happened & PACA_IRQ_HMI) local_paca->irq_happened &= ~PACA_IRQ_HMI;
return 0xe60; return 0xe60;
}
/* if (happened & PACA_IRQ_DEC) {
* We may have missed a decrementer interrupt. We check the local_paca->irq_happened &= ~PACA_IRQ_DEC;
* decrementer itself rather than the paca irq_happened field
* in case we also had a rollover while hard disabled
*/
local_paca->irq_happened &= ~PACA_IRQ_DEC;
if (happened & PACA_IRQ_DEC)
return 0x900; return 0x900;
}
/* Finally check if an external interrupt happened */ if (happened & PACA_IRQ_EE) {
local_paca->irq_happened &= ~PACA_IRQ_EE; local_paca->irq_happened &= ~PACA_IRQ_EE;
if (happened & PACA_IRQ_EE)
return 0x500; return 0x500;
}
#ifdef CONFIG_PPC_BOOK3E #ifdef CONFIG_PPC_BOOK3E
/* Finally check if an EPR external interrupt happened /*
* this bit is typically set if we need to handle another * Check if an EPR external interrupt happened this bit is typically
* "edge" interrupt from within the MPIC "EPR" handler * set if we need to handle another "edge" interrupt from within the
* MPIC "EPR" handler.
*/ */
local_paca->irq_happened &= ~PACA_IRQ_EE_EDGE; if (happened & PACA_IRQ_EE_EDGE) {
if (happened & PACA_IRQ_EE_EDGE) local_paca->irq_happened &= ~PACA_IRQ_EE_EDGE;
return 0x500; return 0x500;
}
local_paca->irq_happened &= ~PACA_IRQ_DBELL; if (happened & PACA_IRQ_DBELL) {
if (happened & PACA_IRQ_DBELL) local_paca->irq_happened &= ~PACA_IRQ_DBELL;
return 0x280; return 0x280;
}
#else #else
local_paca->irq_happened &= ~PACA_IRQ_DBELL;
if (happened & PACA_IRQ_DBELL) { if (happened & PACA_IRQ_DBELL) {
local_paca->irq_happened &= ~PACA_IRQ_DBELL;
if (cpu_has_feature(CPU_FTR_HVMODE)) if (cpu_has_feature(CPU_FTR_HVMODE))
return 0xe80; return 0xe80;
return 0xa00; return 0xa00;
......
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