ia64/xen-unstable

changeset 10873:86ff604d8e20

[IA64] rewrite of last util.c patch

Rewrite utils.c patch to be less ugly:
do not set area->phys_addr, recompute phys_addr in free_vm_area.

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author awilliam@xenbuild.aw
date Mon Jul 31 13:12:30 2006 -0600 (2006-07-31)
parents aa9d157d7637
children 1633293e20f8
files linux-2.6-xen-sparse/arch/ia64/xen/util.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/ia64/xen/util.c	Mon Jul 31 13:10:39 2006 -0600
     1.2 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/util.c	Mon Jul 31 13:12:30 2006 -0600
     1.3 @@ -54,7 +54,7 @@ struct vm_struct *alloc_vm_area(unsigned
     1.4          area->size = size;
     1.5          area->pages = NULL; //XXX
     1.6          area->nr_pages = nr_pages;
     1.7 -        area->phys_addr = __pa(virt);
     1.8 +        area->phys_addr = 0; 	/* xenbus_map_ring_valloc uses this field!  */
     1.9  
    1.10  	return area;
    1.11  
    1.12 @@ -70,15 +70,13 @@ void free_vm_area(struct vm_struct *area
    1.13  {
    1.14  	unsigned int order = get_order(area->size);
    1.15  	unsigned long i;
    1.16 -
    1.17 -	/* xenbus_map_ring_valloc overrides this field!  */
    1.18 -	area->phys_addr = __pa(area->addr);
    1.19 +	unsigned long phys_addr = __pa(area->addr);
    1.20  
    1.21  	// This area is used for foreign page mappping.
    1.22  	// So underlying machine page may not be assigned.
    1.23  	for (i = 0; i < (1 << order); i++) {
    1.24  		unsigned long ret;
    1.25 -		unsigned long gpfn = (area->phys_addr >> PAGE_SHIFT) + i;
    1.26 +		unsigned long gpfn = (phys_addr >> PAGE_SHIFT) + i;
    1.27  		struct xen_memory_reservation reservation = {
    1.28  			.nr_extents   = 1,
    1.29  			.address_bits = 0,