diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2007-09-09 12:57:41 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2007-09-09 12:57:41 +0000 |
commit | a10d340a1b94fb8f5543f7d886e0f6649f8e846d (patch) | |
tree | 3b407bf8c01081bced8509f55baca6cf0d6bb338 | |
parent | c59518e8bf05d8494a56e3664893de452a616f72 (diff) |
Make fpproc per-cpu. This turns fpproc into a macro, so adjust fpu/fpu.c
to avoid collisions.
-rw-r--r-- | sys/arch/sparc64/fpu/fpu.c | 34 | ||||
-rw-r--r-- | sys/arch/sparc64/include/cpu.h | 10 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/cpu.c | 4 |
3 files changed, 20 insertions, 28 deletions
diff --git a/sys/arch/sparc64/fpu/fpu.c b/sys/arch/sparc64/fpu/fpu.c index fe0b9acdd3b..667f80fcd43 100644 --- a/sys/arch/sparc64/fpu/fpu.c +++ b/sys/arch/sparc64/fpu/fpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fpu.c,v 1.12 2006/06/21 19:24:38 jason Exp $ */ +/* $OpenBSD: fpu.c,v 1.13 2007/09/09 12:57:40 kettenis Exp $ */ /* $NetBSD: fpu.c,v 1.11 2000/12/06 01:47:50 mrg Exp $ */ /* @@ -304,8 +304,8 @@ fpu_regoffset(rx, type) * modified to reflect the setting the hardware would have left. */ int -fpu_execute(fpproc, fe, instr) - struct proc *fpproc; +fpu_execute(p, fe, instr) + struct proc *p; struct fpemu *fe; union instr instr; { @@ -339,7 +339,7 @@ fpu_execute(fpproc, fe, instr) case FMVFC3S: case FMVFC3D: case FMVFC3Q: case FMVICS: case FMVICD: case FMVICQ: case FMVXCS: case FMVXCD: case FMVXCQ: - return (fpu_insn_fmovcc(fpproc, fs, instr)); + return (fpu_insn_fmovcc(p, fs, instr)); case FMOVZS: case FMOVZD: case FMOVZQ: case FMOVLEZS: case FMOVLEZD: case FMOVLEZQ: @@ -347,7 +347,7 @@ fpu_execute(fpproc, fe, instr) case FMOVNZS: case FMOVNZD: case FMOVNZQ: case FMOVGZS: case FMOVGZD: case FMOVGZQ: case FMOVGEZS: case FMOVGEZD: case FMOVGEZQ: - return (fpu_insn_fmovr(fpproc, fs, instr)); + return (fpu_insn_fmovr(p, fs, instr)); } return (NOTFPU); } @@ -845,8 +845,8 @@ fpu_insn_fsub(fe, instr, rdp, rdtypep, space) * Handler for FMOV[SDQ][cond] emulation. */ int -fpu_insn_fmovcc(fpproc, fs, instr) - struct proc *fpproc; +fpu_insn_fmovcc(p, fs, instr) + struct proc *p; struct fpstate64 *fs; union instr instr; { @@ -875,11 +875,11 @@ fpu_insn_fmovcc(fpproc, fs, instr) cond = (fs->fs_fsr >> FSR_FCC3_SHIFT) & FSR_FCC_MASK; break; case 4: - cond = (fpproc->p_md.md_tf->tf_tstate >> TSTATE_CCR_SHIFT) & + cond = (p->p_md.md_tf->tf_tstate >> TSTATE_CCR_SHIFT) & PSR_ICC; break; case 6: - cond = (fpproc->p_md.md_tf->tf_tstate >> + cond = (p->p_md.md_tf->tf_tstate >> (TSTATE_CCR_SHIFT + XCC_SHIFT)) & PSR_ICC; break; default: @@ -897,8 +897,8 @@ fpu_insn_fmovcc(fpproc, fs, instr) * Handler for FMOVR[icond][SDQ] emulation. */ int -fpu_insn_fmovr(fpproc, fs, instr) - struct proc *fpproc; +fpu_insn_fmovr(p, fs, instr) + struct proc *p; struct fpstate64 *fs; union instr instr; { @@ -917,32 +917,32 @@ fpu_insn_fmovr(fpproc, fs, instr) switch (instr.i_fmovr.i_rcond) { case 1: /* Z */ if (rs1 != 0 && - (int64_t)fpproc->p_md.md_tf->tf_global[rs1] != 0) + (int64_t)p->p_md.md_tf->tf_global[rs1] != 0) return (0); break; case 2: /* LEZ */ if (rs1 != 0 && - (int64_t)fpproc->p_md.md_tf->tf_global[rs1] > 0) + (int64_t)p->p_md.md_tf->tf_global[rs1] > 0) return (0); break; case 3: /* LZ */ if (rs1 == 0 || - (int64_t)fpproc->p_md.md_tf->tf_global[rs1] >= 0) + (int64_t)p->p_md.md_tf->tf_global[rs1] >= 0) return (0); break; case 5: /* NZ */ if (rs1 == 0 || - (int64_t)fpproc->p_md.md_tf->tf_global[rs1] == 0) + (int64_t)p->p_md.md_tf->tf_global[rs1] == 0) return (0); break; case 6: /* NGZ */ if (rs1 == 0 || - (int64_t)fpproc->p_md.md_tf->tf_global[rs1] <= 0) + (int64_t)p->p_md.md_tf->tf_global[rs1] <= 0) return (0); break; case 7: /* NGEZ */ if (rs1 != 0 && - (int64_t)fpproc->p_md.md_tf->tf_global[rs1] < 0) + (int64_t)p->p_md.md_tf->tf_global[rs1] < 0) return (0); break; default: diff --git a/sys/arch/sparc64/include/cpu.h b/sys/arch/sparc64/include/cpu.h index 3016de9e581..598948b989f 100644 --- a/sys/arch/sparc64/include/cpu.h +++ b/sys/arch/sparc64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.43 2007/09/09 08:55:26 kettenis Exp $ */ +/* $OpenBSD: cpu.h,v 1.44 2007/09/09 12:57:40 kettenis Exp $ */ /* $NetBSD: cpu.h,v 1.28 2001/06/14 22:56:58 thorpej Exp $ */ /* @@ -128,6 +128,7 @@ extern struct cpu_info *cpus; for (cii = 0, ci = curcpu(); ci != NULL; ci = NULL) #define curpcb curcpu()->ci_cpcb +#define fpproc curcpu()->ci_fpproc /* * definitions of cpu-dependent requirements @@ -182,13 +183,6 @@ extern void need_resched(struct cpu_info *); void signotify(struct proc *); -/* - * Only one process may own the FPU state. - * - * XXX this must be per-cpu (eventually) - */ -extern struct proc *fpproc; /* FPU owner */ - /* machdep.c */ int ldcontrolb(caddr_t); void dumpconf(void); diff --git a/sys/arch/sparc64/sparc64/cpu.c b/sys/arch/sparc64/sparc64/cpu.c index 5e773e0b385..c3c8b0acf00 100644 --- a/sys/arch/sparc64/sparc64/cpu.c +++ b/sys/arch/sparc64/sparc64/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.22 2007/09/08 17:13:17 kettenis Exp $ */ +/* $OpenBSD: cpu.c,v 1.23 2007/09/09 12:57:40 kettenis Exp $ */ /* $NetBSD: cpu.c,v 1.13 2001/05/26 21:27:15 chs Exp $ */ /* @@ -78,8 +78,6 @@ struct cpu_info *cpus = NULL; char machine[] = MACHINE; /* from <machine/param.h> */ char cpu_model[100]; -struct proc *fpproc; - /* The CPU configuration driver. */ static void cpu_attach(struct device *, struct device *, void *); int cpu_match(struct device *, void *, void *); |