Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm Preserve/restore user r/w tpid in mcontext.



details:   https://anonhg.NetBSD.org/src/rev/5336d45ce63a
branches:  trunk
changeset: 336864:5336d45ce63a
user:      matt <matt%NetBSD.org@localhost>
date:      Tue Mar 24 08:38:29 2015 +0000

description:
Preserve/restore user r/w tpid in mcontext.

diffstat:

 sys/arch/arm/arm/sig_machdep.c  |  14 ++++++++++++--
 sys/arch/arm/include/mcontext.h |   5 +++--
 2 files changed, 15 insertions(+), 4 deletions(-)

diffs (67 lines):

diff -r 5ecb5733a927 -r 5336d45ce63a sys/arch/arm/arm/sig_machdep.c
--- a/sys/arch/arm/arm/sig_machdep.c    Tue Mar 24 07:44:52 2015 +0000
+++ b/sys/arch/arm/arm/sig_machdep.c    Tue Mar 24 08:38:29 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sig_machdep.c,v 1.48 2014/08/13 21:10:31 matt Exp $    */
+/*     $NetBSD: sig_machdep.c,v 1.49 2015/03/24 08:38:29 matt Exp $    */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -44,7 +44,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.48 2014/08/13 21:10:31 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.49 2015/03/24 08:38:29 matt Exp $");
 
 #include <sys/mount.h>         /* XXX only needed by syscallargs.h */
 #include <sys/cpu.h>
@@ -199,6 +199,11 @@
 
        mcp->_mc_tlsbase = (uintptr_t)l->l_private;
        *flags |= _UC_TLSBASE;
+
+#ifdef __PROG32
+       const struct pcb * const pcb = lwp_getpcb(l);
+       mcp->_mc_user_tpid = pcb->pcb_user_pid_rw;
+#endif
 }
 
 int
@@ -268,5 +273,10 @@
                l->l_sigstk.ss_flags &= ~SS_ONSTACK;
        mutex_exit(p->p_lock);
 
+#ifdef __PROG32
+       struct pcb * const pcb = lwp_getpcb(l);
+       pcb->pcb_user_pid_rw = mcp->_mc_user_tpid;
+#endif
+
        return (0);
 }
diff -r 5ecb5733a927 -r 5336d45ce63a sys/arch/arm/include/mcontext.h
--- a/sys/arch/arm/include/mcontext.h   Tue Mar 24 07:44:52 2015 +0000
+++ b/sys/arch/arm/include/mcontext.h   Tue Mar 24 08:38:29 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mcontext.h,v 1.17 2015/03/18 21:02:47 joerg Exp $      */
+/*     $NetBSD: mcontext.h,v 1.18 2015/03/24 08:38:29 matt Exp $       */
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -95,6 +95,7 @@
                __vfpregset_t __vfpregs;
        } __fpu;
        __greg_t        _mc_tlsbase;
+       __greg_t        _mc_user_tpid;
 } mcontext_t, mcontext32_t;
 
 /* Machine-dependent uc_flags */
@@ -106,7 +107,7 @@
 
 #define        _UC_TLSBASE     0x00080000
 
-#define _UC_MACHINE_PAD        2               /* Padding appended to ucontext_t */
+#define _UC_MACHINE_PAD        1               /* Padding appended to ucontext_t */
 
 #define _UC_MACHINE_SP(uc)     ((uc)->uc_mcontext.__gregs[_REG_SP])
 #define _UC_MACHINE_PC(uc)     ((uc)->uc_mcontext.__gregs[_REG_PC])



Home | Main Index | Thread Index | Old Index