[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [IA64] memmap: dump-core: enable ia64 memory map code



# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1179778167 21600
# Node ID 6450f6287898ea5b2e7420647bf13cf709f949ce
# Parent  fc49dbce4868e01c0d7fb3dee16e242160d9986e
[IA64] memmap: dump-core: enable ia64 memory map code

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 tools/libxc/xc_core_ia64.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff -r fc49dbce4868 -r 6450f6287898 tools/libxc/xc_core_ia64.c
--- a/tools/libxc/xc_core_ia64.c        Mon May 21 14:08:19 2007 -0600
+++ b/tools/libxc/xc_core_ia64.c        Mon May 21 14:09:27 2007 -0600
@@ -163,20 +163,23 @@ xc_core_arch_memory_map_get(int xc_handl
                             xc_core_memory_map_t **mapp,
                             unsigned int *nr_entries)
 {
-#ifdef notyet
     int ret = -1;
     xen_ia64_memmap_info_t *memmap_info;
+    unsigned long map_size;
     xc_core_memory_map_t *map;
     char *start;
     char *end;
     char *p;
     efi_memory_desc_t *md;
 
-    if  ( live_shinfo == NULL || live_shinfo->arch.memmap_info_pfn == 0 )
+    if  ( live_shinfo == NULL ||
+          live_shinfo->arch.memmap_info_num_pages == 0 ||
+          live_shinfo->arch.memmap_info_pfn == 0 )
         goto old;
 
+    map_size = PAGE_SIZE * live_shinfo->arch.memmap_info_num_pages;
     memmap_info = xc_map_foreign_range(xc_handle, info->domid,
-                                       PAGE_SIZE, PROT_READ,
+                                       map_size, PROT_READ,
                                        live_shinfo->arch.memmap_info_pfn);
     if ( memmap_info == NULL )
     {
@@ -185,7 +188,7 @@ xc_core_arch_memory_map_get(int xc_handl
     }
     if ( memmap_info->efi_memdesc_size != sizeof(*md) ||
          (memmap_info->efi_memmap_size / memmap_info->efi_memdesc_size) == 0 ||
-         memmap_info->efi_memmap_size > PAGE_SIZE - sizeof(memmap_info) ||
+         memmap_info->efi_memmap_size > map_size - sizeof(memmap_info) ||
          memmap_info->efi_memdesc_version != EFI_MEMORY_DESCRIPTOR_VERSION )
     {
         PERROR("unknown memmap header. defaulting to compat mode.");
@@ -219,12 +222,11 @@ xc_core_arch_memory_map_get(int xc_handl
     }
     ret = 0;
 out:
-    munmap(memmap_info, PAGE_SIZE);
+    munmap(memmap_info, map_size);
     qsort(map, *nr_entries, sizeof(map[0]), &xc_memory_map_cmp);
     return ret;
     
 old:
-#endif
     return memory_map_get_old(xc_handle, info, live_shinfo, mapp, nr_entries);
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.