aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/traps.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2005-07-16 16:43:33 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-07-16 16:43:33 +0100
commit109d89ca0ee76138e04b41726b7f719c7df65e88 (patch)
tree3653f48740d7812e21e15d09648e58edbc0416b9 /arch/arm/kernel/traps.c
parent[PATCH] ARM: Convert bitops to use ARMv6 ldrex/strex instructions (diff)
downloadlinux-dev-109d89ca0ee76138e04b41726b7f719c7df65e88.tar.xz
linux-dev-109d89ca0ee76138e04b41726b7f719c7df65e88.zip
[PATCH] ARM: Allow register_undef_hook to be called with IRQs off
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>
Diffstat (limited to '')
-rw-r--r--arch/arm/kernel/traps.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index df2cb06ce424..d571c37ac30c 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -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)