162306a36Sopenharmony_ci/* 262306a36Sopenharmony_ci * Written by: Patricia Gaughen <gone@us.ibm.com>, IBM Corporation 362306a36Sopenharmony_ci * August 2002: added remote node KVA remap - Martin J. Bligh 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Copyright (C) 2002, IBM Corp. 662306a36Sopenharmony_ci * 762306a36Sopenharmony_ci * All rights reserved. 862306a36Sopenharmony_ci * 962306a36Sopenharmony_ci * This program is free software; you can redistribute it and/or modify 1062306a36Sopenharmony_ci * it under the terms of the GNU General Public License as published by 1162306a36Sopenharmony_ci * the Free Software Foundation; either version 2 of the License, or 1262306a36Sopenharmony_ci * (at your option) any later version. 1362306a36Sopenharmony_ci * 1462306a36Sopenharmony_ci * This program is distributed in the hope that it will be useful, but 1562306a36Sopenharmony_ci * WITHOUT ANY WARRANTY; without even the implied warranty of 1662306a36Sopenharmony_ci * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or 1762306a36Sopenharmony_ci * NON INFRINGEMENT. See the GNU General Public License for more 1862306a36Sopenharmony_ci * details. 1962306a36Sopenharmony_ci * 2062306a36Sopenharmony_ci * You should have received a copy of the GNU General Public License 2162306a36Sopenharmony_ci * along with this program; if not, write to the Free Software 2262306a36Sopenharmony_ci * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 2362306a36Sopenharmony_ci */ 2462306a36Sopenharmony_ci 2562306a36Sopenharmony_ci#include <linux/memblock.h> 2662306a36Sopenharmony_ci#include <linux/init.h> 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_ci#include "numa_internal.h" 2962306a36Sopenharmony_ci 3062306a36Sopenharmony_ciextern unsigned long highend_pfn, highstart_pfn; 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_civoid __init initmem_init(void) 3362306a36Sopenharmony_ci{ 3462306a36Sopenharmony_ci x86_numa_init(); 3562306a36Sopenharmony_ci 3662306a36Sopenharmony_ci#ifdef CONFIG_HIGHMEM 3762306a36Sopenharmony_ci highstart_pfn = highend_pfn = max_pfn; 3862306a36Sopenharmony_ci if (max_pfn > max_low_pfn) 3962306a36Sopenharmony_ci highstart_pfn = max_low_pfn; 4062306a36Sopenharmony_ci printk(KERN_NOTICE "%ldMB HIGHMEM available.\n", 4162306a36Sopenharmony_ci pages_to_mb(highend_pfn - highstart_pfn)); 4262306a36Sopenharmony_ci high_memory = (void *) __va(highstart_pfn * PAGE_SIZE - 1) + 1; 4362306a36Sopenharmony_ci#else 4462306a36Sopenharmony_ci high_memory = (void *) __va(max_low_pfn * PAGE_SIZE - 1) + 1; 4562306a36Sopenharmony_ci#endif 4662306a36Sopenharmony_ci printk(KERN_NOTICE "%ldMB LOWMEM available.\n", 4762306a36Sopenharmony_ci pages_to_mb(max_low_pfn)); 4862306a36Sopenharmony_ci printk(KERN_DEBUG "max_low_pfn = %lx, highstart_pfn = %lx\n", 4962306a36Sopenharmony_ci max_low_pfn, highstart_pfn); 5062306a36Sopenharmony_ci 5162306a36Sopenharmony_ci printk(KERN_DEBUG "Low memory ends at vaddr %08lx\n", 5262306a36Sopenharmony_ci (ulong) pfn_to_kaddr(max_low_pfn)); 5362306a36Sopenharmony_ci 5462306a36Sopenharmony_ci printk(KERN_DEBUG "High memory starts at vaddr %08lx\n", 5562306a36Sopenharmony_ci (ulong) pfn_to_kaddr(highstart_pfn)); 5662306a36Sopenharmony_ci 5762306a36Sopenharmony_ci __vmalloc_start_set = true; 5862306a36Sopenharmony_ci setup_bootmem_allocator(); 5962306a36Sopenharmony_ci} 60