Module Name: src
Committed By: nakayama
Date: Wed Dec 2 10:18:42 UTC 2009
Modified Files:
src/sys/arch/sparc64/sparc64: machdep.c
Log Message:
In calculating initial tstate, cast to 64-bit first to avoid sign extension.
To generate a diff of this commit:
cvs rdiff -u -r1.248 -r1.249 src/sys/arch/sparc64/sparc64/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/sparc64/sparc64/machdep.c
diff -u src/sys/arch/sparc64/sparc64/machdep.c:1.248 src/sys/arch/sparc64/sparc64/machdep.c:1.249
--- src/sys/arch/sparc64/sparc64/machdep.c:1.248 Sat Nov 21 04:16:52 2009
+++ src/sys/arch/sparc64/sparc64/machdep.c Wed Dec 2 10:18:42 2009
@@ -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