Update of /cvsroot/linux-mips/linux/arch/mips/mm
In directory usw-pr-cvs1:/tmp/cvs-serv7143
Modified Files:
fault.c
Log Message:
Synced to Ralph's tree. We already fixed this problem.
Index: fault.c
===================================================================
RCS file: /cvsroot/linux-mips/linux/arch/mips/mm/fault.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- fault.c 2001/10/22 21:04:22 1.4
+++ fault.c 2001/10/29 17:33:15 1.5
@@ -33,6 +33,39 @@
*/
#define dpf_reg(r) (regs->regs[r])
+extern spinlock_t timerlist_lock;
+
+/*
+ * Unlock any spinlocks which will prevent us from getting the
+ * message out (timerlist_lock is acquired through the
+ * console unblank code)
+ */
+void bust_spinlocks(int yes)
+{
+ spin_lock_init(&timerlist_lock);
+ if (yes) {
+ oops_in_progress = 1;
+#ifdef CONFIG_SMP
+ /* Many serial drivers do __global_cli() */
+ global_irq_lock = SPIN_LOCK_UNLOCKED;
+#endif
+ } else {
+ int loglevel_save = console_loglevel;
+#ifdef CONFIG_VT
+ unblank_screen();
+#endif
+ oops_in_progress = 0;
+ /*
+ * OK, the message is on the console. Now we call printk()
+ * without oops_in_progress set so that printk will give klogd
+ * a poke. Hold onto your hats...
+ */
+ console_loglevel = 15; /* NMI oopser may have shut the console up */
+ printk(" ");
+ console_loglevel = loglevel_save;
+ }
+}
+
/*
* This routine handles page faults. It determines the address,
* and the problem, and then passes it off to one of the appropriate
@@ -95,12 +128,12 @@
goto bad_area;
}
+survive:
/*
* If for any reason at all we couldn't handle the fault,
* make sure we exit gracefully rather than endlessly redo
* the fault.
*/
-survive:
switch (handle_mm_fault(mm, vma, address, write)) {
case 1:
tsk->min_flt++;
@@ -169,6 +202,7 @@
"address %08lx, epc == %08lx, ra == %08lx\n",
address, regs->cp0_epc, regs->regs[31]);
die("Oops", regs);
+ bust_spinlock(0);
do_exit(SIGKILL);
/*
@@ -177,8 +211,8 @@
*/
out_of_memory:
up_read(&mm->mmap_sem);
- if (current->pid == 1) {
- current->policy |= SCHED_YIELD;
+ if (tsk->pid == 1) {
+ tsk->policy |= SCHED_YIELD;
schedule();
down_read(&mm->mmap_sem);
goto survive;
@@ -196,7 +230,7 @@
* or user mode.
*/
tsk->thread.cp0_badvaddr = address;
- info.si_code = SIGBUS;
+ info.si_signo = SIGBUS;
info.si_errno = 0;
info.si_code = BUS_ADRERR;
info.si_addr = (void *) address;
|