summaryrefslogtreecommitdiffstats
path: root/sys/sparc64
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2001-08-20 23:56:19 +0000
committerjake <jake@FreeBSD.org>2001-08-20 23:56:19 +0000
commit56800e0ac6cad27bcaae6f8bf582a2896ba674dd (patch)
tree84af1d4cd4cd8389ca3e5e3e51621d4461928f42 /sys/sparc64
parenteed959d0e2115a67239bfe815fa541cdab02dd57 (diff)
downloadFreeBSD-src-56800e0ac6cad27bcaae6f8bf582a2896ba674dd.zip
FreeBSD-src-56800e0ac6cad27bcaae6f8bf582a2896ba674dd.tar.gz
Rename fp_init_pcb to fp_init_proc. Set the FEF bit in fprs register;
according the SCD it should be set if no user trap handler in set. Submitted by: tmm
Diffstat (limited to 'sys/sparc64')
-rw-r--r--sys/sparc64/include/fp.h2
-rw-r--r--sys/sparc64/sparc64/fp.c22
2 files changed, 19 insertions, 5 deletions
diff --git a/sys/sparc64/include/fp.h b/sys/sparc64/include/fp.h
index daabe0f..40400d0 100644
--- a/sys/sparc64/include/fp.h
+++ b/sys/sparc64/include/fp.h
@@ -75,7 +75,7 @@ struct fpstate {
u_long fp_fprs;
};
-void fp_init_pcb(struct pcb *);
+void fp_init_proc(struct pcb *);
int fp_enable_proc(struct proc *);
/*
* Note: The pointers passed to the next two functions must be aligned on
diff --git a/sys/sparc64/sparc64/fp.c b/sys/sparc64/sparc64/fp.c
index a6258bd..756869a 100644
--- a/sys/sparc64/sparc64/fp.c
+++ b/sys/sparc64/sparc64/fp.c
@@ -33,26 +33,40 @@
#include <machine/frame.h>
#include <machine/pcb.h>
+#include <machine/tstate.h>
void
-fp_init_pcb(struct pcb *pcb)
+fp_init_proc(struct pcb *pcb)
{
bzero(&pcb->pcb_fpstate.fp_fb, sizeof(pcb->pcb_fpstate.fp_fb));
- pcb->pcb_fpstate.fp_fsr = FSR_TEM_DZ;
- pcb->pcb_fpstate.fp_fprs = FPRS_FEF;
+ pcb->pcb_fpstate.fp_fsr = 0;
+ wr(fprs, 0, 0);
}
int
fp_enable_proc(struct proc *p)
{
+ struct pcb *pcb;
+
+ pcb = &p->p_addr->u_pcb;
+ if ((p->p_frame->tf_tstate & TSTATE_PEF) != 0 &&
+ (pcb->pcb_fpstate.fp_fprs & FPRS_FEF) == 0) {
+ /*
+ * Enable FEF for now. The SCD mandates that this should be
+ * done when no user trap is set. User traps are not currently
+ * supported...
+ */
+ wr(fprs, rd(fprs), FPRS_FEF);
+ return (1);
+ }
if ((p->p_frame->tf_tstate & TSTATE_PEF) != 0)
return (0);
mtx_lock_spin(&sched_lock);
p->p_frame->tf_tstate |= TSTATE_PEF;
/* Actually load the FP state into the registers. */
- restorefpctx(&p->p_addr->u_pcb.pcb_fpstate);
+ restorefpctx(&pcb->pcb_fpstate);
mtx_unlock_spin(&sched_lock);
return (1);
}
OpenPOWER on IntegriCloud