Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64/sparc64 Adapt for _UC_TLSBASE



details:   https://anonhg.NetBSD.org/src/rev/bd37bf658ea0
branches:  trunk
changeset: 781535:bd37bf658ea0
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Sep 13 11:53:45 2012 +0000

description:
Adapt for _UC_TLSBASE

diffstat:

 sys/arch/sparc64/sparc64/machdep.c          |  12 ++++++++----
 sys/arch/sparc64/sparc64/netbsd32_machdep.c |  16 +++++++++-------
 2 files changed, 17 insertions(+), 11 deletions(-)

diffs (108 lines):

diff -r f0fb5ceb6d01 -r bd37bf658ea0 sys/arch/sparc64/sparc64/machdep.c
--- a/sys/arch/sparc64/sparc64/machdep.c        Thu Sep 13 11:49:16 2012 +0000
+++ b/sys/arch/sparc64/sparc64/machdep.c        Thu Sep 13 11:53:45 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.269 2012/07/28 19:08:25 matt Exp $ */
+/*     $NetBSD: machdep.c,v 1.270 2012/09/13 11:53:45 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.269 2012/07/28 19:08:25 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.270 2012/09/13 11:53:45 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -2492,7 +2492,7 @@
                gr[_REG_nPC] = ras_pc + 4;
        }
 
-       *flags |= _UC_CPU;
+       *flags |= (_UC_CPU|_UC_TLSBASE);
 
        mcp->__gwins = NULL;
 
@@ -2581,7 +2581,8 @@
                tf->tf_global[4] = (uint64_t)gr[_REG_G4];
                tf->tf_global[5] = (uint64_t)gr[_REG_G5];
                tf->tf_global[6] = (uint64_t)gr[_REG_G6];
-               tf->tf_global[7] = (uint64_t)gr[_REG_G7];
+               /* done in lwp_setprivate */
+               /* tf->tf_global[7] = (uint64_t)gr[_REG_G7]; */
                tf->tf_out[0]    = (uint64_t)gr[_REG_O0];
                tf->tf_out[1]    = (uint64_t)gr[_REG_O1];
                tf->tf_out[2]    = (uint64_t)gr[_REG_O2];
@@ -2593,6 +2594,9 @@
                /* %asi restored above; %fprs not yet supported. */
 
                /* XXX mcp->__gwins */
+
+               if (flags & _UC_TLSBASE)
+                       lwp_setprivate(l, (void *)(uintptr_t)gr[_REG_G7]);
        }
 
        /* Restore FP register context, if any. */
diff -r f0fb5ceb6d01 -r bd37bf658ea0 sys/arch/sparc64/sparc64/netbsd32_machdep.c
--- a/sys/arch/sparc64/sparc64/netbsd32_machdep.c       Thu Sep 13 11:49:16 2012 +0000
+++ b/sys/arch/sparc64/sparc64/netbsd32_machdep.c       Thu Sep 13 11:53:45 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep.c,v 1.98 2012/05/21 14:15:18 martin Exp $     */
+/*     $NetBSD: netbsd32_machdep.c,v 1.99 2012/09/13 11:53:45 martin Exp $     */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.98 2012/05/21 14:15:18 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.99 2012/09/13 11:53:45 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -777,7 +777,7 @@
        gr[_REG_O5]  = tf->tf_out[5];
        gr[_REG_O6]  = tf->tf_out[6];
        gr[_REG_O7]  = tf->tf_out[7];
-       *flags |= _UC_CPU;
+       *flags |= (_UC_CPU|_UC_TLSBASE);
 
        mcp->__gwins = 0;
 
@@ -1186,7 +1186,8 @@
                tf->tf_global[4] = (uint64_t)gr[_REG32_G4];
                tf->tf_global[5] = (uint64_t)gr[_REG32_G5];
                tf->tf_global[6] = (uint64_t)gr[_REG32_G6];
-               tf->tf_global[7] = (uint64_t)gr[_REG32_G7];
+               /* done in lwp_setprivate */
+               /* tf->tf_global[7] = (uint64_t)gr[_REG32_G7]; */
                tf->tf_out[0]    = (uint64_t)gr[_REG32_O0];
                tf->tf_out[1]    = (uint64_t)gr[_REG32_O1];
                tf->tf_out[2]    = (uint64_t)gr[_REG32_O2];
@@ -1197,7 +1198,8 @@
                tf->tf_out[7]    = (uint64_t)gr[_REG32_O7];
                /* %asi restored above; %fprs not yet supported. */
 
-               lwp_setprivate(l, (void *)(uintptr_t)gr[_REG_G7]);
+               if (flags & _UC_TLSBASE)
+                       lwp_setprivate(l, (void *)(uintptr_t)gr[_REG32_G7]);
 
                /* XXX mcp->__gwins */
        }
@@ -1281,11 +1283,11 @@
        gr[_REG32_O5]  = tf->tf_out[5];
        gr[_REG32_O6]  = tf->tf_out[6];
        gr[_REG32_O7]  = tf->tf_out[7];
-       *flags |= _UC_CPU;
+       *flags |= (_UC_CPU|_UC_TLSBASE);
 
        mcp->__gwins = 0;
        mcp->__xrs.__xrs_id = 0;        /* Solaris extension? */
-       *flags |= _UC_CPU;
+       *flags |= (_UC_CPU|_UC_TLSBASE);
 
        /* Save FP register context, if any. */
        if (l->l_md.md_fpstate != NULL) {



Home | Main Index | Thread Index | Old Index