Lines Matching refs:npages

498 	u_long npages;  in vm_phys_init()  local
510 npages = 0; in vm_phys_init()
527 npages > VM_DMA32_NPAGES_THRESHOLD && in vm_phys_init()
535 npages += atop(seg->end - seg->start); in vm_phys_init()
556 npages = 0; in vm_phys_init()
561 seg->first_page = &vm_page_array[npages]; in vm_phys_init()
562 npages += atop(seg->end - seg->start); in vm_phys_init()
696 vm_phys_enq_beg(vm_page_t m, u_int npages, struct vm_freelist *fl, int tail) in vm_phys_enq_beg() argument
700 KASSERT(npages == 0 || in vm_phys_enq_beg()
702 ((PAGE_SIZE << (fls(npages) - 1)) - 1)) == 0, in vm_phys_enq_beg()
704 __func__, m, npages)); in vm_phys_enq_beg()
705 while (npages > 0) { in vm_phys_enq_beg()
709 order = fls(npages) - 1; in vm_phys_enq_beg()
714 npages -= 1 << order; in vm_phys_enq_beg()
732 vm_phys_enq_range(vm_page_t m, u_int npages, struct vm_freelist *fl, int tail) in vm_phys_enq_range() argument
736 KASSERT(npages == 0 || in vm_phys_enq_range()
737 ((VM_PAGE_TO_PHYS(m) + npages * PAGE_SIZE) & in vm_phys_enq_range()
738 ((PAGE_SIZE << (fls(npages) - 1)) - 1)) == 0, in vm_phys_enq_range()
740 m, npages)); in vm_phys_enq_range()
741 while (npages > 0) { in vm_phys_enq_range()
745 order = ffs(npages) - 1; in vm_phys_enq_range()
750 npages -= 1 << order; in vm_phys_enq_range()
780 vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]) in vm_phys_alloc_npages() argument
790 KASSERT(npages <= 1 << (VM_NFREEORDER - 1), in vm_phys_alloc_npages()
791 ("vm_phys_alloc_npages: npages %d is out of range", npages)); in vm_phys_alloc_npages()
803 end = imin(npages, avail); in vm_phys_alloc_npages()
806 if (i == npages) { in vm_phys_alloc_npages()
812 return (npages); in vm_phys_alloc_npages()
824 end = imin(npages, avail); in vm_phys_alloc_npages()
827 if (i == npages) { in vm_phys_alloc_npages()
835 return (npages); in vm_phys_alloc_npages()
1176 vm_phys_enqueue_contig(vm_page_t m, u_long npages) in vm_phys_enqueue_contig() argument
1191 m_end = m + npages; in vm_phys_enqueue_contig()
1195 (diff = lo ^ (lo + npages - 1)) != 0) { in vm_phys_enqueue_contig()
1205 __func__, m_end - npages, m)); in vm_phys_enqueue_contig()
1219 vm_phys_free_contig(vm_page_t m, u_long npages) in vm_phys_free_contig() argument
1228 max_order = min(flsll(lo ^ (lo + npages)) - 1, VM_NFREEORDER - 1); in vm_phys_free_contig()
1234 m_end = m + npages; in vm_phys_free_contig()
1235 order_end = ffsll(lo + npages) - 1; in vm_phys_free_contig()
1257 u_long npages, vm_paddr_t low, vm_paddr_t high) in vm_phys_find_range() argument
1262 KASSERT(npages > 0, ("npages is zero")); in vm_phys_find_range()
1272 if (pa_end - pa_start < ptoa(npages)) in vm_phys_find_range()
1351 vm_phys_find_freelist_contig(struct vm_freelist *fl, u_long npages, in vm_phys_find_freelist_contig() argument
1360 size = npages << PAGE_SHIFT; in vm_phys_find_freelist_contig()
1409 m_iter < m_ret + npages && max_order == m_iter->order; in vm_phys_find_freelist_contig()
1412 if (m_iter < m_ret + npages) in vm_phys_find_freelist_contig()
1426 u_long npages, vm_paddr_t low, vm_paddr_t high, in vm_phys_find_queues_contig() argument
1434 KASSERT(npages > 0, ("npages is 0")); in vm_phys_find_queues_contig()
1438 order = flsl(npages - 1); in vm_phys_find_queues_contig()
1440 size = npages << PAGE_SHIFT; in vm_phys_find_queues_contig()
1464 m_ret = vm_phys_find_freelist_contig(fl, npages, in vm_phys_find_queues_contig()
1483 vm_phys_alloc_contig(int domain, u_long npages, vm_paddr_t low, vm_paddr_t high, in vm_phys_alloc_contig() argument
1493 KASSERT(npages > 0, ("npages is 0")); in vm_phys_alloc_contig()
1515 if (pa_end - pa_start < ptoa(npages)) in vm_phys_alloc_contig()
1526 m_run = vm_phys_find_queues_contig(queues, npages, in vm_phys_alloc_contig()
1535 for (m = m_run; m < &m_run[npages]; m = &m[1 << oind]) { in vm_phys_alloc_contig()
1544 vm_phys_enq_range(&m_run[npages], m - &m_run[npages], fl, 0); in vm_phys_alloc_contig()
1550 KASSERT(pa_start + ptoa(npages) <= high, in vm_phys_alloc_contig()
1555 KASSERT(vm_addr_ok(pa_start, ptoa(npages), alignment, boundary), in vm_phys_alloc_contig()