aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/mm/extable.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/i386/mm/extable.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/i386/mm/extable.c')
-rw-r--r--arch/i386/mm/extable.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/i386/mm/extable.c b/arch/i386/mm/extable.c
new file mode 100644
index 000000000000..f706449319c4
--- /dev/null
+++ b/arch/i386/mm/extable.c
@@ -0,0 +1,36 @@
1/*
2 * linux/arch/i386/mm/extable.c
3 */
4
5#include <linux/config.h>
6#include <linux/module.h>
7#include <linux/spinlock.h>
8#include <asm/uaccess.h>
9
10int fixup_exception(struct pt_regs *regs)
11{
12 const struct exception_table_entry *fixup;
13
14#ifdef CONFIG_PNPBIOS
15 if (unlikely((regs->xcs & ~15) == (GDT_ENTRY_PNPBIOS_BASE << 3)))
16 {
17 extern u32 pnp_bios_fault_eip, pnp_bios_fault_esp;
18 extern u32 pnp_bios_is_utter_crap;
19 pnp_bios_is_utter_crap = 1;
20 printk(KERN_CRIT "PNPBIOS fault.. attempting recovery.\n");
21 __asm__ volatile(
22 "movl %0, %%esp\n\t"
23 "jmp *%1\n\t"
24 : : "g" (pnp_bios_fault_esp), "g" (pnp_bios_fault_eip));
25 panic("do_trap: can't hit this");
26 }
27#endif
28
29 fixup = search_exception_tables(regs->eip);
30 if (fixup) {
31 regs->eip = fixup->fixup;
32 return 1;
33 }
34
35 return 0;
36}