Skip to content

Commit

Permalink
[PATCH] ARM: Allow register_undef_hook to be called with IRQs off
Browse files Browse the repository at this point in the history
Preserve the interrupt status across a call to register_undef_hook.
This allows it to be called while interrupts are disabled.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King authored and Russell King committed Jul 16, 2005
1 parent 54ea06f commit 109d89c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions arch/arm/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,16 +248,20 @@ static DEFINE_SPINLOCK(undef_lock);

void register_undef_hook(struct undef_hook *hook)
{
spin_lock_irq(&undef_lock);
unsigned long flags;

spin_lock_irqsave(&undef_lock, flags);
list_add(&hook->node, &undef_hook);
spin_unlock_irq(&undef_lock);
spin_unlock_irqrestore(&undef_lock, flags);
}

void unregister_undef_hook(struct undef_hook *hook)
{
spin_lock_irq(&undef_lock);
unsigned long flags;

spin_lock_irqsave(&undef_lock, flags);
list_del(&hook->node);
spin_unlock_irq(&undef_lock);
spin_unlock_irqrestore(&undef_lock, flags);
}

asmlinkage void do_undefinstr(struct pt_regs *regs)
Expand Down

0 comments on commit 109d89c

Please sign in to comment.