kernel - Fix floating point save state structure and minor npx issues
[dragonfly.git] / sys / platform / vkernel64 / x86_64 / vm_machdep.c
index d8c047c..5191810 100644 (file)
@@ -254,7 +254,7 @@ cpu_lwp_exit(void)
 {
        struct thread *td = curthread;
        struct pcb *pcb;
-       npxexit();
+
        pcb = td->td_pcb;
 
        /* Some i386 functionality was dropped */
@@ -270,6 +270,8 @@ cpu_lwp_exit(void)
        td->td_gd->gd_cnt.v_swtch++;
 
        crit_enter_quick(td);
+       if (td->td_flags & TDF_TSLEEPQ)
+               tsleep_remove(td);
        lwkt_deschedule_self(td);
        lwkt_remove_tdallq(td);
        cpu_thread_exit();
@@ -287,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)
 {