patch-2.1.101 linux/arch/arm/mm/fault-armo.c

Next file: linux/arch/arm/mm/fault-armv.c
Previous file: linux/arch/arm/mm/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.100/linux/arch/arm/mm/fault-armo.c linux/arch/arm/mm/fault-armo.c
@@ -27,11 +27,25 @@
 #define FAULT_CODE_WRITE	0x02
 #define FAULT_CODE_USER		0x01
 
+#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
+
 struct pgtable_cache_struct quicklists;
 
-void __bad_pte(pmd_t *pmd)
+void __bad_pmd(pmd_t *pmd)
 {
 	printk("Bad pmd in pte_alloc: %08lx\n", pmd_val(*pmd));
+#ifdef CONFIG_DEBUG_ERRORS
+	__backtrace();
+#endif
+	set_pmd(pmd, mk_pmd(BAD_PAGETABLE));
+}
+
+void __bad_pmd_kernel(pmd_t *pmd)
+{
+	printk("Bad pmd in pte_alloc_kernel: %08lx\n", pmd_val(*pmd));
+#ifdef CONFIG_DEBUG_ERRORS
+	__backtrace();
+#endif
 	set_pmd(pmd, mk_pmd(BAD_PAGETABLE));
 }
 
@@ -65,7 +79,7 @@
 	}
 	kfree (pte);
 	if (pmd_bad(*pmd)) {
-		__bad_pte(pmd);
+		__bad_pmd(pmd);
 		return NULL;
 	}
 	return (pte_t *) pmd_page(*pmd) + offset;
@@ -145,11 +159,11 @@
 bad_area:
 	up(&mm->mmap_sem);
 	if (mode & FAULT_CODE_USER) {
-extern int console_loglevel;
-cli();
+//extern int console_loglevel;
+//cli();
 		tsk->tss.error_code = mode;
 		tsk->tss.trap_no = 14;
-console_loglevel = 9;
+//console_loglevel = 9;
 		printk ("%s: memory violation at pc=0x%08lx, lr=0x%08lx (bad address=0x%08lx, code %d)\n",
 			tsk->comm, regs->ARM_pc, regs->ARM_lr, addr, mode);
 //#ifdef DEBUG
@@ -157,7 +171,7 @@
 		c_backtrace (regs->ARM_fp, 0);
 //#endif
 		force_sig(SIGSEGV, tsk);
-while (1);
+//while (1);
 		goto out;
 	}
 

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