Author: kib
Date: Sun Nov 28 17:56:34 2010
New Revision: 216012
URL: http://svn.freebsd.org/changeset/base/216012

Log:
  Calling fill_fpregs() for curthread is legitimate, and ELF coredump
  does this.
  
  Reported and tested by:       pho
  MFC after:    5 days

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/i386/i386/machdep.c

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c      Sun Nov 28 17:23:28 2010        
(r216011)
+++ head/sys/amd64/amd64/machdep.c      Sun Nov 28 17:56:34 2010        
(r216012)
@@ -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);

Modified: head/sys/i386/i386/machdep.c
==============================================================================
--- head/sys/i386/i386/machdep.c        Sun Nov 28 17:23:28 2010        
(r216011)
+++ head/sys/i386/i386/machdep.c        Sun Nov 28 17:56:34 2010        
(r216012)
@@ -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)
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to