summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2000-02-21 21:06:00 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2000-02-21 21:06:00 +0000
commit7686a9d107cbe24bfc6976fcf40b4eb9607eed1c (patch)
tree1dd48c1e0ab4e30cf0e954e20debf49044400671 /sys/arch
parent7fd93cb63bfd9aa45b78858ca718ebc55759411c (diff)
move fpproc into the cpuinfo structure.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc/include/cpu.h8
-rw-r--r--sys/arch/sparc/sparc/cpu.c25
-rw-r--r--sys/arch/sparc/sparc/emul.c4
-rw-r--r--sys/arch/sparc/sparc/machdep.c7
-rw-r--r--sys/arch/sparc/sparc/trap.c16
-rw-r--r--sys/arch/sparc/sparc/vm_machdep.c10
6 files changed, 33 insertions, 37 deletions
diff --git a/sys/arch/sparc/include/cpu.h b/sys/arch/sparc/include/cpu.h
index e80925c85cb..5ccf95a2502 100644
--- a/sys/arch/sparc/include/cpu.h
+++ b/sys/arch/sparc/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.7 2000/01/27 20:14:12 art Exp $ */
+/* $OpenBSD: cpu.h,v 1.8 2000/02/21 21:05:58 art Exp $ */
/* $NetBSD: cpu.h,v 1.24 1997/03/15 22:25:15 pk Exp $ */
/*
@@ -144,12 +144,6 @@ extern int want_ast;
*/
#define signotify(p) (want_ast = 1)
-/*
- * Only one process may own the FPU state.
- *
- * XXX this must be per-cpu (eventually)
- */
-extern struct proc *fpproc; /* FPU owner */
extern int foundfpu; /* true => we have an FPU */
/*
diff --git a/sys/arch/sparc/sparc/cpu.c b/sys/arch/sparc/sparc/cpu.c
index 480f8fb358a..677b30feb9c 100644
--- a/sys/arch/sparc/sparc/cpu.c
+++ b/sys/arch/sparc/sparc/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.29 2000/02/21 17:08:36 art Exp $ */
+/* $OpenBSD: cpu.c,v 1.30 2000/02/21 21:05:59 art Exp $ */
/* $NetBSD: cpu.c,v 1.56 1997/09/15 20:52:36 pk Exp $ */
/*
@@ -82,7 +82,6 @@ char cpu_hotfix[40];
extern char mainbus_model[]; /* from autoconf.c */
int foundfpu; /* from machine/cpu.h */
-struct proc *fpproc; /* XXX - should be in cpuinfo */
/* The CPU configuration driver. */
void cpu_attach __P((struct device *, struct device *, void *));
@@ -1328,25 +1327,27 @@ fsrtoname(impl, vers, fver, buf)
void
replacemul()
{
-#ifdef notyet
- extern void *_umulreplace, *_umulreplace_end;
- extern void *_mulreplace, *_mulreplace_end;
+ extern char *_umulreplace, *_umulreplace_end;
+ extern char *_mulreplace, *_mulreplace_end;
extern char *_mul, *_umul;
int i, j, s;
+ return;
+
/*
* Whack the slow sun4/sun4c umul/mul functions with
* fast V8 ones
*/
s = splhigh();
- for (i = 0; i < _umulreplace_end - _umulreplace; i += 4) {
- j = ((int *)_umulreplace)[i];
- pmap_writetext(_umul + (i<<2), j);
+ cpuinfo.cache_flush_all();
+ for (i = 0; i < _umulreplace_end - _umulreplace; i++) {
+ j = _umulreplace[i];
+ pmap_writetext(&_umul[i], j);
}
- for (i = 0; i < _mulreplace_end - _mulreplace; i += 4) {
- j = ((int *)_mulreplace)[i];
- pmap_writetext(_mul + (i<<2), j);
+ for (i = 0; i < _mulreplace_end - _mulreplace; i++) {
+ j = _mulreplace[i];
+ pmap_writetext(&_mul[i], j);
}
+ cpuinfo.cache_flush_all();
splx(s);
-#endif
}
diff --git a/sys/arch/sparc/sparc/emul.c b/sys/arch/sparc/sparc/emul.c
index 6693ba21608..a591bd9d04c 100644
--- a/sys/arch/sparc/sparc/emul.c
+++ b/sys/arch/sparc/sparc/emul.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: emul.c,v 1.1 1997/08/08 08:40:15 downsj Exp $ */
+/* $OpenBSD: emul.c,v 1.2 2000/02/21 21:05:59 art Exp $ */
/* $NetBSD: emul.c,v 1.3 1997/07/29 09:42:01 fair Exp $ */
/*
@@ -307,7 +307,7 @@ fixalign(p, tf)
uprintf("%c%d\n", REGNAME(code.i_asi.i_rs2));
#endif
#ifdef DIAGNOSTIC
- if (op.bits.fl && p != fpproc)
+ if (op.bits.fl && p != cpuinfo.fpproc)
panic("fp align without being the FP owning process");
#endif
diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c
index 28fc8453842..781314d5afe 100644
--- a/sys/arch/sparc/sparc/machdep.c
+++ b/sys/arch/sparc/sparc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.44 2000/02/15 16:32:41 art Exp $ */
+/* $OpenBSD: machdep.c,v 1.45 2000/02/21 21:05:59 art Exp $ */
/* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */
/*
@@ -91,6 +91,7 @@
#include <sparc/sparc/asm.h>
#include <sparc/sparc/cache.h>
#include <sparc/sparc/vaddrs.h>
+#include <sparc/sparc/cpuvar.h>
#if defined(UVM)
#include <uvm/uvm.h>
@@ -502,9 +503,9 @@ setregs(p, pack, stack, retval)
* we must get rid of it, and the only way to do that is
* to save it. In any case, get rid of our FPU state.
*/
- if (p == fpproc) {
+ if (p == cpuinfo.fpproc) {
savefpstate(fs);
- fpproc = NULL;
+ cpuinfo.fpproc = NULL;
}
free((void *)fs, M_SUBPROC);
p->p_md.md_fpstate = NULL;
diff --git a/sys/arch/sparc/sparc/trap.c b/sys/arch/sparc/sparc/trap.c
index d2e45119f44..16e45ccb404 100644
--- a/sys/arch/sparc/sparc/trap.c
+++ b/sys/arch/sparc/sparc/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.22 2000/02/21 17:08:37 art Exp $ */
+/* $OpenBSD: trap.c,v 1.23 2000/02/21 21:05:59 art Exp $ */
/* $NetBSD: trap.c,v 1.58 1997/09/12 08:55:01 pk Exp $ */
/*
@@ -266,7 +266,7 @@ static __inline void share_fpu(p, tf)
struct proc *p;
struct trapframe *tf;
{
- if ((tf->tf_psr & PSR_EF) != 0 && fpproc != p)
+ if ((tf->tf_psr & PSR_EF) != 0 && cpuinfo.fpproc != p)
tf->tf_psr &= ~PSR_EF;
}
@@ -419,11 +419,11 @@ badtrap:
fpu_cleanup(p, fs);
break;
}
- if (fpproc != p) { /* we do not have it */
- if (fpproc != NULL) /* someone else had it */
- savefpstate(fpproc->p_md.md_fpstate);
+ if (cpuinfo.fpproc != p) { /* we do not have it */
+ if (cpuinfo.fpproc != NULL) /* someone else had it */
+ savefpstate(cpuinfo.fpproc->p_md.md_fpstate);
loadfpstate(fs);
- fpproc = p; /* now we do have it */
+ cpuinfo.fpproc = p; /* now we do have it */
}
tf->tf_psr |= PSR_EF;
break;
@@ -508,10 +508,10 @@ badtrap:
* will not match once fpu_cleanup does its job, so
* we must not save again later.)
*/
- if (p != fpproc)
+ if (p != cpuinfo.fpproc)
panic("fpe without being the FP user");
savefpstate(p->p_md.md_fpstate);
- fpproc = NULL;
+ cpuinfo.fpproc = NULL;
/* tf->tf_psr &= ~PSR_EF; */ /* share_fpu will do this */
fpu_cleanup(p, p->p_md.md_fpstate);
/* fpu_cleanup posts signals if needed */
diff --git a/sys/arch/sparc/sparc/vm_machdep.c b/sys/arch/sparc/sparc/vm_machdep.c
index 57911e0b364..5b01be05935 100644
--- a/sys/arch/sparc/sparc/vm_machdep.c
+++ b/sys/arch/sparc/sparc/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.16 2000/02/21 14:51:20 art Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.17 2000/02/21 21:05:59 art Exp $ */
/* $NetBSD: vm_machdep.c,v 1.30 1997/03/10 23:55:40 pk Exp $ */
/*
@@ -419,7 +419,7 @@ cpu_fork(p1, p2, stack, stacksize)
bcopy((caddr_t)opcb, (caddr_t)npcb, sizeof(struct pcb));
if (p1->p_md.md_fpstate) {
- if (p1 == fpproc)
+ if (p1 == cpuinfo.fpproc)
savefpstate(p1->p_md.md_fpstate);
p2->p_md.md_fpstate = malloc(sizeof(struct fpstate),
M_SUBPROC, M_WAITOK);
@@ -527,9 +527,9 @@ cpu_exit(p)
register struct fpstate *fs;
if ((fs = p->p_md.md_fpstate) != NULL) {
- if (p == fpproc) {
+ if (p == cpuinfo.fpproc) {
savefpstate(fs);
- fpproc = NULL;
+ cpuinfo.fpproc = NULL;
}
free((void *)fs, M_SUBPROC);
}
@@ -564,7 +564,7 @@ cpu_coredump(p, vp, cred, chdr)
md_core.md_tf = *p->p_md.md_tf;
if (p->p_md.md_fpstate) {
- if (p == fpproc)
+ if (p == cpuinfo.fpproc)
savefpstate(p->p_md.md_fpstate);
md_core.md_fpstate = *p->p_md.md_fpstate;
} else