diff options
author | davidxu <davidxu@FreeBSD.org> | 2003-10-19 00:57:10 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2003-10-19 00:57:10 +0000 |
commit | f2c5a17d7999fce4ce1a532cffc4d2c10ee0b97f (patch) | |
tree | 998d430acb61e5dbf60d91446491f8468529e52a /sys | |
parent | b767de36df1b4c64c0594d55a1fed8878b1e820b (diff) | |
download | FreeBSD-src-f2c5a17d7999fce4ce1a532cffc4d2c10ee0b97f.zip FreeBSD-src-f2c5a17d7999fce4ce1a532cffc4d2c10ee0b97f.tar.gz |
Use npxdrop in cpu_thread_exit to save some cycles.
Clear FPU pcb flags for new upcall thread, these flags needn't
be inherited, the new thread should start from clean FPU status.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/i386/i386/vm_machdep.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 19114e1..059774a 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -286,7 +286,8 @@ cpu_thread_exit(struct thread *td) { struct pcb *pcb = td->td_pcb; #ifdef DEV_NPX - npxexit(td); + if (td == PCPU_GET(fpcurthread)) + npxdrop(); #endif if (pcb->pcb_flags & PCB_DBREGS) { /* disable all hardware breakpoints */ @@ -369,6 +370,7 @@ cpu_set_upcall(struct thread *td, struct thread *td0) * more analysis) (need a good safe default). */ bcopy(td0->td_pcb, pcb2, sizeof(*pcb2)); + pcb2->pcb_flags &= ~(PCB_NPXTRAP|PCB_NPXINITDONE); /* * Create a new fresh stack for the new thread. |