Do not bother to save fpu state when we are about to get rid of it.

This commit is contained in:
martin 2006-09-15 07:42:38 +00:00
parent d49ab36123
commit 092e3c8b7a
3 changed files with 17 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.55 2006/09/13 11:35:53 mrg Exp $ */ /* $NetBSD: cpu.h,v 1.56 2006/09/15 07:42:38 martin Exp $ */
/* /*
* Copyright (c) 1992, 1993 * Copyright (c) 1992, 1993
@ -307,6 +307,7 @@ int statintr(void *); /* level 14 (statclock) interrupt code */
struct fpstate64; struct fpstate64;
void savefpstate(struct fpstate64 *); void savefpstate(struct fpstate64 *);
void loadfpstate(struct fpstate64 *); void loadfpstate(struct fpstate64 *);
void clearfpstate(void);
uint64_t probeget(paddr_t, int, int); uint64_t probeget(paddr_t, int, int);
int probeset(paddr_t, int, int, uint64_t); int probeset(paddr_t, int, int, uint64_t);

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.215 2006/09/13 11:35:53 mrg Exp $ */ /* $NetBSD: locore.s,v 1.216 2006/09/15 07:42:38 martin Exp $ */
/* /*
* Copyright (c) 1996-2002 Eduardo Horvath * Copyright (c) 1996-2002 Eduardo Horvath
@ -10232,6 +10232,17 @@ Lkcerr:
mov EFAULT, %o0 mov EFAULT, %o0
NOTREACHED NOTREACHED
/*
* clearfpstate()
*
* Drops the current fpu state, without saving it.
*/
ENTRY(clearfpstate)
rdpr %pstate, %o1 ! enable FPU
wr %g0, FPRS_FEF, %fprs
or %o1, PSTATE_PEF, %o1
retl
wrpr %o1, 0, %pstate
/* /*
* savefpstate(f) struct fpstate *f; * savefpstate(f) struct fpstate *f;

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.64 2006/08/31 16:49:21 matt Exp $ */ /* $NetBSD: vm_machdep.c,v 1.65 2006/09/15 07:42:38 martin Exp $ */
/* /*
* Copyright (c) 1996-2002 Eduardo Horvath. All rights reserved. * Copyright (c) 1996-2002 Eduardo Horvath. All rights reserved.
@ -50,7 +50,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.64 2006/08/31 16:49:21 matt Exp $"); __KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.65 2006/09/15 07:42:38 martin Exp $");
#include "opt_coredump.h" #include "opt_coredump.h"
@ -325,7 +325,7 @@ cpu_lwp_free(l, proc)
if ((fs = l->l_md.md_fpstate) != NULL) { if ((fs = l->l_md.md_fpstate) != NULL) {
if (l == fplwp) { if (l == fplwp) {
savefpstate(fs); clearfpstate();
fplwp = NULL; fplwp = NULL;
} }
free((void *)fs, M_SUBPROC); free((void *)fs, M_SUBPROC);