Lines Matching refs:seg

173 static vm_page_t vm_phys_alloc_seg_contig(struct vm_phys_seg *seg,
406 struct vm_phys_seg *seg;
415 seg = &vm_phys_segs[segind];
417 (uintmax_t)seg->start);
419 (uintmax_t)seg->end);
420 sbuf_printf(&sbuf, "domain: %d\n", seg->domain);
421 sbuf_printf(&sbuf, "free list: %p\n", seg->free_queues);
503 struct vm_phys_seg *seg;
509 seg = &vm_phys_segs[vm_phys_nsegs++];
510 while (seg > vm_phys_segs && (seg - 1)->start >= end) {
511 *seg = *(seg - 1);
512 seg--;
514 seg->start = start;
515 seg->end = end;
516 seg->domain = domain;
600 struct vm_phys_seg *seg;
613 seg = &vm_phys_segs[segind];
615 if (seg->end <= VM_ISADMA_BOUNDARY)
620 if (seg->end <= VM_LOWMEM_BOUNDARY)
634 seg->end <= VM_DMA32_BOUNDARY)
639 npages += atop(seg->end - seg->start);
662 seg = &vm_phys_segs[segind];
664 seg->first_page = &vm_page_array[npages];
665 npages += atop(seg->end - seg->start);
667 seg->first_page = PHYS_TO_VM_PAGE(seg->start);
670 if (seg->end <= VM_ISADMA_BOUNDARY) {
677 if (seg->end <= VM_LOWMEM_BOUNDARY) {
684 if (seg->end <= VM_DMA32_BOUNDARY) {
695 seg->free_queues = &vm_phys_free_queues[seg->domain][flind];
846 struct vm_phys_seg *seg;
850 seg = &vm_phys_segs[segind];
851 if (pa >= seg->start && pa < seg->end)
852 return (&seg->first_page[atop(pa - seg->start)]);
860 struct vm_phys_fictitious_seg tmp, *seg;
868 seg = RB_FIND(fict_tree, &vm_phys_fictitious_tree, &tmp);
870 if (seg == NULL)
873 m = &seg->first_page[atop(pa - seg->start)];
897 struct vm_phys_fictitious_seg *seg;
966 seg = malloc(sizeof(*seg), M_FICT_PAGES, M_WAITOK | M_ZERO);
967 seg->start = start;
968 seg->end = end;
969 seg->first_page = fp;
972 RB_INSERT(fict_tree, &vm_phys_fictitious_tree, seg);
981 struct vm_phys_fictitious_seg *seg, tmp;
1027 seg = RB_FIND(fict_tree, &vm_phys_fictitious_tree, &tmp);
1028 if (seg->start != start || seg->end != end) {
1034 RB_REMOVE(fict_tree, &vm_phys_fictitious_tree, seg);
1036 free(seg->first_page, M_FICT_PAGES);
1037 free(seg, M_FICT_PAGES);
1049 struct vm_phys_seg *seg;
1062 seg = &vm_phys_segs[m->segind];
1067 if (pa < seg->start || pa >= seg->end)
1069 m_buddy = &seg->first_page[atop(pa - seg->start)];
1072 fl = (*seg->free_queues)[m_buddy->pool];
1078 m = &seg->first_page[atop(pa - seg->start)];
1081 fl = (*seg->free_queues)[m->pool];
1143 struct vm_phys_seg *seg;
1152 seg = &vm_phys_segs[segind];
1153 if (seg->start >= high)
1155 if (low >= seg->end)
1157 if (low <= seg->start)
1158 m_start = seg->first_page;
1160 m_start = &seg->first_page[atop(low - seg->start)];
1161 if (high < seg->end)
1164 pa_end = seg->end;
1167 m_end = &seg->first_page[atop(pa_end - seg->start)];
1199 struct vm_phys_seg *seg;
1211 seg = &vm_phys_segs[m->segind];
1216 if (pa >= seg->start)
1217 m_set = &seg->first_page[atop(pa - seg->start)];
1235 fl = (*seg->free_queues)[m_set->pool];
1242 m_tmp = &seg->first_page[atop(pa_half - seg->start)];
1245 m_set = &seg->first_page[atop(pa_half - seg->start)];
1317 struct vm_phys_seg *seg;
1334 seg = &vm_phys_segs[segind];
1335 if (seg->start >= high || seg->domain != domain)
1337 if (low >= seg->end)
1339 if (low <= seg->start)
1340 pa_start = seg->start;
1343 if (high < seg->end)
1346 pa_end = seg->end;
1349 m_run = vm_phys_alloc_seg_contig(seg, npages, low, high,
1365 vm_phys_alloc_seg_contig(struct vm_phys_seg *seg, u_long npages,
1385 fl = (*seg->free_queues)[pind];
1405 pa < seg->start ||
1406 pa >= seg->end)
1408 m = &seg->first_page[atop(pa -
1409 seg->start)];
1436 fl = (*seg->free_queues)[m->pool];
1441 fl = (*seg->free_queues)[m_ret->pool];