PERFORCE change 69217 for review

John Baldwin jhb at FreeBSD.org
Tue Jan 18 10:11:22 PST 2005


http://perforce.freebsd.org/chv.cgi?CH=69217

Change 69217 by jhb at 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;
 	}
 }
 


More information about the p4-projects mailing list