Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH] wrong use of compute_return_epc() in /mips/kernel/traps.c
@ 2001-07-24  6:04 Thiemo Seufer
  2001-07-30 18:46 ` Maciej W. Rozycki
  0 siblings, 1 reply; 8+ messages in thread
From: Thiemo Seufer @ 2001-07-24  6:04 UTC (permalink / raw)
  To: linux-mips

Hi All,

somebody made wrong assumptions about how compute_return_epc() works.
It does not return the epc but stores it in the register struct.
Return value is -EFAULT or zero.

I've speculated below how the right solution might look, but I
don't know enough about signal handling to be sure.


Thiemo


diff -BurPX /bigdisk/src/dontdiff linux-orig/arch/mips/kernel/traps.c linux/arch/mips/kernel/traps.c
--- linux-orig/arch/mips/kernel/traps.c	Sat Jul 14 18:49:46 2001
+++ linux/arch/mips/kernel/traps.c	Sun Jul 22 08:44:57 2001
@@ -378,8 +378,11 @@
 		else
 			info.si_code = FPE_INTOVF;
 		info.si_signo = SIGFPE;
-		info.si_errno = 0;
-		info.si_addr = (void *)compute_return_epc(regs);
+		info.si_errno = compute_return_epc(regs);
+		if (info.si_errno)
+			info.si_addr = NULL;
+		else
+			info.si_addr = (void *)regs->cp0_epc;
 		force_sig_info(SIGFPE, &info, current);
 		break;
 	default:
@@ -418,8 +421,11 @@
 		else
 			info.si_code = FPE_INTOVF;
 		info.si_signo = SIGFPE;
-		info.si_errno = 0;
-		info.si_addr = (void *)compute_return_epc(regs);
+		info.si_errno = compute_return_epc(regs);
+		if (info.si_errno)
+			info.si_addr = NULL;
+		else
+			info.si_addr = (void *)regs->cp0_epc;
 		force_sig_info(SIGFPE, &info, current);
 		break;
 	default:

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

end of thread, other threads:[~2001-07-30 22:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-07-24  6:04 [PATCH] wrong use of compute_return_epc() in /mips/kernel/traps.c Thiemo Seufer
2001-07-30 18:46 ` Maciej W. Rozycki
2001-07-30 20:13   ` Kevin D. Kissell
2001-07-30 20:13     ` Kevin D. Kissell
2001-07-30 20:41     ` Maciej W. Rozycki
2001-07-30 21:48       ` Kevin D. Kissell
2001-07-30 21:48         ` Kevin D. Kissell
2001-07-30 22:31         ` Maciej W. Rozycki

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