ia64/xen-unstable

changeset 9757:bb99a6e5456a

[IA64] introduce efi_memmap_walk_type

introduce efi_memmap_walk_type() for the next dom0 builder patch.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author awilliam@ldap.hp.com
date Tue Apr 25 13:11:15 2006 -0600 (2006-04-25)
parents 14a34d811e81
children ae0d41bd3bba
files xen/arch/ia64/linux-xen/efi.c xen/include/asm-ia64/linux-xen/linux/efi.h
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/efi.c	Tue Apr 25 13:06:57 2006 -0600
     1.2 +++ b/xen/arch/ia64/linux-xen/efi.c	Tue Apr 25 13:11:15 2006 -0600
     1.3 @@ -455,6 +455,27 @@ efi_memmap_walk_uc (efi_freemem_callback
     1.4  	}
     1.5  }
     1.6  
     1.7 +#ifdef XEN
     1.8 +void
     1.9 +efi_memmap_walk_type(u32 type, efi_walk_type_callback_t callback, void *arg)
    1.10 +{
    1.11 +	void *efi_map_start, *efi_map_end, *p;
    1.12 +	efi_memory_desc_t *md;
    1.13 +	u64 efi_desc_size;
    1.14 +
    1.15 +	efi_map_start = __va(ia64_boot_param->efi_memmap);
    1.16 +	efi_map_end = efi_map_start + ia64_boot_param->efi_memmap_size;
    1.17 +	efi_desc_size = ia64_boot_param->efi_memdesc_size;
    1.18 +
    1.19 +	for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) {
    1.20 +		md = p;
    1.21 +		if (md->type == type) {
    1.22 +			if ((*callback)(md, arg) < 0)
    1.23 +				return;
    1.24 +		}
    1.25 +	}
    1.26 +}
    1.27 +#endif
    1.28  
    1.29  /*
    1.30   * Look for the PAL_CODE region reported by EFI and maps it using an
     2.1 --- a/xen/include/asm-ia64/linux-xen/linux/efi.h	Tue Apr 25 13:06:57 2006 -0600
     2.2 +++ b/xen/include/asm-ia64/linux-xen/linux/efi.h	Tue Apr 25 13:11:15 2006 -0600
     2.3 @@ -293,6 +293,10 @@ extern void *efi_get_pal_addr (void);
     2.4  extern void efi_map_pal_code (void);
     2.5  extern void efi_map_memmap(void);
     2.6  extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg);
     2.7 +#ifdef XEN
     2.8 +typedef int (*efi_walk_type_callback_t)(efi_memory_desc_t *md, void *arg);
     2.9 +extern void efi_memmap_walk_type(u32 type, efi_walk_type_callback_t callback, void *arg);
    2.10 +#endif
    2.11  extern void efi_gettimeofday (struct timespec *ts);
    2.12  extern void efi_enter_virtual_mode (void);	/* switch EFI to virtual mode, if possible */
    2.13  extern u64 efi_get_iobase (void);