Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Jan 2005 18:11:20 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 69217 for review
Message-ID:  <200501181811.j0IIBKlA070472@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 	}
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200501181811.j0IIBKlA070472>