PERFORCE change 48386 for review

Juli Mallett jmallett at FreeBSD.org
Sun Mar 7 16:39:13 PST 2004


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

Change 48386 by jmallett at jmallett_oingo on 2004/03/07 16:39:06

	Catching up with boneheaded resolves.

Affected files ...

.. //depot/projects/mips/sys/mips/mips/pmap.c#30 edit

Differences ...

==== //depot/projects/mips/sys/mips/mips/pmap.c#30 (text+ko) ====

@@ -298,45 +298,6 @@
 	LIST_INSERT_HEAD(&allpmaps, kernel_pmap, pm_list);
 }
 
-/*
- * Perform a small allocation for UMA, used early in the boot process
- * and possibly at other times.
- */
-void *
-uma_small_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait)
-{
-	static vm_pindex_t color;
-	vm_page_t m;
-	int pflags;
-	void *va;
-
-	*flags = UMA_SLAB_PRIV;
-
-	if ((wait & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT)
-		pflags = VM_ALLOC_INTERRUPT;
-	else
-		pflags = VM_ALLOC_SYSTEM;
-
-	if (wait & M_ZERO)
-		pflags |= VM_ALLOC_ZERO;
-
-	for (;;) {
-		m = vm_page_alloc(NULL, color++, pflags | VM_ALLOC_NOOBJ);
-		if (m == NULL) {
-			if (wait & M_NOWAIT)
-				return (NULL);
-			else
-				VM_WAIT;
-		} else
-			break;
-	}
-
-	va = (void *)MIPS_PHYS_TO_KSEG0(m->phys_addr);
-	if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0)
-		bzero(va, PAGE_SIZE);
-	return (va);
-}
-
 void *
 uma_small_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait)
 {
@@ -1202,37 +1163,8 @@
 	if (wired)
 		pmap->pm_stats.wired_count++;
 
-validate:
-	/*
-	 * Now validate mapping with desired protection/wiring.
-	 */
-	newpte = pmap_phys_to_pte(pa) | pte_prot(pmap, prot) | PG_V | managed;
-
-	if (managed) {
-		/*
-		 * Set up referenced/modified emulation for the new
-		 * mapping. Any old referenced/modified emulation
-		 * results for the old mapping will have been recorded
-		 * either in pmap_remove_pte() or above in the code
-		 * which handles protection and/or wiring changes.
-		 */
-		newpte |= (PG_FOR | PG_FOW | PG_FOE);
-	}
-
-	if (wired)
-		newpte |= PG_W;
-
-	/*
-	 * if the mapping or permission bits are different, we need
-	 * to update the pte.
-	 */
-	if (origpte != newpte) {
-		*pte = newpte;
-		if (origpte)
-			pmap_invalidate_page(pmap, va);
-		if (prot & VM_PROT_EXECUTE)
-			alpha_pal_imb();
-	}
+	wired = wired ? PG_W : 0;
+	tlb_enter(pmap, va, pa, PG_V | wired);
 }
 
 /*


More information about the p4-projects mailing list