Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/lib/libc/arch/powerpc Pull up following revision(s) (requ...



details:   https://anonhg.NetBSD.org/src/rev/94d82d4489ce
branches:  netbsd-8
changeset: 851433:94d82d4489ce
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Mar 01 17:15:13 2018 +0000

description:
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)

diffstat:

 lib/libc/arch/powerpc/gen/swapcontext.S |  8 ++++++--
 lib/libc/arch/powerpc/genassym.cf       |  3 ++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diffs (46 lines):

diff -r 1f313f0fe5fd -r 94d82d4489ce lib/libc/arch/powerpc/gen/swapcontext.S
--- a/lib/libc/arch/powerpc/gen/swapcontext.S   Wed Feb 28 18:55:54 2018 +0000
+++ b/lib/libc/arch/powerpc/gen/swapcontext.S   Thu Mar 01 17:15:13 2018 +0000
@@ -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 @@
        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:
diff -r 1f313f0fe5fd -r 94d82d4489ce lib/libc/arch/powerpc/genassym.cf
--- a/lib/libc/arch/powerpc/genassym.cf Wed Feb 28 18:55:54 2018 +0000
+++ b/lib/libc/arch/powerpc/genassym.cf Thu Mar 01 17:15:13 2018 +0000
@@ -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 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



Home | Main Index | Thread Index | Old Index