summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAlexander van Heukelum <heukelum@fastmail.fm>2008-09-09 21:55:55 +0200
committerIngo Molnar <mingo@elte.hu>2008-10-13 10:20:02 +0200
commit762db4347060c5d23e9675846e02f7d95d7f944f (patch)
tree39267b2c53f6525d8f9a95c1bdb6848205362095 /arch
parent927604c7592473742891dc13e1da09febc06e01b (diff)
i386: remove kprobes' restore_interrupts in favour of conditional_sti
x86_64 uses a helper function conditional_sti in traps_64.c which is equal to restore_interrupts in kprobes.h. The only user of restore_interrupts is in traps_32.c. Introduce conditional_sti for i386 and remove restore_interrupts. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/traps_32.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c
index 0429c5de5ea..203b863ac2a 100644
--- a/arch/x86/kernel/traps_32.c
+++ b/arch/x86/kernel/traps_32.c
@@ -84,6 +84,12 @@ static unsigned int code_bytes = 64;
static int ignore_nmis;
static int die_counter;
+static inline void conditional_sti(struct pt_regs *regs)
+{
+ if (regs->flags & X86_EFLAGS_IF)
+ local_irq_enable();
+}
+
void printk_address(unsigned long address, int reliable)
{
#ifdef CONFIG_KALLSYMS
@@ -859,7 +865,7 @@ void __kprobes do_int3(struct pt_regs *regs, long error_code)
* This is an interrupt gate, because kprobes wants interrupts
* disabled. Normal trap handlers don't.
*/
- restore_interrupts(regs);
+ conditional_sti(regs);
do_trap(3, SIGTRAP, "int3", 1, regs, error_code, NULL);
}