kernel - Fix floating point save state structure and minor npx issues
[dragonfly.git] / sys / platform / vkernel64 / x86_64 / vm_machdep.c
index b348472..5191810 100644 (file)
@@ -54,7 +54,6 @@
 #include <sys/kernel.h>
 #include <sys/sysctl.h>
 #include <sys/unistd.h>
-#include <sys/dsched.h>
 
 #include <machine/clock.h>
 #include <machine/cpu.h>
@@ -255,20 +254,24 @@ cpu_lwp_exit(void)
 {
        struct thread *td = curthread;
        struct pcb *pcb;
-       npxexit();
+
        pcb = td->td_pcb;
-       KKASSERT(pcb->pcb_ext == NULL); /* Some i386 functionality was dropped */
+
+       /* Some i386 functionality was dropped */
+       KKASSERT(pcb->pcb_ext == NULL);
+
+       /*
+        * disable all hardware breakpoints
+        */
         if (pcb->pcb_flags & PCB_DBREGS) {
-                /*
-                 * disable all hardware breakpoints
-                 */
                 reset_dbregs();
                 pcb->pcb_flags &= ~PCB_DBREGS;
         }
        td->td_gd->gd_cnt.v_swtch++;
 
-       dsched_exit_thread(td);
        crit_enter_quick(td);
+       if (td->td_flags & TDF_TSLEEPQ)
+               tsleep_remove(td);
        lwkt_deschedule_self(td);
        lwkt_remove_tdallq(td);
        cpu_thread_exit();
@@ -286,23 +289,13 @@ cpu_lwp_exit(void)
 void
 cpu_thread_exit(void)
 {
+       npxexit();
        curthread->td_switch = cpu_exit_switch;
        curthread->td_flags |= TDF_EXITING;
        lwkt_switch();
        panic("cpu_thread_exit: lwkt_switch() unexpectedly returned");
 }
 
-/*
- * Process Reaper.  Called after the caller has acquired the thread's
- * rwlock and removed it from the reap list.
- */
-void
-cpu_proc_wait(struct proc *p)
-{
-       /* drop per-process resources */
-       pmap_dispose_proc(p);
-}
-
 int
 grow_stack(struct proc *p, u_long sp)
 {