#include <xen/libelf/libelf.h>
#include <xenguest.h>
-#define INVALID_P2M_ENTRY ((xen_pfn_t)-1)
+#define INVALID_PFN ((xen_pfn_t)-1)
/* --- typedefs and structs ---------------------------------------- */
/* If the list is full, evict a page from the tail end. */
item = ctx->page_list_tail;
- if (item->pfn != INVALID_P2M_ENTRY)
+ if (item->pfn != INVALID_PFN)
ctx->pfn2cache[item->pfn] = NULL;
item->pfn = pfn;
ctx->page_list_tail = item;
}
ctx->pfn2cache[pfn] = NULL;
- (ctx->page_list_tail)->pfn = INVALID_P2M_ENTRY;
+ (ctx->page_list_tail)->pfn = INVALID_PFN;
}
}
/* pagetable page */
if (israw)
invalidate_cache_page(ctx, pfn);
- ctx->sendbuf_pfns[ctx->pfns_len] = israw ? INVALID_P2M_ENTRY : pfn;
+ ctx->sendbuf_pfns[ctx->pfns_len] = israw ? INVALID_PFN : pfn;
memcpy(ctx->inputbuf + ctx->pfns_len * XC_PAGE_SIZE, page, XC_PAGE_SIZE);
ctx->pfns_len++;
cache_copy = NULL;
current_page = ctx->inputbuf + ctx->pfns_index * XC_PAGE_SIZE;
- if (ctx->sendbuf_pfns[ctx->pfns_index] == INVALID_P2M_ENTRY)
+ if (ctx->sendbuf_pfns[ctx->pfns_index] == INVALID_PFN)
israw = 1;
else
cache_copy = get_cache_page(ctx,
for (i = 0; i < num_cache_pages; i++)
{
- ctx->cache[i].pfn = INVALID_P2M_ENTRY;
+ ctx->cache[i].pfn = INVALID_PFN;
ctx->cache[i].page = ctx->cache_base + i * XC_PAGE_SIZE;
ctx->cache[i].prev = (i == 0) ? NULL : &(ctx->cache[i - 1]);
ctx->cache[i].next = ((i+1) == num_cache_pages)? NULL :
gmfn = p2m[i];
else
gmfn = ((uint64_t *)p2m)[i];
- if ( gmfn == INVALID_P2M_ENTRY )
+ if ( gmfn == INVALID_PFN )
continue;
}
else
{
gmfn = ((uint32_t *)p2m)[i];
- if ( gmfn == (uint32_t)INVALID_P2M_ENTRY )
+ if ( gmfn == (uint32_t)INVALID_PFN )
continue;
}
if ( dom->p2m_host == NULL )
return -EINVAL;
for ( pfn = 0; pfn < p2m_size; pfn++ )
- dom->p2m_host[pfn] = INVALID_P2M_ENTRY;
+ dom->p2m_host[pfn] = INVALID_PFN;
/* setup initial p2m and allocate guest memory */
for ( i = 0; i < GUEST_RAM_BANKS && dom->rambank_size[i]; i++ )
__FUNCTION__, dom->p2m_size);
p2m_32 = dom->p2m_guest;
for ( i = 0; i < dom->p2m_size; i++ )
- if ( dom->p2m_host[i] != INVALID_P2M_ENTRY )
+ if ( dom->p2m_host[i] != INVALID_PFN )
p2m_32[i] = dom->p2m_host[i];
else
p2m_32[i] = (uint32_t) - 1;
__FUNCTION__, dom->p2m_size);
p2m_64 = dom->p2m_guest;
for ( i = 0; i < dom->p2m_size; i++ )
- if ( dom->p2m_host[i] != INVALID_P2M_ENTRY )
+ if ( dom->p2m_host[i] != INVALID_PFN )
p2m_64[i] = dom->p2m_host[i];
else
p2m_64[i] = (uint64_t) - 1;
if ( dom->p2m_host == NULL )
return -EINVAL;
for ( pfn = 0; pfn < dom->p2m_size; pfn++ )
- dom->p2m_host[pfn] = INVALID_P2M_ENTRY;
+ dom->p2m_host[pfn] = INVALID_PFN;
/* allocate guest memory */
for ( i = 0; i < nr_vmemranges; i++ )
uint64_t pte, new_pte;
int j;
- if ( (table_mfn == INVALID_P2M_ENTRY) ||
+ if ( (table_mfn == INVALID_PFN) ||
((minfo->pfn_type[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) ==
XEN_DOMCTL_PFINFO_XTAB) )
continue;