This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][SH] setjmp fix


Somehow my previous patch* was missing an important part. I think I must have posted the wrong version.

The result is that, when GLIBC is configured for SH4_NOFPU, it does not load register contents from the same address to which they were saved. Clearly this is not good.

Here's the fix to complete the patch. It uses the exact same idiom used in the SH3 file.

OK?

Andrew

* http://sourceware.org/ml/libc-alpha/2009-02/msg00019.html
2009-04-22  Andrew Stubbs  <ams@codesourcery.com>

	* sysdeps/sh/sh4/setjmp.S (__sigsetjmp): Adjust JB_SIZE when there
	is no FPU.

---
 libc/sysdeps/sh/sh4/setjmp.S |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

Index: libc/sysdeps/sh/sh4/setjmp.S
===================================================================
--- libc/sysdeps/sh/sh4/setjmp.S.orig
+++ libc/sysdeps/sh/sh4/setjmp.S
@@ -22,13 +22,15 @@
 
 ENTRY (__sigsetjmp)
 	/* Save registers */
-	add	#JB_SIZE, r4
 #ifdef __SH_FPU_ANY__
+	add	#JB_SIZE, r4
 	fmov.s	fr15, @-r4
 	fmov.s	fr14, @-r4
 	fmov.s	fr13, @-r4
 	fmov.s	fr12, @-r4
 	sts.l	fpscr, @-r4
+#else
+	add	#(JB_SIZE - 4 * 5), r4
 #endif /* __SH_FPU_ANY__ */
 	stc.l	gbr, @-r4
 #ifdef PTR_MANGLE

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]