irq: Consolidate do_softirq() arch overriden implementations
All arch overriden implementations of do_softirq() share the following common code: disable irqs (to avoid races with the pending check), check if there are softirqs pending, then execute __do_softirq() on a specific stack. Consolidate the common parts such that archs only worry about the stack switch. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@au1.ibm.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Paul Mackerras <paulus@au1.ibm.com> Cc: James Hogan <james.hogan@imgtec.com> Cc: James E.J. Bottomley <jejb@parisc-linux.org> Cc: Helge Deller <deller@gmx.de> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: David S. Miller <davem@davemloft.net> Cc: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
@@ -698,30 +698,19 @@ void __irq_entry handler_irq(int pil, struct pt_regs *regs)
|
||||
set_irq_regs(old_regs);
|
||||
}
|
||||
|
||||
void do_softirq(void)
|
||||
void do_softirq_own_stack(void)
|
||||
{
|
||||
unsigned long flags;
|
||||
void *orig_sp, *sp = softirq_stack[smp_processor_id()];
|
||||
|
||||
if (in_interrupt())
|
||||
return;
|
||||
sp += THREAD_SIZE - 192 - STACK_BIAS;
|
||||
|
||||
local_irq_save(flags);
|
||||
|
||||
if (local_softirq_pending()) {
|
||||
void *orig_sp, *sp = softirq_stack[smp_processor_id()];
|
||||
|
||||
sp += THREAD_SIZE - 192 - STACK_BIAS;
|
||||
|
||||
__asm__ __volatile__("mov %%sp, %0\n\t"
|
||||
"mov %1, %%sp"
|
||||
: "=&r" (orig_sp)
|
||||
: "r" (sp));
|
||||
__do_softirq();
|
||||
__asm__ __volatile__("mov %0, %%sp"
|
||||
: : "r" (orig_sp));
|
||||
}
|
||||
|
||||
local_irq_restore(flags);
|
||||
__asm__ __volatile__("mov %%sp, %0\n\t"
|
||||
"mov %1, %%sp"
|
||||
: "=&r" (orig_sp)
|
||||
: "r" (sp));
|
||||
__do_softirq();
|
||||
__asm__ __volatile__("mov %0, %%sp"
|
||||
: : "r" (orig_sp));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HOTPLUG_CPU
|
||||
|
Reference in New Issue
Block a user