Module Name: src
Committed By: martin
Date: Thu Sep 13 11:49:16 UTC 2012
Modified Files:
src/sys/arch/sparc/sparc: machdep.c
Log Message:
Adapt for _UC_TLSBASE addition
To generate a diff of this commit:
cvs rdiff -u -r1.323 -r1.324 src/sys/arch/sparc/sparc/machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/sparc/sparc/machdep.c
diff -u src/sys/arch/sparc/sparc/machdep.c:1.323 src/sys/arch/sparc/sparc/machdep.c:1.324
--- src/sys/arch/sparc/sparc/machdep.c:1.323 Tue Jul 31 14:23:34 2012
+++ src/sys/arch/sparc/sparc/machdep.c Thu Sep 13 11:49:16 2012
@@ -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 <sys/cdefs.h>
-__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_
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 mco
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 mco
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