ia64/xen-unstable

view xen/arch/ia64/xenmem.c @ 4703:d061c29af8d7

bitkeeper revision 1.1327.1.11 (42716283nLvDhTYM3QOqDMa-wZuJHQ)

More code cleanup
author djm@kirby.fc.hp.com
date Thu Apr 28 22:24:03 2005 +0000 (2005-04-28)
parents
children ba75d06d25c5
line source
1 /*
2 * Xen memory allocator routines
3 *
4 * Copyright (C) 2005 Hewlett-Packard Co
5 * Dan Magenheimer <dan.magenheimer@hp.com>
6 * Copyright (C) 2005 Intel Corp.
7 *
8 * Routines used by ia64 machines with contiguous (or virtually contiguous)
9 * memory.
10 */
12 #include <linux/config.h>
13 #include <asm/pgtable.h>
15 extern struct page *zero_page_memmap_ptr;
16 struct pfn_info *frame_table;
17 unsigned long frame_table_size;
18 unsigned long max_page;
20 struct page *mem_map;
21 #define MAX_DMA_ADDRESS ~0UL // FIXME???
23 #ifdef CONFIG_VIRTUAL_MEM_MAP
24 static unsigned long num_dma_physpages;
25 #endif
27 /*
28 * Set up the page tables.
29 */
31 void
32 paging_init (void)
33 {
34 struct pfn_info *pg;
35 /* Allocate and map the machine-to-phys table */
36 if ((pg = alloc_domheap_pages(NULL, 10)) == NULL)
37 panic("Not enough memory to bootstrap Xen.\n");
38 memset(page_to_virt(pg), 0x55, 16UL << 20);
40 /* Other mapping setup */
42 zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page));
43 }
45 /* FIXME: postpone support to machines with big holes between physical memorys.
46 * Current hack allows only efi memdesc upto 4G place. (See efi.c)
47 */
48 #ifndef CONFIG_VIRTUAL_MEM_MAP
49 #define FT_ALIGN_SIZE (16UL << 20)
50 void __init init_frametable(void)
51 {
52 unsigned long i, p;
53 frame_table_size = max_page * sizeof(struct pfn_info);
54 frame_table_size = (frame_table_size + PAGE_SIZE - 1) & PAGE_MASK;
56 /* Request continuous trunk from boot allocator, since HV
57 * address is identity mapped */
58 p = alloc_boot_pages(frame_table_size, FT_ALIGN_SIZE);
59 if (p == 0)
60 panic("Not enough memory for frame table.\n");
62 frame_table = __va(p);
63 memset(frame_table, 0, frame_table_size);
64 printk("size of frame_table: %lukB\n",
65 frame_table_size >> 10);
66 }
67 #endif