Lines Matching refs:npages
540 u_long npages; in vm_phys_init() local
552 npages = 0; in vm_phys_init()
569 npages > VM_DMA32_NPAGES_THRESHOLD && in vm_phys_init()
577 npages += atop(seg->end - seg->start); in vm_phys_init()
598 npages = 0; in vm_phys_init()
603 seg->first_page = &vm_page_array[npages]; in vm_phys_init()
604 npages += atop(seg->end - seg->start); in vm_phys_init()
743 int npages; in vm_phys_enq_chunk() local
745 npages = 1 << order; in vm_phys_enq_chunk()
746 m_next = m + npages; in vm_phys_enq_chunk()
747 pa = m->phys_addr + ptoa(npages); in vm_phys_enq_chunk()
769 vm_phys_enq_beg(vm_page_t m, u_int npages, struct vm_freelist *fl, int pool, in vm_phys_enq_beg() argument
774 KASSERT(npages == 0 || in vm_phys_enq_beg()
776 ((PAGE_SIZE << ilog2(npages)) - 1)) == 0, in vm_phys_enq_beg()
778 __func__, m, npages)); in vm_phys_enq_beg()
779 while (npages > 0) { in vm_phys_enq_beg()
783 order = ilog2(npages); in vm_phys_enq_beg()
788 npages -= 1 << order; in vm_phys_enq_beg()
806 vm_phys_enq_range(vm_page_t m, u_int npages, struct vm_freelist *fl, int pool, in vm_phys_enq_range() argument
811 KASSERT(npages == 0 || in vm_phys_enq_range()
812 ((VM_PAGE_TO_PHYS(m) + npages * PAGE_SIZE) & in vm_phys_enq_range()
813 ((PAGE_SIZE << ilog2(npages)) - 1)) == 0, in vm_phys_enq_range()
815 m, npages)); in vm_phys_enq_range()
816 while (npages > 0) { in vm_phys_enq_range()
820 order = ffs(npages) - 1; in vm_phys_enq_range()
823 npages -= 1 << order; in vm_phys_enq_range()
869 vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]) in vm_phys_alloc_npages() argument
879 KASSERT(npages <= 1 << (VM_NFREEORDER - 1), in vm_phys_alloc_npages()
880 ("vm_phys_alloc_npages: npages %d is out of range", npages)); in vm_phys_alloc_npages()
892 end = imin(npages, avail); in vm_phys_alloc_npages()
895 if (i == npages) { in vm_phys_alloc_npages()
902 return (npages); in vm_phys_alloc_npages()
915 end = imin(npages, avail); in vm_phys_alloc_npages()
918 if (i == npages) { in vm_phys_alloc_npages()
926 return (npages); in vm_phys_alloc_npages()
1381 vm_phys_enqueue_contig(vm_page_t m, int pool, u_long npages) in vm_phys_enqueue_contig() argument
1396 m_end = m + npages; in vm_phys_enqueue_contig()
1400 (diff = lo ^ (lo + npages - 1)) != 0) { in vm_phys_enqueue_contig()
1411 __func__, m_end - npages, m)); in vm_phys_enqueue_contig()
1427 vm_phys_free_contig(vm_page_t m, int pool, u_long npages) in vm_phys_free_contig() argument
1436 max_order = min(ilog2(lo ^ (lo + npages)), VM_NFREEORDER - 1); in vm_phys_free_contig()
1442 m_end = m + npages; in vm_phys_free_contig()
1443 order_end = ffsll(lo + npages) - 1; in vm_phys_free_contig()
1465 u_long npages, vm_paddr_t low, vm_paddr_t high) in vm_phys_find_range() argument
1470 KASSERT(npages > 0, ("npages is zero")); in vm_phys_find_range()
1480 if (pa_end - pa_start < ptoa(npages)) in vm_phys_find_range()
1575 vm_phys_find_freelist_contig(struct vm_freelist *fl, u_long npages, in vm_phys_find_freelist_contig() argument
1584 size = npages << PAGE_SHIFT; in vm_phys_find_freelist_contig()
1633 m_iter < m_ret + npages && max_order == m_iter->order; in vm_phys_find_freelist_contig()
1636 if (m_iter < m_ret + npages) in vm_phys_find_freelist_contig()
1650 u_long npages, vm_paddr_t low, vm_paddr_t high, in vm_phys_find_queues_contig() argument
1658 KASSERT(npages > 0, ("npages is 0")); in vm_phys_find_queues_contig()
1662 order = flsl(npages - 1); in vm_phys_find_queues_contig()
1664 size = npages << PAGE_SHIFT; in vm_phys_find_queues_contig()
1688 m_ret = vm_phys_find_freelist_contig(fl, npages, in vm_phys_find_queues_contig()
1708 vm_phys_alloc_contig(int domain, u_long npages, vm_paddr_t low, vm_paddr_t high, in vm_phys_alloc_contig() argument
1718 KASSERT(npages > 0, ("npages is 0")); in vm_phys_alloc_contig()
1740 if (pa_end - pa_start < ptoa(npages)) in vm_phys_alloc_contig()
1751 m_run = vm_phys_find_queues_contig(queues, npages, in vm_phys_alloc_contig()
1760 for (m = m_run; m < &m_run[npages]; m = &m[1 << oind]) { in vm_phys_alloc_contig()
1768 vm_phys_enq_range(&m_run[npages], m - &m_run[npages], fl, in vm_phys_alloc_contig()
1775 KASSERT(pa_start + ptoa(npages) <= high, in vm_phys_alloc_contig()
1780 KASSERT(vm_addr_ok(pa_start, ptoa(npages), alignment, boundary), in vm_phys_alloc_contig()