ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / ppc / mm / mmu_decl.h
1 /*
2  * Declarations of procedures and variables shared between files
3  * in arch/ppc/mm/.
4  *
5  *  Derived from arch/ppc/mm/init.c:
6  *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
7  *
8  *  Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
9  *  and Cort Dougan (PReP) (cort@cs.nmt.edu)
10  *    Copyright (C) 1996 Paul Mackerras
11  *  Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
12  *
13  *  Derived from "arch/i386/mm/init.c"
14  *    Copyright (C) 1991, 1992, 1993, 1994  Linus Torvalds
15  *
16  *  This program is free software; you can redistribute it and/or
17  *  modify it under the terms of the GNU General Public License
18  *  as published by the Free Software Foundation; either version
19  *  2 of the License, or (at your option) any later version.
20  *
21  */
22 #include <asm/tlbflush.h>
23 #include <asm/mmu.h>
24
25 extern void mapin_ram(void);
26 extern int map_page(unsigned long va, phys_addr_t pa, int flags);
27 extern void setbat(int index, unsigned long virt, unsigned long phys,
28                    unsigned int size, int flags);
29 extern void reserve_phys_mem(unsigned long start, unsigned long size);
30
31 extern int __map_without_bats;
32 extern unsigned long ioremap_base;
33 extern unsigned long ioremap_bot;
34 extern unsigned int rtas_data, rtas_size;
35
36 extern unsigned long total_memory;
37 extern unsigned long total_lowmem;
38 extern int mem_init_done;
39
40 extern PTE *Hash, *Hash_end;
41 extern unsigned long Hash_size, Hash_mask;
42
43 /* ...and now those things that may be slightly different between processor
44  * architectures.  -- Dan
45  */
46 #if defined(CONFIG_8xx)
47 #define flush_HPTE(X, va, pg)   _tlbie(va)
48 #define MMU_init_hw()           do { } while(0)
49 #define mmu_mapin_ram()         (0UL)
50
51 #elif defined(CONFIG_4xx)
52 #define flush_HPTE(X, va, pg)   _tlbie(va)
53 extern void MMU_init_hw(void);
54 extern unsigned long mmu_mapin_ram(void);
55
56 #else
57 /* anything except 4xx or 8xx */
58 extern void MMU_init_hw(void);
59 extern unsigned long mmu_mapin_ram(void);
60
61 /* Be careful....this needs to be updated if we ever encounter 603 SMPs,
62  * which includes all new 82xx processors.  We need tlbie/tlbsync here
63  * in that case (I think). -- Dan.
64  */
65 static inline void flush_HPTE(unsigned context, unsigned long va,
66                               unsigned long pdval)
67 {
68         if ((Hash != 0) &&
69             (cur_cpu_spec[0]->cpu_features & CPU_FTR_HPTE_TABLE))
70                 flush_hash_pages(0, va, pdval, 1);
71         else
72                 _tlbie(va);
73 }
74 #endif