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 New fpu handling code.
details: https://anonhg.NetBSD.org/src/rev/7cf9ac309648
branches: trunk
changeset: 512090:7cf9ac309648
user: eeh <eeh%NetBSD.org@localhost>
date: Thu Jul 05 06:34:56 2001 +0000
description:
New fpu handling code.
diffstat:
sys/arch/sparc64/sparc64/trap.c | 33 ++++++++++++++++++++-------------
1 files changed, 20 insertions(+), 13 deletions(-)
diffs (58 lines):
diff -r 4962f80a8eee -r 7cf9ac309648 sys/arch/sparc64/sparc64/trap.c
--- a/sys/arch/sparc64/sparc64/trap.c Thu Jul 05 06:29:49 2001 +0000
+++ b/sys/arch/sparc64/sparc64/trap.c Thu Jul 05 06:34:56 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.68 2001/06/21 00:10:49 eeh Exp $ */
+/* $NetBSD: trap.c,v 1.69 2001/07/05 06:34:56 eeh Exp $ */
/*
* Copyright (c) 1996
@@ -584,6 +584,7 @@
* the FPU.
*/
if (type == T_FPDISABLED) {
+extern void db_printf(const char * , ...);
#ifndef NEW_FPSTATE
if (fpproc != NULL) { /* someone else had it */
savefpstate(fpproc->p_md.md_fpstate);
@@ -594,22 +595,28 @@
tf->tf_tstate |= (PSTATE_PEF<<TSTATE_PSTATE_SHIFT);
return;
#else
+ struct proc *newfpproc;
+
/* New scheme */
- if (fpproc != NULL) { /* someone else had it, maybe? */
- savefpstate(fpproc->p_md.md_fpstate);
- fpproc = NULL;
- /* Enable the FPU */
- }
if (CLKF_INTR((struct clockframe *)tf) || !curproc) {
- fpproc = &proc0;
+ newfpproc = &proc0;
} else {
- fpproc = curproc;
+ newfpproc = curproc;
}
- /* If we have an allocated fpstate then load it */
- if (fpproc->p_md.md_fpstate != 0)
- loadfpstate(fpproc->p_md.md_fpstate);
- else
- fpproc = NULL;
+ if (fpproc != newfpproc) {
+ if (fpproc != NULL) {
+ /* someone else had it, maybe? */
+ savefpstate(fpproc->p_md.md_fpstate);
+ fpproc = NULL;
+ }
+ /* If we have an allocated fpstate, load it */
+ if (newfpproc->p_md.md_fpstate != 0) {
+ fpproc = newfpproc;
+ loadfpstate(fpproc->p_md.md_fpstate);
+ } else
+ fpproc = NULL;
+ }
+ /* Enable the FPU */
tf->tf_tstate |= (PSTATE_PEF<<TSTATE_PSTATE_SHIFT);
return;
#endif
Home |
Main Index |
Thread Index |
Old Index