Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Written by: Patricia Gaughen <gone@us.ibm.com>, IBM Corporation
0003  * August 2002: added remote node KVA remap - Martin J. Bligh 
0004  *
0005  * Copyright (C) 2002, IBM Corp.
0006  *
0007  * All rights reserved.          
0008  *
0009  * This program is free software; you can redistribute it and/or modify
0010  * it under the terms of the GNU General Public License as published by
0011  * the Free Software Foundation; either version 2 of the License, or
0012  * (at your option) any later version.
0013  *
0014  * This program is distributed in the hope that it will be useful, but
0015  * WITHOUT ANY WARRANTY; without even the implied warranty of
0016  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
0017  * NON INFRINGEMENT.  See the GNU General Public License for more
0018  * details.
0019  *
0020  * You should have received a copy of the GNU General Public License
0021  * along with this program; if not, write to the Free Software
0022  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
0023  */
0024 
0025 #include <linux/memblock.h>
0026 #include <linux/init.h>
0027 
0028 #include "numa_internal.h"
0029 
0030 extern unsigned long highend_pfn, highstart_pfn;
0031 
0032 void __init initmem_init(void)
0033 {
0034     x86_numa_init();
0035 
0036 #ifdef CONFIG_HIGHMEM
0037     highstart_pfn = highend_pfn = max_pfn;
0038     if (max_pfn > max_low_pfn)
0039         highstart_pfn = max_low_pfn;
0040     printk(KERN_NOTICE "%ldMB HIGHMEM available.\n",
0041            pages_to_mb(highend_pfn - highstart_pfn));
0042     high_memory = (void *) __va(highstart_pfn * PAGE_SIZE - 1) + 1;
0043 #else
0044     high_memory = (void *) __va(max_low_pfn * PAGE_SIZE - 1) + 1;
0045 #endif
0046     printk(KERN_NOTICE "%ldMB LOWMEM available.\n",
0047             pages_to_mb(max_low_pfn));
0048     printk(KERN_DEBUG "max_low_pfn = %lx, highstart_pfn = %lx\n",
0049             max_low_pfn, highstart_pfn);
0050 
0051     printk(KERN_DEBUG "Low memory ends at vaddr %08lx\n",
0052             (ulong) pfn_to_kaddr(max_low_pfn));
0053 
0054     printk(KERN_DEBUG "High memory starts at vaddr %08lx\n",
0055             (ulong) pfn_to_kaddr(highstart_pfn));
0056 
0057     __vmalloc_start_set = true;
0058     setup_bootmem_allocator();
0059 }