Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [patch] simulate_ll and simulate_sc(resend)
@ 2003-03-03 10:21 Yoichi Yuasa
  2003-03-04 12:07 ` Ralf Baechle
  2003-03-04 20:36 ` Ralf Baechle
  0 siblings, 2 replies; 5+ messages in thread
From: Yoichi Yuasa @ 2003-03-03 10:21 UTC (permalink / raw)
  To: ralf; +Cc: yoichi_yuasa, linux-mips, jsun

[-- Attachment #1: Type: text/plain, Size: 331 bytes --]

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

[-- Attachment #2: llsc-v24-0303.diff --]
[-- Type: text/plain, Size: 722 bytes --]

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);
 }
 

[-- Attachment #3: llsc-v25-0303.diff --]
[-- Type: text/plain, Size: 722 bytes --]

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);
 }
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-03-10  3:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-03 10:21 [patch] simulate_ll and simulate_sc(resend) Yoichi Yuasa
2003-03-04 12:07 ` Ralf Baechle
2003-03-04 20:36 ` Ralf Baechle
2003-03-06  7:53   ` Yoichi Yuasa
2003-03-10  3:41     ` Yoichi Yuasa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox