From owner-p4-projects@FreeBSD.ORG Tue Jan 18 18:11:22 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8246716A4D2; Tue, 18 Jan 2005 18:11:21 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CE11316A4D0 for ; Tue, 18 Jan 2005 18:11:20 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B70F243D60 for ; Tue, 18 Jan 2005 18:11:20 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j0IIBKhX070475 for ; Tue, 18 Jan 2005 18:11:20 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j0IIBKlA070472 for perforce@freebsd.org; Tue, 18 Jan 2005 18:11:20 GMT (envelope-from jhb@freebsd.org) Date: Tue, 18 Jan 2005 18:11:20 GMT Message-Id: <200501181811.j0IIBKlA070472@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 69217 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2005 18:11:22 -0000 http://perforce.freebsd.org/chv.cgi?CH=69217 Change 69217 by jhb@jhb_slimer on 2005/01/18 18:10:55 Small cleanups from bde. Affected files ... .. //depot/projects/smpng/sys/i386/i386/vm_machdep.c#60 edit Differences ... ==== //depot/projects/smpng/sys/i386/i386/vm_machdep.c#60 (text+ko) ==== @@ -294,14 +294,14 @@ void cpu_exit(struct thread *td) { - struct mdproc *mdp; - /* Reset pc->pcb_gs and %gs before possibly invalidating it. */ - mdp = &td->td_proc->p_md; mtx_lock_spin(&sched_lock); - if (mdp->md_ldt) { + if (td->td_proc->p_md.md_ldt) { + + /* Reset pc->pcb_gs and %gs before invalidating it. */ td->td_pcb->pcb_gs = _udatasel; load_gs(_udatasel); + user_ldt_free(td); } else mtx_unlock_spin(&sched_lock); @@ -310,16 +310,15 @@ void cpu_thread_exit(struct thread *td) { - struct pcb *pcb = td->td_pcb; #ifdef DEV_NPX - if (td == PCPU_GET(fpcurthread)) - npxdrop(); + npxexit(); #endif - if (pcb->pcb_flags & PCB_DBREGS) { - /* disable all hardware breakpoints */ + + /* Disable any hardware breakpoints. */ + if (td->td_pcb->pcb_flags & PCB_DBREGS) { reset_dbregs(); - pcb->pcb_flags &= ~PCB_DBREGS; + td->td_pcb->pcb_flags &= ~PCB_DBREGS; } } @@ -329,7 +328,7 @@ struct pcb *pcb; pcb = td->td_pcb; - if (pcb->pcb_ext != 0) { + if (pcb->pcb_ext != NULL) { /* XXXKSE XXXSMP not SMP SAFE.. what locks do we have? */ /* if (pcb->pcb_ext->ext_refcount-- == 1) ?? */ /* @@ -338,7 +337,7 @@ */ kmem_free(kernel_map, (vm_offset_t)pcb->pcb_ext, ctob(IOPAGES + 1)); - pcb->pcb_ext = 0; + pcb->pcb_ext = NULL; } }