ia64/xen-unstable

changeset 16793:003036d7db0f

[IA64] Cleanup duplicate kdump_find_rsvd_region()

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
author Alex Williamson <alex.williamson@hp.com>
date Thu Jan 17 12:05:44 2008 -0700 (2008-01-17)
parents 8977f087351a
children 7238393ef220
files xen/arch/ia64/linux-xen/efi.c
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/efi.c	Thu Jan 17 12:05:44 2008 -0700
     1.2 +++ b/xen/arch/ia64/linux-xen/efi.c	Thu Jan 17 12:05:44 2008 -0700
     1.3 @@ -1211,8 +1211,9 @@ efi_initialize_iomem_resources(struct re
     1.4  		}
     1.5  	}
     1.6  }
     1.7 +#endif /* XEN */
     1.8  
     1.9 -#ifdef CONFIG_KEXEC
    1.10 +#if defined(CONFIG_KEXEC) || defined(XEN)
    1.11  /* find a block of memory aligned to 64M exclude reserved regions
    1.12     rsvd_regions are sorted
    1.13   */
    1.14 @@ -1258,6 +1259,7 @@ kdump_find_rsvd_region (unsigned long si
    1.15  }
    1.16  #endif
    1.17  
    1.18 +#ifndef XEN
    1.19  #ifdef CONFIG_PROC_VMCORE
    1.20  /* locate the size find a the descriptor at a certain address */
    1.21  unsigned long
    1.22 @@ -1288,49 +1290,3 @@ vmcore_find_descriptor_size (unsigned lo
    1.23  }
    1.24  #endif
    1.25  #endif /* XEN */
    1.26 -
    1.27 -#ifdef XEN
    1.28 -/* find a block of memory aligned to 64M exclude reserved regions
    1.29 - * rsvd_regions are sorted
    1.30 - */
    1.31 -unsigned long
    1.32 -kdump_find_rsvd_region(unsigned long size, struct rsvd_region *r, int n)
    1.33 -{
    1.34 -	int i;
    1.35 -	u64 start, end;
    1.36 -	u64 alignment = 1UL << _PAGE_SIZE_64M;
    1.37 -	void *efi_map_start, *efi_map_end, *p;
    1.38 -	efi_memory_desc_t *md;
    1.39 -	u64 efi_desc_size;
    1.40 -
    1.41 -	efi_map_start = __va(ia64_boot_param->efi_memmap);
    1.42 -	efi_map_end   = efi_map_start + ia64_boot_param->efi_memmap_size;
    1.43 -	efi_desc_size = ia64_boot_param->efi_memdesc_size;
    1.44 -
    1.45 -	for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) {
    1.46 -		md = p;
    1.47 -		if (!efi_wb(md))
    1.48 -			continue;
    1.49 -		start = ALIGN(md->phys_addr, alignment);
    1.50 -		end = efi_md_end(md);
    1.51 -		for (i = 0; i < n; i++) {
    1.52 -			if (__pa(r[i].start) >= start && __pa(r[i].end) < end) {
    1.53 -				if (__pa(r[i].start) > start + size)
    1.54 -					return start;
    1.55 -				start = ALIGN(__pa(r[i].end), alignment);
    1.56 -				if (i < n - 1
    1.57 -				    && __pa(r[i + 1].start) < start + size)
    1.58 -					continue;
    1.59 -				else
    1.60 -					break;
    1.61 -			}
    1.62 -		}
    1.63 -		if (end > start + size)
    1.64 -			return start;
    1.65 -	}
    1.66 -
    1.67 -	printk(KERN_WARNING
    1.68 -	       "Cannot reserve 0x%lx byte of memory for crashdump\n", size);
    1.69 -	return ~0UL;
    1.70 -}
    1.71 -#endif