Module Name:    src
Committed By:   martin
Date:           Thu Mar  1 17:15:14 UTC 2018

Modified Files:
        src/lib/libc/arch/powerpc [netbsd-8]: genassym.cf
        src/lib/libc/arch/powerpc/gen [netbsd-8]: swapcontext.S

Log Message:
Pull up following revision(s) (requested by uwe in ticket #596):
        lib/libc/arch/powerpc/genassym.cf: revision 1.5
        lib/libc/arch/powerpc/gen/swapcontext.S: revision 1.8
PIC code clobbers %r30 so we need to update the saved oucp with
caller's %r30 manually.  Makes old context happy when it needs to do
more function calls after restore.
PIC code clobbers %r30 so we need to update the saved oucp with
caller's %r30 manually.  Makes old context happy when it needs to do
more function calls after restore.
(oops, forgot to commit this along with swapcontext.S)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.18.1 src/lib/libc/arch/powerpc/genassym.cf
cvs rdiff -u -r1.7 -r1.7.18.1 src/lib/libc/arch/powerpc/gen/swapcontext.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/powerpc/genassym.cf
diff -u src/lib/libc/arch/powerpc/genassym.cf:1.4 src/lib/libc/arch/powerpc/genassym.cf:1.4.18.1
--- src/lib/libc/arch/powerpc/genassym.cf:1.4	Fri Aug 30 21:28:59 2013
+++ src/lib/libc/arch/powerpc/genassym.cf	Thu Mar  1 17:15:13 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.4 2013/08/30 21:28:59 matt Exp $
+#	$NetBSD: genassym.cf,v 1.4.18.1 2018/03/01 17:15:13 martin Exp $
 
 #
 # Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -44,6 +44,7 @@ define CALLFRAME_R31	offsetof(struct cal
 
 define UC_GREGS_R1	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R1])
 define UC_GREGS_R3	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R3])
+define UC_GREGS_R30	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R30])
 define UC_GREGS_PC	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_PC])
 
 define SIG_BLOCK	SIG_BLOCK

Index: src/lib/libc/arch/powerpc/gen/swapcontext.S
diff -u src/lib/libc/arch/powerpc/gen/swapcontext.S:1.7 src/lib/libc/arch/powerpc/gen/swapcontext.S:1.7.18.1
--- src/lib/libc/arch/powerpc/gen/swapcontext.S:1.7	Thu Sep 12 15:36:15 2013
+++ src/lib/libc/arch/powerpc/gen/swapcontext.S	Thu Mar  1 17:15:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: swapcontext.S,v 1.7 2013/09/12 15:36:15 joerg Exp $	*/
+/*	$NetBSD: swapcontext.S,v 1.7.18.1 2018/03/01 17:15:14 martin Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "SYS.h"
 #include "assym.h"
 
-__RCSID("$NetBSD: swapcontext.S,v 1.7 2013/09/12 15:36:15 joerg Exp $")
+__RCSID("$NetBSD: swapcontext.S,v 1.7.18.1 2018/03/01 17:15:14 martin Exp $")
 
 #define	XCALLFRAMELEN	(((2+3)*SZREG + CALLFRAMELEN - 1) & -CALLFRAMELEN)
 #define	XCALLFRAME_R30	(XCALLFRAMELEN-1*SZREG)
@@ -57,6 +57,10 @@ ENTRY(swapcontext)
 	stw	%r0,UC_GREGS_PC(%r11)		# pc <- lr
 	addi	%r0,%r1,XCALLFRAMELEN
 	stw	%r0,UC_GREGS_R1(%r11)		# adjust sp
+#ifdef __PIC__
+	lwz	%r0,XCALLFRAME_R30(%r1)
+	stw	%r0,UC_GREGS_R30(%r11)		# caller's r30
+#endif
 	lwz	%r3,XCALLFRAME_UCP(%r1)		# load ucp
 	bl	PIC_PLT(_C_LABEL(setcontext))	# setcontext(ucp)
 1:

Reply via email to