aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKATO Takenori <kato@FreeBSD.org>1997-01-25 06:42:19 +0000
committerKATO Takenori <kato@FreeBSD.org>1997-01-25 06:42:19 +0000
commit1817f78ea0d367ffeb47264dd092611cf8790001 (patch)
treea2c06342ab5b11118ee152c5eb03d2ba303019c6
parentd8750fa79ba7c058e9c2bebfccac34f5fa2b1030 (diff)
Notes
-rw-r--r--sys/pc98/i386/machdep.c29
-rw-r--r--sys/pc98/pc98/machdep.c29
2 files changed, 50 insertions, 8 deletions
diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c
index b75d3fc333db..da365dd1e0ca 100644
--- a/sys/pc98/i386/machdep.c
+++ b/sys/pc98/i386/machdep.c
@@ -692,11 +692,30 @@ setregs(p, entry, stack)
regs[tES] = _udatasel;
regs[tCS] = _ucodesel;
- p->p_addr->u_pcb.pcb_flags = 0; /* no fp at all */
- load_cr0(rcr0() | CR0_TS); /* start emulating */
-#if NNPX > 0
+ /*
+ * Initialize the math emulator (if any) for the current process.
+ * Actually, just clear the bit that says that the emulator has
+ * been initialized. Initialization is delayed until the process
+ * traps to the emulator (if it is done at all) mainly because
+ * emulators don't provide an entry point for initialization.
+ */
+ p->p_addr->u_pcb.pcb_flags &= ~FP_SOFTFP;
+
+ /*
+ * Arrange to trap the next npx or `fwait' instruction (see npx.c
+ * for why fwait must be trapped at least if there is an npx or an
+ * emulator). This is mainly to handle the case where npx0 is not
+ * configured, since the npx routines normally set up the trap
+ * otherwise. It should be done only at boot time, but doing it
+ * here allows modifying `npx_exists' for testing the emulator on
+ * systems with an npx.
+ */
+ load_cr0(rcr0() | CR0_MP | CR0_TS);
+
+#if NNPX > 0
+ /* Initialize the npx (if any) for the current process. */
npxinit(__INITIAL_NPXCW__);
-#endif /* NNPX > 0 */
+#endif
}
static int
@@ -1166,9 +1185,11 @@ init386(first)
Maxmem = MAXMEM/4;
#endif
+#if NNPX > 0
idp = find_isadev(isa_devtab_null, &npxdriver, 0);
if (idp != NULL && idp->id_msize != 0)
Maxmem = idp->id_msize / 4;
+#endif
/* call pmap initialization to make new kernel address space */
pmap_bootstrap (first, 0);
diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c
index b75d3fc333db..da365dd1e0ca 100644
--- a/sys/pc98/pc98/machdep.c
+++ b/sys/pc98/pc98/machdep.c
@@ -692,11 +692,30 @@ setregs(p, entry, stack)
regs[tES] = _udatasel;
regs[tCS] = _ucodesel;
- p->p_addr->u_pcb.pcb_flags = 0; /* no fp at all */
- load_cr0(rcr0() | CR0_TS); /* start emulating */
-#if NNPX > 0
+ /*
+ * Initialize the math emulator (if any) for the current process.
+ * Actually, just clear the bit that says that the emulator has
+ * been initialized. Initialization is delayed until the process
+ * traps to the emulator (if it is done at all) mainly because
+ * emulators don't provide an entry point for initialization.
+ */
+ p->p_addr->u_pcb.pcb_flags &= ~FP_SOFTFP;
+
+ /*
+ * Arrange to trap the next npx or `fwait' instruction (see npx.c
+ * for why fwait must be trapped at least if there is an npx or an
+ * emulator). This is mainly to handle the case where npx0 is not
+ * configured, since the npx routines normally set up the trap
+ * otherwise. It should be done only at boot time, but doing it
+ * here allows modifying `npx_exists' for testing the emulator on
+ * systems with an npx.
+ */
+ load_cr0(rcr0() | CR0_MP | CR0_TS);
+
+#if NNPX > 0
+ /* Initialize the npx (if any) for the current process. */
npxinit(__INITIAL_NPXCW__);
-#endif /* NNPX > 0 */
+#endif
}
static int
@@ -1166,9 +1185,11 @@ init386(first)
Maxmem = MAXMEM/4;
#endif
+#if NNPX > 0
idp = find_isadev(isa_devtab_null, &npxdriver, 0);
if (idp != NULL && idp->id_msize != 0)
Maxmem = idp->id_msize / 4;
+#endif
/* call pmap initialization to make new kernel address space */
pmap_bootstrap (first, 0);