aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/mm/memory.c
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2007-05-31 03:40:54 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-31 10:58:14 -0400
commit12d810c1b8c2b913d48e629e2b5c01d105029839 (patch)
treeb39162d3168f6173af3d0e5790e16eb45a70dfaf /arch/m68k/mm/memory.c
parent00c541eae7a477e3d1adb1ebf27cccc0bdb5f824 (diff)
m68k: discontinuous memory support
Fix support for discontinuous memory Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/m68k/mm/memory.c')
-rw-r--r--arch/m68k/mm/memory.c73
1 files changed, 0 insertions, 73 deletions
diff --git a/arch/m68k/mm/memory.c b/arch/m68k/mm/memory.c
index 13c0b4ad01eb..b7473525b431 100644
--- a/arch/m68k/mm/memory.c
+++ b/arch/m68k/mm/memory.c
@@ -127,67 +127,6 @@ int free_pointer_table (pmd_t *ptable)
127 return 0; 127 return 0;
128} 128}
129 129
130#ifdef DEBUG_INVALID_PTOV
131int mm_inv_cnt = 5;
132#endif
133
134#ifndef CONFIG_SINGLE_MEMORY_CHUNK
135/*
136 * The following two routines map from a physical address to a kernel
137 * virtual address and vice versa.
138 */
139unsigned long mm_vtop(unsigned long vaddr)
140{
141 int i=0;
142 unsigned long voff = (unsigned long)vaddr - PAGE_OFFSET;
143
144 do {
145 if (voff < m68k_memory[i].size) {
146#ifdef DEBUGPV
147 printk ("VTOP(%p)=%lx\n", vaddr,
148 m68k_memory[i].addr + voff);
149#endif
150 return m68k_memory[i].addr + voff;
151 }
152 voff -= m68k_memory[i].size;
153 } while (++i < m68k_num_memory);
154
155 /* As a special case allow `__pa(high_memory)'. */
156 if (voff == 0)
157 return m68k_memory[i-1].addr + m68k_memory[i-1].size;
158
159 return -1;
160}
161EXPORT_SYMBOL(mm_vtop);
162
163unsigned long mm_ptov (unsigned long paddr)
164{
165 int i = 0;
166 unsigned long poff, voff = PAGE_OFFSET;
167
168 do {
169 poff = paddr - m68k_memory[i].addr;
170 if (poff < m68k_memory[i].size) {
171#ifdef DEBUGPV
172 printk ("PTOV(%lx)=%lx\n", paddr, poff + voff);
173#endif
174 return poff + voff;
175 }
176 voff += m68k_memory[i].size;
177 } while (++i < m68k_num_memory);
178
179#ifdef DEBUG_INVALID_PTOV
180 if (mm_inv_cnt > 0) {
181 mm_inv_cnt--;
182 printk("Invalid use of phys_to_virt(0x%lx) at 0x%p!\n",
183 paddr, __builtin_return_address(0));
184 }
185#endif
186 return -1;
187}
188EXPORT_SYMBOL(mm_ptov);
189#endif
190
191/* invalidate page in both caches */ 130/* invalidate page in both caches */
192static inline void clear040(unsigned long paddr) 131static inline void clear040(unsigned long paddr)
193{ 132{
@@ -354,15 +293,3 @@ void cache_push (unsigned long paddr, int len)
354} 293}
355EXPORT_SYMBOL(cache_push); 294EXPORT_SYMBOL(cache_push);
356 295
357#ifndef CONFIG_SINGLE_MEMORY_CHUNK
358int mm_end_of_chunk (unsigned long addr, int len)
359{
360 int i;
361
362 for (i = 0; i < m68k_num_memory; i++)
363 if (m68k_memory[i].addr + m68k_memory[i].size == addr + len)
364 return 1;
365 return 0;
366}
367EXPORT_SYMBOL(mm_end_of_chunk);
368#endif