summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2010-11-28 17:56:34 +0000
committerkib <kib@FreeBSD.org>2010-11-28 17:56:34 +0000
commit2df0e33e2663f2a5ba84883232342557d7b06101 (patch)
tree27cca82e59df7ccb1d2d571a2dd21ebaa14072cd
parenta41bb65481454afde846eb4e12d39e8a40e81927 (diff)
downloadFreeBSD-src-2df0e33e2663f2a5ba84883232342557d7b06101.zip
FreeBSD-src-2df0e33e2663f2a5ba84883232342557d7b06101.tar.gz
Calling fill_fpregs() for curthread is legitimate, and ELF coredump
does this. Reported and tested by: pho MFC after: 5 days
-rw-r--r--sys/amd64/amd64/machdep.c3
-rw-r--r--sys/i386/i386/machdep.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 194cf71..584473d 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -1975,7 +1975,8 @@ int
fill_fpregs(struct thread *td, struct fpreg *fpregs)
{
- KASSERT(TD_IS_SUSPENDED(td), ("not suspended thread %p", td));
+ KASSERT(td == curthread || TD_IS_SUSPENDED(td),
+ ("not suspended thread %p", td));
fpugetregs(td);
fill_fpregs_xmm(&td->td_pcb->pcb_user_save, fpregs);
return (0);
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 935a8d20..538d904 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -3203,7 +3203,8 @@ int
fill_fpregs(struct thread *td, struct fpreg *fpregs)
{
- KASSERT(TD_IS_SUSPENDED(td), ("not suspended thread %p", td));
+ KASSERT(td == curthread || TD_IS_SUSPENDED(td),
+ ("not suspended thread %p", td));
npxgetregs(td);
#ifdef CPU_ENABLE_SSE
if (cpu_fxsr)
OpenPOWER on IntegriCloud