debuggers.hg

diff xen/arch/x86/memory.c @ 3620:6d98eb831816

bitkeeper revision 1.1159.212.52 (41fa6980PfhDt-hKCfacnyHcFB7DNQ)

Make page allocator 64-bit safe.
Signed-off-by: keir.fraser@cl.cam.ac.uk
author kaf24@scramble.cl.cam.ac.uk
date Fri Jan 28 16:34:08 2005 +0000 (2005-01-28)
parents eef1949801b8
children fec8b1778268
line diff
     1.1 --- a/xen/arch/x86/memory.c	Fri Jan 28 15:39:56 2005 +0000
     1.2 +++ b/xen/arch/x86/memory.c	Fri Jan 28 16:34:08 2005 +0000
     1.3 @@ -148,13 +148,18 @@ unsigned long max_page;
     1.4  
     1.5  void __init init_frametable(void)
     1.6  {
     1.7 -#ifdef __i386__
     1.8 +#if defined(__i386__)
     1.9      unsigned long i, p;
    1.10 +#endif
    1.11  
    1.12 -    frame_table      = (struct pfn_info *)FRAMETABLE_VIRT_START;
    1.13      frame_table_size = max_page * sizeof(struct pfn_info);
    1.14      frame_table_size = (frame_table_size + PAGE_SIZE - 1) & PAGE_MASK;
    1.15  
    1.16 +#if defined(__x86_64__)
    1.17 +    frame_table = __va(alloc_boot_pages(frame_table_size, 4UL << 20));
    1.18 +#elif defined(__i386__)
    1.19 +    frame_table = (struct pfn_info *)FRAMETABLE_VIRT_START;
    1.20 +
    1.21      for ( i = 0; i < frame_table_size; i += (4UL << 20) )
    1.22      {
    1.23          p = alloc_boot_pages(min(frame_table_size - i, 4UL << 20), 4UL << 20);
    1.24 @@ -163,9 +168,9 @@ void __init init_frametable(void)
    1.25          idle_pg_table[(FRAMETABLE_VIRT_START + i) >> L2_PAGETABLE_SHIFT] =
    1.26              mk_l2_pgentry(p | __PAGE_HYPERVISOR | _PAGE_PSE);
    1.27      }
    1.28 +#endif
    1.29  
    1.30      memset(frame_table, 0, frame_table_size);
    1.31 -#endif
    1.32  }
    1.33  
    1.34  void arch_init_memory(void)