Lines Matching refs:phys
433 struct xc_dom_phys *phys; in xc_dom_pfn_to_ptr_retcount() local
451 for ( phys = dom->phys_pages; phys != NULL; phys = phys->next ) in xc_dom_pfn_to_ptr_retcount()
453 if ( pfn >= (phys->first + phys->count) ) in xc_dom_pfn_to_ptr_retcount()
458 if ( (pfn + count) <= phys->first ) in xc_dom_pfn_to_ptr_retcount()
460 if ( (pfn < phys->first) || in xc_dom_pfn_to_ptr_retcount()
461 ((pfn + count) > (phys->first + phys->count)) ) in xc_dom_pfn_to_ptr_retcount()
466 __FUNCTION__, pfn, count, phys->first, in xc_dom_pfn_to_ptr_retcount()
467 phys->count); in xc_dom_pfn_to_ptr_retcount()
476 if ( pfn < phys->first ) in xc_dom_pfn_to_ptr_retcount()
478 if ( pfn >= phys->first + phys->count ) in xc_dom_pfn_to_ptr_retcount()
480 *count_out = phys->count - (pfn - phys->first); in xc_dom_pfn_to_ptr_retcount()
482 return phys->ptr + ((pfn - phys->first) << page_shift); in xc_dom_pfn_to_ptr_retcount()
495 phys = xc_dom_malloc(dom, sizeof(*phys)); in xc_dom_pfn_to_ptr_retcount()
496 if ( phys == NULL ) in xc_dom_pfn_to_ptr_retcount()
498 memset(phys, 0, sizeof(*phys)); in xc_dom_pfn_to_ptr_retcount()
499 phys->first = pfn; in xc_dom_pfn_to_ptr_retcount()
500 phys->count = count; in xc_dom_pfn_to_ptr_retcount()
505 phys->ptr = xc_dom_boot_domU_map(dom, phys->first, phys->count); in xc_dom_pfn_to_ptr_retcount()
506 if ( phys->ptr == NULL ) in xc_dom_pfn_to_ptr_retcount()
508 dom->alloc_domU_map += phys->count << page_shift; in xc_dom_pfn_to_ptr_retcount()
515 phys->ptr = mmap(NULL, phys->count << page_shift, in xc_dom_pfn_to_ptr_retcount()
518 if ( phys->ptr == MAP_FAILED ) in xc_dom_pfn_to_ptr_retcount()
527 dom->alloc_mem_map += phys->count << page_shift; in xc_dom_pfn_to_ptr_retcount()
532 __FUNCTION__, mode, phys->first, phys->count, phys->ptr); in xc_dom_pfn_to_ptr_retcount()
534 phys->next = dom->phys_pages; in xc_dom_pfn_to_ptr_retcount()
535 dom->phys_pages = phys; in xc_dom_pfn_to_ptr_retcount()
536 return phys->ptr; in xc_dom_pfn_to_ptr_retcount()
644 struct xc_dom_phys *phys, *prev = NULL; in xc_dom_unmap_one() local
646 for ( phys = dom->phys_pages; phys != NULL; phys = phys->next ) in xc_dom_unmap_one()
648 if ( (pfn >= phys->first) && (pfn < (phys->first + phys->count)) ) in xc_dom_unmap_one()
650 prev = phys; in xc_dom_unmap_one()
652 if ( !phys ) in xc_dom_unmap_one()
659 munmap(phys->ptr, phys->count << page_shift); in xc_dom_unmap_one()
661 prev->next = phys->next; in xc_dom_unmap_one()
663 dom->phys_pages = phys->next; in xc_dom_unmap_one()
665 xc_domain_cacheflush(dom->xch, dom->guest_domid, phys->first, phys->count); in xc_dom_unmap_one()