]> git.karo-electronics.de Git - linux-beck.git/blobdiff - arch/x86/mm/extable.c
x86/head: Move the early NMI fixup into C
[linux-beck.git] / arch / x86 / mm / extable.c
index 82447b3fba380d6547619958c07ed7c3d2d3010b..4be041910c2f6a4afe46c32755e7fc7742bad7d0 100644 (file)
@@ -1,5 +1,6 @@
 #include <linux/module.h>
 #include <asm/uaccess.h>
+#include <asm/traps.h>
 
 typedef bool (*ex_handler_t)(const struct exception_table_entry *,
                            struct pt_regs *, int);
@@ -83,13 +84,17 @@ int fixup_exception(struct pt_regs *regs, int trapnr)
 }
 
 /* Restricted version used during very early boot */
-int __init early_fixup_exception(unsigned long *ip)
+int __init early_fixup_exception(struct pt_regs *regs, int trapnr)
 {
        const struct exception_table_entry *e;
        unsigned long new_ip;
        ex_handler_t handler;
 
-       e = search_exception_tables(*ip);
+       /* Ignore early NMIs. */
+       if (trapnr == X86_TRAP_NMI)
+               return 1;
+
+       e = search_exception_tables(regs->ip);
        if (!e)
                return 0;
 
@@ -100,6 +105,6 @@ int __init early_fixup_exception(unsigned long *ip)
        if (handler != ex_handler_default)
                return 0;
 
-       *ip = new_ip;
+       regs->ip = new_ip;
        return 1;
 }