Module Name:    src
Committed By:   skrll
Date:           Wed Aug 10 16:45:24 UTC 2016

Modified Files:
        src/lib/libc/arch/mips/sys: getcontext.S

Log Message:
We need to save the GP of the caller in the context for n32/n64


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/mips/sys/getcontext.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/mips/sys/getcontext.S
diff -u src/lib/libc/arch/mips/sys/getcontext.S:1.4 src/lib/libc/arch/mips/sys/getcontext.S:1.5
--- src/lib/libc/arch/mips/sys/getcontext.S:1.4	Mon Dec 14 01:07:42 2009
+++ src/lib/libc/arch/mips/sys/getcontext.S	Wed Aug 10 16:45:24 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: getcontext.S,v 1.4 2009/12/14 01:07:42 matt Exp $	*/
+/*	$NetBSD: getcontext.S,v 1.5 2016/08/10 16:45:24 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #include <machine/mcontext.h>
 
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: getcontext.S,v 1.4 2009/12/14 01:07:42 matt Exp $")
+	RCSID("$NetBSD: getcontext.S,v 1.5 2016/08/10 16:45:24 skrll Exp $")
 #endif /* SYSLIBC_SCCS && !lint */
 
 #ifdef WEAK_ALIAS
@@ -48,6 +48,10 @@ LEAF(_getcontext)
 	bne		a3, zero, 1f
 	REG_PROLOGUE
 	REG_S		zero, (_OFFSETOF_UC_GREGS + _REG_V0 * SZREG)(a0)
+#if !defined(__mips_o32)
+	/* PIC_PROLOGUE saved gp in t3 */
+	REG_S		t3, (_OFFSETOF_UC_GREGS + _REG_GP * SZREG)(a0)
+#endif
 	REG_S		ra, (_OFFSETOF_UC_GREGS + _REG_EPC * SZREG)(a0)
 	REG_EPILOGUE
 	PIC_RETURN()

Reply via email to