#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);
}
/* 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;
if (handler != ex_handler_default)
return 0;
- *ip = new_ip;
+ regs->ip = new_ip;
return 1;
}