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

[Xen-changelog] [xen-unstable] [POWERPC][XEN] Clean up init_frame_table()



# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID 33266be3c635d3775a4035bb52167c5b310d8296
# Parent  2b8660a8a9bc402a21c6130c05e73f6ce2fb9a38
[POWERPC][XEN] Clean up init_frame_table()

figure out its size correctly and remove unused global

Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Signed-off-by: Hollis Blanchard <hollisb@xxxxxxxxxx>
---
 xen/arch/powerpc/mm.c        |   18 ++++++++++--------
 xen/include/asm-powerpc/mm.h |    2 --
 2 files changed, 10 insertions(+), 10 deletions(-)

diff -r 2b8660a8a9bc -r 33266be3c635 xen/arch/powerpc/mm.c
--- a/xen/arch/powerpc/mm.c     Mon Sep 18 13:21:39 2006 -0500
+++ b/xen/arch/powerpc/mm.c     Thu Sep 14 14:20:48 2006 -0400
@@ -39,7 +39,6 @@
 
 /* Frame table and its size in pages. */
 struct page_info *frame_table;
-unsigned long frame_table_size;
 unsigned long max_page;
 unsigned long total_pages;
 
@@ -190,17 +189,20 @@ void __init init_frametable(void)
 void __init init_frametable(void)
 {
     unsigned long p;
-
-    frame_table_size = PFN_UP(max_page * sizeof(struct page_info));
-
-    p = alloc_boot_pages(min(frame_table_size, 4UL << 20), 1);
+    unsigned long nr_pages;
+    int i;
+
+    nr_pages = PFN_UP(max_page * sizeof(struct page_info));
+    nr_pages = min(nr_pages, (4UL << (20 - PAGE_SHIFT)));
+    
+
+    p = alloc_boot_pages(nr_pages, 1);
     if (p == 0)
         panic("Not enough memory for frame table\n");
 
     frame_table = (struct page_info *)(p << PAGE_SHIFT);
-    frame_table_size = (frame_table_size + PAGE_SIZE - 1) & PAGE_MASK;
-
-    memset(frame_table, 0, frame_table_size);
+    for (i = 0; i < nr_pages; i += 1)
+        clear_page((void *)((p + i) << PAGE_SHIFT));
 }
 
 long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
diff -r 2b8660a8a9bc -r 33266be3c635 xen/include/asm-powerpc/mm.h
--- a/xen/include/asm-powerpc/mm.h      Mon Sep 18 13:21:39 2006 -0500
+++ b/xen/include/asm-powerpc/mm.h      Thu Sep 14 14:20:48 2006 -0400
@@ -229,8 +229,6 @@ extern vm_assist_info_t vm_assist_info[]
 #define share_xen_page_with_guest(p, d, r) do { } while (0)
 #define share_xen_page_with_privileged_guests(p, r) do { } while (0)
 
-extern unsigned long frame_table_size;
-
 /* hope that accesses to this will fail spectacularly */
 #define machine_to_phys_mapping ((u32 *)-1UL)
 

_______________________________________________
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®.