2005-09-26 08:04:21 +02:00
|
|
|
/*
|
|
|
|
* Declarations of procedures and variables shared between files
|
|
|
|
* in arch/ppc/mm/.
|
|
|
|
*
|
|
|
|
* Derived from arch/ppc/mm/init.c:
|
|
|
|
* Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
|
|
|
|
*
|
|
|
|
* Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
|
|
|
|
* and Cort Dougan (PReP) (cort@cs.nmt.edu)
|
|
|
|
* Copyright (C) 1996 Paul Mackerras
|
|
|
|
*
|
|
|
|
* Derived from "arch/i386/mm/init.c"
|
|
|
|
* Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
2007-04-24 05:09:12 +02:00
|
|
|
#include <linux/mm.h>
|
2005-09-26 08:04:21 +02:00
|
|
|
#include <asm/tlbflush.h>
|
|
|
|
#include <asm/mmu.h>
|
|
|
|
|
2007-04-12 07:30:22 +02:00
|
|
|
extern void hash_preload(struct mm_struct *mm, unsigned long ea,
|
|
|
|
unsigned long access, unsigned long trap);
|
|
|
|
|
|
|
|
|
2005-10-10 13:58:35 +02:00
|
|
|
#ifdef CONFIG_PPC32
|
2005-09-26 08:04:21 +02:00
|
|
|
extern void mapin_ram(void);
|
|
|
|
extern int map_page(unsigned long va, phys_addr_t pa, int flags);
|
|
|
|
extern void setbat(int index, unsigned long virt, unsigned long phys,
|
|
|
|
unsigned int size, int flags);
|
|
|
|
extern void settlbcam(int index, unsigned long virt, phys_addr_t phys,
|
|
|
|
unsigned int size, int flags, unsigned int pid);
|
|
|
|
extern void invalidate_tlbcam_entry(int index);
|
|
|
|
|
|
|
|
extern int __map_without_bats;
|
|
|
|
extern unsigned long ioremap_base;
|
|
|
|
extern unsigned int rtas_data, rtas_size;
|
|
|
|
|
2007-06-13 06:52:56 +02:00
|
|
|
struct hash_pte;
|
|
|
|
extern struct hash_pte *Hash, *Hash_end;
|
2005-09-26 08:04:21 +02:00
|
|
|
extern unsigned long Hash_size, Hash_mask;
|
|
|
|
|
|
|
|
extern unsigned int num_tlbcam_entries;
|
2005-10-10 13:58:35 +02:00
|
|
|
#endif
|
|
|
|
|
2005-11-16 05:43:48 +01:00
|
|
|
extern unsigned long ioremap_bot;
|
2005-10-10 13:58:35 +02:00
|
|
|
extern unsigned long __max_low_memory;
|
|
|
|
extern unsigned long __initial_memory_limit;
|
|
|
|
extern unsigned long total_memory;
|
|
|
|
extern unsigned long total_lowmem;
|
2005-09-26 08:04:21 +02:00
|
|
|
|
|
|
|
/* ...and now those things that may be slightly different between processor
|
|
|
|
* architectures. -- Dan
|
|
|
|
*/
|
|
|
|
#if defined(CONFIG_8xx)
|
|
|
|
#define flush_HPTE(X, va, pg) _tlbie(va)
|
|
|
|
#define MMU_init_hw() do { } while(0)
|
|
|
|
#define mmu_mapin_ram() (0UL)
|
|
|
|
|
|
|
|
#elif defined(CONFIG_4xx)
|
|
|
|
#define flush_HPTE(X, va, pg) _tlbie(va)
|
|
|
|
extern void MMU_init_hw(void);
|
|
|
|
extern unsigned long mmu_mapin_ram(void);
|
|
|
|
|
|
|
|
#elif defined(CONFIG_FSL_BOOKE)
|
|
|
|
#define flush_HPTE(X, va, pg) _tlbie(va)
|
|
|
|
extern void MMU_init_hw(void);
|
|
|
|
extern unsigned long mmu_mapin_ram(void);
|
|
|
|
extern void adjust_total_lowmem(void);
|
|
|
|
|
2005-10-10 13:58:35 +02:00
|
|
|
#elif defined(CONFIG_PPC32)
|
|
|
|
/* anything 32-bit except 4xx or 8xx */
|
2005-09-26 08:04:21 +02:00
|
|
|
extern void MMU_init_hw(void);
|
|
|
|
extern unsigned long mmu_mapin_ram(void);
|
|
|
|
|
|
|
|
/* Be careful....this needs to be updated if we ever encounter 603 SMPs,
|
|
|
|
* which includes all new 82xx processors. We need tlbie/tlbsync here
|
|
|
|
* in that case (I think). -- Dan.
|
|
|
|
*/
|
|
|
|
static inline void flush_HPTE(unsigned context, unsigned long va,
|
|
|
|
unsigned long pdval)
|
|
|
|
{
|
|
|
|
if ((Hash != 0) &&
|
|
|
|
cpu_has_feature(CPU_FTR_HPTE_TABLE))
|
|
|
|
flush_hash_pages(0, va, pdval, 1);
|
|
|
|
else
|
|
|
|
_tlbie(va);
|
|
|
|
}
|
|
|
|
#endif
|