summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2002-09-30 07:02:22 +0000
committerobrien <obrien@FreeBSD.org>2002-09-30 07:02:22 +0000
commitce49c7b7967169976010377237850e93ad91a61a (patch)
treeb2c360155c13d8b00bdff26e0c5f990a8541e1e3
parenteb286245fd42ae3932bf7b3ed6c7b5aaa4fed3d8 (diff)
downloadFreeBSD-src-ce49c7b7967169976010377237850e93ad91a61a.zip
FreeBSD-src-ce49c7b7967169976010377237850e93ad91a61a.tar.gz
Save the FP state in the PCB as that is compatable with releng4 binaries.
This is a band-aid until the KSE pthread committers get back on the ground and have their machines setup. Submitted by: eischen
-rw-r--r--sys/amd64/amd64/machdep.c10
-rw-r--r--sys/i386/i386/machdep.c10
2 files changed, 20 insertions, 0 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index fb3603d..81711d1 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -2147,6 +2147,10 @@ set_mcontext(struct thread *td, const mcontext_t *mcp)
static void
get_fpcontext(struct thread *td, mcontext_t *mcp)
{
+#if 1 /* XXX: tmp hack to restore ability to run releng4 binaries */
+ /* For now, always store the FP state in the PCB. */
+ (void)npxgetregs(td, (union savefpu *)&td->td_pcb->pcb_save);
+#else
#ifndef DEV_NPX
mcp->mc_fpformat = _MC_FPFMT_NODEV;
mcp->mc_ownedfp = _MC_FPOWNED_NONE;
@@ -2182,11 +2186,16 @@ get_fpcontext(struct thread *td, mcontext_t *mcp)
}
mcp->mc_fpformat = npxformat();
#endif
+#endif /* tmp hack to restore ability to run releng4 binaries */
}
static int
set_fpcontext(struct thread *td, const mcontext_t *mcp)
{
+#if 1 /* XXX: tmp hack to restore ability to run releng4 binaries */
+ /* For now, the FP state is always stored in the PCB. */
+ npxsetregs(td, (union savefpu *)&td->td_pcb->pcb_save);
+#else
union savefpu *addr;
if (mcp->mc_fpformat == _MC_FPFMT_NODEV)
@@ -2225,6 +2234,7 @@ set_fpcontext(struct thread *td, const mcontext_t *mcp)
*/
} else
return (EINVAL);
+#endif /* tmp hack to restore ability to run releng4 binaries */
return (0);
}
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index fb3603d..81711d1 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -2147,6 +2147,10 @@ set_mcontext(struct thread *td, const mcontext_t *mcp)
static void
get_fpcontext(struct thread *td, mcontext_t *mcp)
{
+#if 1 /* XXX: tmp hack to restore ability to run releng4 binaries */
+ /* For now, always store the FP state in the PCB. */
+ (void)npxgetregs(td, (union savefpu *)&td->td_pcb->pcb_save);
+#else
#ifndef DEV_NPX
mcp->mc_fpformat = _MC_FPFMT_NODEV;
mcp->mc_ownedfp = _MC_FPOWNED_NONE;
@@ -2182,11 +2186,16 @@ get_fpcontext(struct thread *td, mcontext_t *mcp)
}
mcp->mc_fpformat = npxformat();
#endif
+#endif /* tmp hack to restore ability to run releng4 binaries */
}
static int
set_fpcontext(struct thread *td, const mcontext_t *mcp)
{
+#if 1 /* XXX: tmp hack to restore ability to run releng4 binaries */
+ /* For now, the FP state is always stored in the PCB. */
+ npxsetregs(td, (union savefpu *)&td->td_pcb->pcb_save);
+#else
union savefpu *addr;
if (mcp->mc_fpformat == _MC_FPFMT_NODEV)
@@ -2225,6 +2234,7 @@ set_fpcontext(struct thread *td, const mcontext_t *mcp)
*/
} else
return (EINVAL);
+#endif /* tmp hack to restore ability to run releng4 binaries */
return (0);
}
OpenPOWER on IntegriCloud