]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
i386: remove kprobes' restore_interrupts in favour of conditional_sti
authorAlexander van Heukelum <heukelum@fastmail.fm>
Tue, 9 Sep 2008 19:55:55 +0000 (21:55 +0200)
committerIngo Molnar <mingo@elte.hu>
Mon, 13 Oct 2008 08:20:02 +0000 (10:20 +0200)
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>
arch/x86/kernel/traps_32.c
include/asm-x86/kprobes.h

index 0429c5de5ea98d9e94a4401798a1de14ceff7394..203b863ac2a84f17587c5bf36b244ba2b5e72026 100644 (file)
@@ -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);
 }
index bd8407863c13127f1ed7ce1384fce4086e135022..8a0748d01036711c509e99d2d5121fbd81100380 100644 (file)
@@ -82,15 +82,6 @@ struct kprobe_ctlblk {
        struct prev_kprobe prev_kprobe;
 };
 
-/* trap3/1 are intr gates for kprobes.  So, restore the status of IF,
- * if necessary, before executing the original int3/1 (trap) handler.
- */
-static inline void restore_interrupts(struct pt_regs *regs)
-{
-       if (regs->flags & X86_EFLAGS_IF)
-               local_irq_enable();
-}
-
 extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
 extern int kprobe_exceptions_notify(struct notifier_block *self,
                                    unsigned long val, void *data);