diff --git a/sys/arch/arm/arm/sig_machdep.c b/sys/arch/arm/arm/sig_machdep.c index f85731c75e4e..8d715969bac3 100644 --- a/sys/arch/arm/arm/sig_machdep.c +++ b/sys/arch/arm/arm/sig_machdep.c @@ -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 -__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 /* XXX only needed by syscallargs.h */ #include @@ -199,6 +199,11 @@ cpu_getmcontext(struct lwp *l, mcontext_t *mcp, unsigned int *flags) 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 @@ cpu_setmcontext(struct lwp *l, const mcontext_t *mcp, unsigned int flags) 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 --git a/sys/arch/arm/include/mcontext.h b/sys/arch/arm/include/mcontext.h index 12d1acc739e9..d0d0cc1cd3b8 100644 --- a/sys/arch/arm/include/mcontext.h +++ b/sys/arch/arm/include/mcontext.h @@ -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 @@ typedef struct { __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 @@ typedef struct { #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])