diff -r 7ee8bb40200a xen/arch/x86/mm/p2m.c --- a/xen/arch/x86/mm/p2m.c Thu Apr 15 19:11:16 2010 +0100 +++ b/xen/arch/x86/mm/p2m.c Fri Apr 16 18:18:39 2010 +0200 @@ -113,9 +113,9 @@ static void audit_p2m(struct domain *d); # define audit_p2m(_d) do { (void)(_d); } while(0) #endif /* P2M_AUDIT */ -// Find the next level's P2M entry, checking for out-of-range gfn's... -// Returns NULL on error. -// +/* Find the next level's P2M entry, checking for out-of-range gfn's... + * Returns NULL on error. + */ static l1_pgentry_t * p2m_find_entry(void *table, unsigned long *gfn_remainder, unsigned long gfn, u32 shift, u32 max) @@ -150,9 +150,9 @@ p2m_alloc_ptp(struct domain *d, unsigned return pg; } -// Walk one level of the P2M table, allocating a new table if required. -// Returns 0 on error. -// +/* Walk one level of the P2M table, allocating a new table if required. + * Returns 0 on error. + */ static int p2m_next_level(struct domain *d, mfn_t *table_mfn, void **table, unsigned long *gfn_remainder, unsigned long gfn, u32 shift, @@ -1247,12 +1247,12 @@ static int p2m_pod_check_and_populate(st return r; } -// Returns 0 on error (out of memory) +/* Returns 0 on error (out of memory) */ static int p2m_set_entry(struct domain *d, unsigned long gfn, mfn_t mfn, unsigned int page_order, p2m_type_t p2mt) { - // XXX -- this might be able to be faster iff current->domain == d + /* XXX -- this might be able to be faster iff current->domain == d */ mfn_t table_mfn = pagetable_get_mfn(d->arch.phys_table); void *table =map_domain_page(mfn_x(table_mfn)); unsigned long i, gfn_remainder = gfn; @@ -1779,16 +1779,16 @@ int set_p2m_entry(struct domain *d, unsi return rc; } -// Allocate a new p2m table for a domain. -// -// The structure of the p2m table is that of a pagetable for xen (i.e. it is -// controlled by CONFIG_PAGING_LEVELS). -// -// The alloc_page and free_page functions will be used to get memory to -// build the p2m, and to release it again at the end of day. -// -// Returns 0 for success or -errno. -// +/* Allocate a new p2m table for a domain. + * + * The structure of the p2m table is that of a pagetable for xen (i.e. it is + * controlled by CONFIG_PAGING_LEVELS). + * + * The alloc_page and free_page functions will be used to get memory to + * build the p2m, and to release it again at the end of day. + * + * Returns 0 for success or -errno. + */ int p2m_alloc_table(struct domain *d, struct page_info * (*alloc_page)(struct domain *d), void (*free_page)(struct domain *d, struct page_info *pg)) @@ -2000,18 +2000,17 @@ static void audit_p2m(struct domain *d) /* Audit part two: walk the domain's p2m table, checking the entries. */ if ( pagetable_get_pfn(d->arch.phys_table) != 0 ) { + l3_pgentry_t *l3e; l2_pgentry_t *l2e; l1_pgentry_t *l1e; - int i1, i2; + int i1, i2, i3; #if CONFIG_PAGING_LEVELS == 4 l4_pgentry_t *l4e; l3_pgentry_t *l3e; - int i3, i4; + int i4; l4e = map_domain_page(mfn_x(pagetable_get_mfn(d->arch.phys_table))); #else /* CONFIG_PAGING_LEVELS == 3 */ - l3_pgentry_t *l3e; - int i3; l3e = map_domain_page(mfn_x(pagetable_get_mfn(d->arch.phys_table))); #endif