diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c index e25f5f9bb8c9..300c852fdf90 100644 --- a/sys/arch/sparc/sparc/machdep.c +++ b/sys/arch/sparc/sparc/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.323 2012/07/31 14:23:34 martin Exp $ */ +/* $NetBSD: machdep.c,v 1.324 2012/09/13 11:49:16 martin Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.323 2012/07/31 14:23:34 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.324 2012/09/13 11:49:16 martin Exp $"); #include "opt_compat_netbsd.h" #include "opt_compat_sunos.h" @@ -633,7 +633,7 @@ cpu_getmcontext(struct lwp *l, mcontext_t *mcp, unsigned int *flags) r[_REG_O6] = tf->tf_out[6]; r[_REG_O7] = tf->tf_out[7]; - *flags |= _UC_CPU; + *flags |= (_UC_CPU|_UC_TLSBASE); #ifdef FPU_CONTEXT /* @@ -739,7 +739,8 @@ cpu_setmcontext(struct lwp *l, const mcontext_t *mcp, unsigned int flags) tf->tf_global[4] = r[_REG_G4]; tf->tf_global[5] = r[_REG_G5]; tf->tf_global[6] = r[_REG_G6]; - tf->tf_global[7] = r[_REG_G7]; + /* done in lwp_setprivate */ + /* tf->tf_global[7] = r[_REG_G7]; */ tf->tf_out[0] = r[_REG_O0]; tf->tf_out[1] = r[_REG_O1]; @@ -750,7 +751,8 @@ cpu_setmcontext(struct lwp *l, const mcontext_t *mcp, unsigned int flags) tf->tf_out[6] = r[_REG_O6]; tf->tf_out[7] = r[_REG_O7]; - lwp_setprivate(l, (void *)(uintptr_t)r[_REG_G7]); + if (flags & _UC_TLSBASE) + lwp_setprivate(l, (void *)(uintptr_t)r[_REG_G7]); } #ifdef FPU_CONTEXT