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 In calculating initial tstate, cast...



details:   https://anonhg.NetBSD.org/src/rev/f16895d0388a
branches:  trunk
changeset: 749546:f16895d0388a
user:      nakayama <nakayama%NetBSD.org@localhost>
date:      Wed Dec 02 10:18:42 2009 +0000

description:
In calculating initial tstate, cast to 64-bit first to avoid sign extension.

diffstat:

 sys/arch/sparc64/sparc64/machdep.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (30 lines):

diff -r b3e86b0a60c6 -r f16895d0388a sys/arch/sparc64/sparc64/machdep.c
--- a/sys/arch/sparc64/sparc64/machdep.c        Wed Dec 02 09:34:51 2009 +0000
+++ b/sys/arch/sparc64/sparc64/machdep.c        Wed Dec 02 10:18:42 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.248 2009/11/21 04:16:52 rmind Exp $ */
+/*     $NetBSD: machdep.c,v 1.249 2009/12/02 10:18:42 nakayama 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.248 2009/11/21 04:16:52 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.249 2009/12/02 10:18:42 nakayama Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -270,9 +270,8 @@
                break;
        }
 #endif
-       tstate = (ASI_PRIMARY_NO_FAULT<<TSTATE_ASI_SHIFT) |
-               ((pstate)<<TSTATE_PSTATE_SHIFT) | 
-               (tf->tf_tstate & TSTATE_CWP);
+       tstate = ((int64_t)ASI_PRIMARY_NO_FAULT << TSTATE_ASI_SHIFT) |
+           (pstate << TSTATE_PSTATE_SHIFT) | (tf->tf_tstate & TSTATE_CWP);
        if ((fs = l->l_md.md_fpstate) != NULL) {
                /*
                 * We hold an FPU state.  If we own *the* FPU chip state



Home | Main Index | Thread Index | Old Index