patch-2.1.37 linux/arch/mips/kernel/traps.c

Next file: linux/arch/ppc/kernel/misc.S
Previous file: linux/arch/mips/kernel/syscalls.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.36/linux/arch/mips/kernel/traps.c linux/arch/mips/kernel/traps.c
@@ -178,6 +178,7 @@
 
 void do_ades(struct pt_regs *regs)
 {
+	struct task_struct *p;
 	unsigned long	pc = regs->cp0_epc;
 	int	i;
 
@@ -187,12 +188,14 @@
 		return;
 	}
 while(1);
-	for(i=0; i<NR_TASKS;i++)
-		if(task[i] && task[i]->pid >= 2)
-		{
-			printk("Process %d\n", task[i]->pid);
-			dump_list_process(task[i], pc);
+	read_lock(&tasklist_lock);
+	for_each_task(p) {
+		if(p->pid >= 2) {
+			printk("Process %d\n", p->pid);
+			dump_list_process(p, pc);
 		}
+	}
+	read_unlock(&tasklist_lock);
 	show_regs(regs);
 	dump_tlb_nonwired();
 	send_sig(SIGSEGV, current, 1);
@@ -251,14 +254,16 @@
 
 void do_ri(struct pt_regs *regs)
 {
+	struct task_struct *p;
 	int	i;
 
-	for(i=0; i<NR_TASKS;i++)
-		if(task[i] && task[i]->pid >= 2)
-		{
-			printk("Process %d\n", task[i]->pid);
-			dump_list_process(task[i], 0x7ffff000);
+	read_lock(&tasklist_lock);
+	for_each_task(p) {
+		if(p->pid >= 2) {
+			printk("Process %d\n", p->pid);
+			dump_list_process(p, 0x7ffff000);
 		}
+	}
 	show_regs(regs);
 while(1);
 	send_sig(SIGILL, current, 1);

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