# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID 3d60bf30dff21fec2fdc8a931c725c23508cb94c
# Parent 1eed6129bd9a15d3bf58f9cc88ed2535506c11e2
[POWERPC][XEN] Clean up init_frame_table()
figure out its size correctly and remove unused global
Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
---
xen/arch/powerpc/mm.c | 18 ++++++++++--------
xen/include/asm-powerpc/mm.h | 2 --
2 files changed, 10 insertions(+), 10 deletions(-)
diff -r 1eed6129bd9a -r 3d60bf30dff2 xen/arch/powerpc/mm.c
--- a/xen/arch/powerpc/mm.c Thu Sep 14 12:31:52 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 1eed6129bd9a -r 3d60bf30dff2 xen/include/asm-powerpc/mm.h
--- a/xen/include/asm-powerpc/mm.h Thu Sep 14 12:31:52 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-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel
|