/* * PowerPC64 port by Mike Corrigan and Dave Engebretsen * {mikejc|engebret}@us.ibm.com * * Copyright (c) 2000 Mike Corrigan <mikejc@us.ibm.com> * * SMP scalability work: * Copyright (C) 2001 Anton Blanchard <anton@au.ibm.com>, IBM * * Module name: htab.c * * Description: * PowerPC Hashed Page Table functions * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */#undef DEBUG#undef DEBUG_LOW#include<linux/spinlock.h>#include<linux/errno.h>#include<linux/sched.h>#include<linux/proc_fs.h>#include<linux/stat.h>#include<linux/sysctl.h>#include<linux/export.h>#include<linux/ctype.h>#include<linux/cache.h>#include<linux/init.h>#include<linux/signal.h>#include<linux/memblock.h>#include<linux/context_tracking.h>#include<asm/processor.h>#include<asm/pgtable.h>#include<asm/mmu.h>#include<asm/mmu_context.h>#include<asm/page.h>#include<asm/types.h>#include<asm/uaccess.h>#include<asm/machdep.h>#include<asm/prom.h>#include<asm/tlbflush.h>#include<asm/io.h>#include<asm/eeh.h>#include<asm/tlb.h>#include<asm/cacheflush.h>#include<asm/cputable.h>#include<asm/sections.h>#include<asm/spu.h>#include<asm/udbg.h>#include<asm/code-patching.h>#include<asm/fadump.h>#include<asm/firmware.h>#include<asm/tm.h>#ifdef DEBUG#define DBG(fmt...) udbg_printf(fmt)#else#define DBG(fmt...)#endif#ifdef DEBUG_LOW#define DBG_LOW(fmt...) udbg_printf(fmt)#else#define DBG_LOW(fmt...)#endif#define KB (1024)#define MB (1024*KB)#define GB (1024L*MB)/* * Note: pte --> Linux PTE * HPTE --> PowerPC Hashed Page Table Entry * * Execution context: * htab_initialize is called with the MMU off (of course), but * the kernel has been copied down to zero so it can directly * reference global data. At this point it is very difficult * to print debug info. * */#ifdef CONFIG_U3_DARTexternunsignedlongdart_tablebase;#endif /* CONFIG_U3_DART */staticunsigned