diff options
author | jake <jake@FreeBSD.org> | 2001-12-29 09:55:37 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2001-12-29 09:55:37 +0000 |
commit | a8a4f464ef3be5855f90f0e3584695a16e21f679 (patch) | |
tree | 742c59113c171e963de7cc2df1163d2fd1fd08c6 | |
parent | 30c904f5f230322ea655acad566685e88d6f0ca2 (diff) | |
download | FreeBSD-src-a8a4f464ef3be5855f90f0e3584695a16e21f679.zip FreeBSD-src-a8a4f464ef3be5855f90f0e3584695a16e21f679.tar.gz |
Make these compile.
-rw-r--r-- | sys/sparc64/sparc64/emul.c | 1 | ||||
-rw-r--r-- | sys/sparc64/sparc64/fp.c | 38 | ||||
-rw-r--r-- | sys/sparc64/sparc64/trap.c | 3 |
3 files changed, 18 insertions, 24 deletions
diff --git a/sys/sparc64/sparc64/emul.c b/sys/sparc64/sparc64/emul.c index b2eaa47..d77dc9d 100644 --- a/sys/sparc64/sparc64/emul.c +++ b/sys/sparc64/sparc64/emul.c @@ -33,7 +33,6 @@ #include <sys/sysctl.h> #include <sys/systm.h> -#include <machine/emul.h> #include <machine/frame.h> #include <machine/instr.h> diff --git a/sys/sparc64/sparc64/fp.c b/sys/sparc64/sparc64/fp.c index c66041c..b49cf6b 100644 --- a/sys/sparc64/sparc64/fp.c +++ b/sys/sparc64/sparc64/fp.c @@ -39,9 +39,13 @@ #include <machine/tstate.h> void -fp_init_thread(struct pcb *pcb) +fp_init_thread(struct thread *td) { + struct trapframe *tf; + struct pcb *pcb; + pcb = td->td_pcb; + tf = td->td_frame; bzero(&pcb->pcb_fpstate.fp_fb, sizeof(pcb->pcb_fpstate.fp_fb)); #if 0 pcb->pcb_fpstate.fp_fsr = 0; @@ -53,9 +57,9 @@ fp_init_thread(struct pcb *pcb) * This does of course reduce the accuracy, so it should be removed * as soon as possible. */ - pcb->pcb_fpstate.fp_fsr = FSR_NS; + tf->tf_fsr = FSR_NS; #endif - wr(fprs, 0, 0); + tf->tf_fprs = 0; } int @@ -66,23 +70,17 @@ fp_enable_thread(struct thread *td, struct trapframe *tf) pcb = td->td_pcb; CTR5(KTR_TRAP, "fp_enable_thread: tpc=%#lx, tnpc=%#lx, tstate=%#lx, " "fprs=%#lx, fsr=%#lx", tf->tf_tpc, tf->tf_tnpc, tf->tf_tstate, - pcb->pcb_fpstate.fp_fprs, pcb->pcb_fpstate.fp_fsr); - if ((tf->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 ((tf->tf_tstate & TSTATE_PEF) != 0) + tf->tf_fprs, tf->tf_fsr); + if ((tf->tf_fprs & FPRS_FEF) != 0) return (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... + */ + tf->tf_fprs |= FPRS_FEF; mtx_lock_spin(&sched_lock); - tf->tf_tstate |= TSTATE_PEF; - /* Actually load the FP state into the registers. */ restorefpctx(&pcb->pcb_fpstate); mtx_unlock_spin(&sched_lock); return (1); @@ -91,11 +89,9 @@ fp_enable_thread(struct thread *td, struct trapframe *tf) int fp_exception_other(struct thread *td, struct trapframe *tf) { - u_long fsr; - __asm __volatile("stx %%fsr, %0" : "=m" (fsr)); CTR4(KTR_TRAP, "fp_exception_other: tpc=%#lx, tnpc=%#lx, ftt=%lx " - "fsr=%lx", tf->tf_tpc, tf->tf_tnpc, FSR_FTT(fsr), fsr); + "fsr=%lx", tf->tf_tpc, tf->tf_tnpc, FSR_FTT(tf->tf_fsr), tf->tf_fsr); /* XXX: emulate unimplemented and unfinished instructions. */ return (SIGFPE); } diff --git a/sys/sparc64/sparc64/trap.c b/sys/sparc64/sparc64/trap.c index f65b2e8..1d9780d 100644 --- a/sys/sparc64/sparc64/trap.c +++ b/sys/sparc64/sparc64/trap.c @@ -67,7 +67,6 @@ #include <vm/vm_zone.h> #include <machine/clock.h> -#include <machine/emul.h> #include <machine/frame.h> #include <machine/intr_machdep.h> #include <machine/pcb.h> @@ -216,7 +215,7 @@ if ((type & ~T_KERNEL) != T_BREAKPOINT) case T_FP_EXCEPTION_IEEE_754: case T_FP_EXCEPTION_OTHER: mtx_lock(&Giant); - if ((sig = fp_exception(td, tf, &ucode)) == 0) { + if ((sig = fp_exception_other(td, tf, &ucode)) == 0) { mtx_unlock(&Giant); TF_DONE(tf); goto user; |