[patch] simulate_ll and simulate_sc(resend)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ralf,

I found a bug in simulate_ll and simulate_sc.
The board that uses ll/sc emulation is not started.

When send_sig in these, in order not to operate the value of EPC correctly,
simulate_* happens continuously.

The previous patches were not perfect, I changed more.
Please apply these patches to CVS tree.

Thanks,

Yoichi
diff -aruN --exclude=CVS --exclude=.cvsignore linux.orig/arch/mips/kernel/traps.c linux/arch/mips/kernel/traps.c
--- linux.orig/arch/mips/kernel/traps.c	Tue Feb 11 07:50:48 2003
+++ linux/arch/mips/kernel/traps.c	Mon Mar  3 17:52:16 2003
@@ -140,6 +140,7 @@
 	return;
 
 sig:
+	compute_return_epc(regs);
 	send_sig(signal, current, 1);
 }
 
@@ -172,18 +173,19 @@
 	}
 	if (ll_bit == 0 || ll_task != current) {
 		regs->regs[reg] = 0;
-		goto sig;
 	}
 
-	if (put_user(regs->regs[reg], vaddr))
+	if (put_user(regs->regs[reg], vaddr)) {
 		signal = SIGSEGV;
-	else
+		goto sig;
+	} else
 		regs->regs[reg] = 1;
 
 	compute_return_epc(regs);
 	return;
 
 sig:
+	compute_return_epc(regs);
 	send_sig(signal, current, 1);
 }
 
diff -aruN --exclude=CVS --exclude=.cvsignore linux.orig/arch/mips/kernel/traps.c linux/arch/mips/kernel/traps.c
--- linux.orig/arch/mips/kernel/traps.c	Wed Feb 12 13:26:43 2003
+++ linux/arch/mips/kernel/traps.c	Mon Mar  3 17:48:11 2003
@@ -135,6 +135,7 @@
 	return;
 
 sig:
+	compute_return_epc(regs);
 	send_sig(signal, current, 1);
 }
 
@@ -167,18 +168,19 @@
 	}
 	if (ll_bit == 0 || ll_task != current) {
 		regs->regs[reg] = 0;
-		goto sig;
 	}
 
-	if (put_user(regs->regs[reg], vaddr))
+	if (put_user(regs->regs[reg], vaddr)) {
 		signal = SIGSEGV;
-	else
+		goto sig;
+	} else
 		regs->regs[reg] = 1;
 
 	compute_return_epc(regs);
 	return;
 
 sig:
+	compute_return_epc(regs);
 	send_sig(signal, current, 1);
 }
 

[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux