patch-2.1.7 linux/arch/i386/mm/fault.c

Next file: linux/drivers/block/md.c
Previous file: linux/arch/i386/mm/extable.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.6/linux/arch/i386/mm/fault.c linux/arch/i386/mm/fault.c
@@ -93,6 +93,7 @@
 	struct vm_area_struct * vma;
 	unsigned long address;
 	unsigned long page;
+	unsigned long fixup;
 	int write;
 
 	/* get the address */
@@ -161,14 +162,14 @@
  */
 bad_area:
 	up(&mm->mmap_sem);
-	/* is there valid exception data? Return to indicated handler if so */
-	if (tsk->tss.ex.count == 0) {
-		printk("Exception at %lx (%lx)\n", regs->eip, regs->edx);
-		tsk->tss.ex.count--;
-		regs->eip = regs->edx;
-		regs->edx = -EFAULT;
+
+	/* Are we prepared to handle this fault?  */
+	if ((fixup = search_exception_table(regs->eip)) != 0) {
+		printk("Exception at %lx (%lx)\n", regs->eip, fixup);
+		regs->eip = fixup;
 		return;
 	}
+
 	if (error_code & 4) {
 		tsk->tss.cr2 = address;
 		tsk->tss.error_code = error_code;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov