Commit | Line | Data |
---|---|---|
14cf11af PM |
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 | */ | |
62102307 | 22 | #include <linux/mm.h> |
14cf11af PM |
23 | #include <asm/tlbflush.h> |
24 | #include <asm/mmu.h> | |
25 | ||
ee4f2ea4 BH |
26 | extern void hash_preload(struct mm_struct *mm, unsigned long ea, |
27 | unsigned long access, unsigned long trap); | |
28 | ||
29 | ||
ab1f9dac | 30 | #ifdef CONFIG_PPC32 |
14cf11af PM |
31 | extern void mapin_ram(void); |
32 | extern int map_page(unsigned long va, phys_addr_t pa, int flags); | |
33 | extern void setbat(int index, unsigned long virt, unsigned long phys, | |
34 | unsigned int size, int flags); | |
14cf11af PM |
35 | extern void settlbcam(int index, unsigned long virt, phys_addr_t phys, |
36 | unsigned int size, int flags, unsigned int pid); | |
37 | extern void invalidate_tlbcam_entry(int index); | |
38 | ||
39 | extern int __map_without_bats; | |
40 | extern unsigned long ioremap_base; | |
14cf11af PM |
41 | extern unsigned int rtas_data, rtas_size; |
42 | ||
57d7909e DG |
43 | struct _PTE; |
44 | extern struct _PTE *Hash, *Hash_end; | |
14cf11af PM |
45 | extern unsigned long Hash_size, Hash_mask; |
46 | ||
47 | extern unsigned int num_tlbcam_entries; | |
ab1f9dac PM |
48 | #endif |
49 | ||
800fc3ee | 50 | extern unsigned long ioremap_bot; |
ab1f9dac PM |
51 | extern unsigned long __max_low_memory; |
52 | extern unsigned long __initial_memory_limit; | |
53 | extern unsigned long total_memory; | |
54 | extern unsigned long total_lowmem; | |
14cf11af PM |
55 | |
56 | /* ...and now those things that may be slightly different between processor | |
57 | * architectures. -- Dan | |
58 | */ | |
59 | #if defined(CONFIG_8xx) | |
60 | #define flush_HPTE(X, va, pg) _tlbie(va) | |
61 | #define MMU_init_hw() do { } while(0) | |
62 | #define mmu_mapin_ram() (0UL) | |
63 | ||
64 | #elif defined(CONFIG_4xx) | |
65 | #define flush_HPTE(X, va, pg) _tlbie(va) | |
66 | extern void MMU_init_hw(void); | |
67 | extern unsigned long mmu_mapin_ram(void); | |
68 | ||
69 | #elif defined(CONFIG_FSL_BOOKE) | |
70 | #define flush_HPTE(X, va, pg) _tlbie(va) | |
71 | extern void MMU_init_hw(void); | |
72 | extern unsigned long mmu_mapin_ram(void); | |
73 | extern void adjust_total_lowmem(void); | |
74 | ||
ab1f9dac PM |
75 | #elif defined(CONFIG_PPC32) |
76 | /* anything 32-bit except 4xx or 8xx */ | |
14cf11af PM |
77 | extern void MMU_init_hw(void); |
78 | extern unsigned long mmu_mapin_ram(void); | |
79 | ||
80 | /* Be careful....this needs to be updated if we ever encounter 603 SMPs, | |
81 | * which includes all new 82xx processors. We need tlbie/tlbsync here | |
82 | * in that case (I think). -- Dan. | |
83 | */ | |
84 | static inline void flush_HPTE(unsigned context, unsigned long va, | |
85 | unsigned long pdval) | |
86 | { | |
87 | if ((Hash != 0) && | |
88 | cpu_has_feature(CPU_FTR_HPTE_TABLE)) | |
89 | flush_hash_pages(0, va, pdval, 1); | |
90 | else | |
91 | _tlbie(va); | |
92 | } | |
800fc3ee DG |
93 | #else /* CONFIG_PPC64 */ |
94 | /* imalloc region types */ | |
95 | #define IM_REGION_UNUSED 0x1 | |
96 | #define IM_REGION_SUBSET 0x2 | |
97 | #define IM_REGION_EXISTS 0x4 | |
98 | #define IM_REGION_OVERLAP 0x8 | |
99 | #define IM_REGION_SUPERSET 0x10 | |
100 | ||
101 | extern struct vm_struct * im_get_free_area(unsigned long size); | |
102 | extern struct vm_struct * im_get_area(unsigned long v_addr, unsigned long size, | |
103 | int region_type); | |
104 | extern void im_free(void *addr); | |
14cf11af | 105 | #endif |