diff options
author | jchandra <jchandra@FreeBSD.org> | 2010-05-27 10:05:40 +0000 |
---|---|---|
committer | jchandra <jchandra@FreeBSD.org> | 2010-05-27 10:05:40 +0000 |
commit | a2f74329876c8da10c6470f9a562c786ecc67f8b (patch) | |
tree | db5a8b1b993228551c5e0a6023d652cc8293d225 /sys/mips | |
parent | 5ec237a8e2000a153769622ace5c79a74e922bca (diff) | |
download | FreeBSD-src-a2f74329876c8da10c6470f9a562c786ecc67f8b.zip FreeBSD-src-a2f74329876c8da10c6470f9a562c786ecc67f8b.tar.gz |
Call VM_WAIT in pmap_ptpgzone_allocf() if M_WAITOK is set.
Removed unused variable.
Approved by: rrs (mentor)
Diffstat (limited to 'sys/mips')
-rw-r--r-- | sys/mips/mips/pmap.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/sys/mips/mips/pmap.c b/sys/mips/mips/pmap.c index 699c4ef..31061cb 100644 --- a/sys/mips/mips/pmap.c +++ b/sys/mips/mips/pmap.c @@ -969,10 +969,15 @@ pmap_ptpgzone_allocf(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) ("pmap_ptpgzone_allocf: invalid allocation size %d", bytes)); *flags = UMA_SLAB_PRIV; - m = vm_phys_alloc_contig(1, 0, MIPS_KSEG0_LARGEST_PHYS, - PAGE_SIZE, PAGE_SIZE); - if (m == NULL) - return (NULL); + for (;;) { + m = vm_phys_alloc_contig(1, 0, MIPS_KSEG0_LARGEST_PHYS, + PAGE_SIZE, PAGE_SIZE); + if (m != NULL) + break; + if ((wait & M_WAITOK) == 0) + return (NULL); + VM_WAIT; + } paddr = VM_PAGE_TO_PHYS(m); return ((void *)MIPS_PHYS_TO_KSEG0(paddr)); @@ -1039,8 +1044,10 @@ pmap_pinit(pmap_t pmap) * allocate the page directory page */ ptdpg = pmap_alloc_pte_page(pmap, NUSERPGTBLS, M_WAITOK, &ptdva); - pmap->pm_segtab = (pd_entry_t *)ptdva; + if (ptdpg == NULL) + return (0); + pmap->pm_segtab = (pd_entry_t *)ptdva; pmap->pm_active = 0; pmap->pm_ptphint = NULL; for (i = 0; i < MAXCPU; i++) { @@ -1062,13 +1069,11 @@ _pmap_allocpte(pmap_t pmap, unsigned ptepindex, int flags) { vm_offset_t pteva; vm_page_t m; - int req; KASSERT((flags & (M_NOWAIT | M_WAITOK)) == M_NOWAIT || (flags & (M_NOWAIT | M_WAITOK)) == M_WAITOK, ("_pmap_allocpte: flags is neither M_NOWAIT nor M_WAITOK")); - req = VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_NOOBJ; /* * Find or fabricate a new pagetable page */ |