]> err.no Git - linux-2.6/blobdiff - arch/m68k/mm/memory.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
[linux-2.6] / arch / m68k / mm / memory.c
index 559942ce0e1e7bde2773ac90f5150dca5e542e5e..b7473525b43179fa9066d3a1d978120f1caac164 100644 (file)
@@ -4,7 +4,7 @@
  *  Copyright (C) 1995  Hamish Macdonald
  */
 
-#include <linux/config.h>
+#include <linux/module.h>
 #include <linux/mm.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
@@ -54,7 +54,7 @@ void __init init_pointer_table(unsigned long ptable)
 
        /* unreserve the page so it's possible to free that page */
        PD_PAGE(dp)->flags &= ~(1 << PG_reserved);
-       set_page_count(PD_PAGE(dp), 1);
+       init_page_count(PD_PAGE(dp));
 
        return;
 }
@@ -94,8 +94,7 @@ pmd_t *get_pointer_table (void)
        PD_MARKBITS(dp) = mask & ~tmp;
        if (!PD_MARKBITS(dp)) {
                /* move to end of list */
-               list_del(dp);
-               list_add_tail(dp, &ptable_list);
+               list_move_tail(dp, &ptable_list);
        }
        return (pmd_t *) (page_address(PD_PAGE(dp)) + off);
 }
@@ -123,73 +122,11 @@ int free_pointer_table (pmd_t *ptable)
                 * move this descriptor to the front of the list, since
                 * it has one or more free tables.
                 */
-               list_del(dp);
-               list_add(dp, &ptable_list);
+               list_move(dp, &ptable_list);
        }
        return 0;
 }
 
-#ifdef DEBUG_INVALID_PTOV
-int mm_inv_cnt = 5;
-#endif
-
-#ifndef CONFIG_SINGLE_MEMORY_CHUNK
-/*
- * The following two routines map from a physical address to a kernel
- * virtual address and vice versa.
- */
-unsigned long mm_vtop(unsigned long vaddr)
-{
-       int i=0;
-       unsigned long voff = (unsigned long)vaddr - PAGE_OFFSET;
-
-       do {
-               if (voff < m68k_memory[i].size) {
-#ifdef DEBUGPV
-                       printk ("VTOP(%p)=%lx\n", vaddr,
-                               m68k_memory[i].addr + voff);
-#endif
-                       return m68k_memory[i].addr + voff;
-               }
-               voff -= m68k_memory[i].size;
-       } while (++i < m68k_num_memory);
-
-       /* As a special case allow `__pa(high_memory)'.  */
-       if (voff == 0)
-               return m68k_memory[i-1].addr + m68k_memory[i-1].size;
-
-       return -1;
-}
-#endif
-
-#ifndef CONFIG_SINGLE_MEMORY_CHUNK
-unsigned long mm_ptov (unsigned long paddr)
-{
-       int i = 0;
-       unsigned long poff, voff = PAGE_OFFSET;
-
-       do {
-               poff = paddr - m68k_memory[i].addr;
-               if (poff < m68k_memory[i].size) {
-#ifdef DEBUGPV
-                       printk ("PTOV(%lx)=%lx\n", paddr, poff + voff);
-#endif
-                       return poff + voff;
-               }
-               voff += m68k_memory[i].size;
-       } while (++i < m68k_num_memory);
-
-#ifdef DEBUG_INVALID_PTOV
-       if (mm_inv_cnt > 0) {
-               mm_inv_cnt--;
-               printk("Invalid use of phys_to_virt(0x%lx) at 0x%p!\n",
-                       paddr, __builtin_return_address(0));
-       }
-#endif
-       return -1;
-}
-#endif
-
 /* invalidate page in both caches */
 static inline void clear040(unsigned long paddr)
 {
@@ -301,6 +238,7 @@ void cache_clear (unsigned long paddr, int len)
        mach_l2_flush(0);
 #endif
 }
+EXPORT_SYMBOL(cache_clear);
 
 
 /*
@@ -353,15 +291,5 @@ void cache_push (unsigned long paddr, int len)
        mach_l2_flush(1);
 #endif
 }
+EXPORT_SYMBOL(cache_push);
 
-#ifndef CONFIG_SINGLE_MEMORY_CHUNK
-int mm_end_of_chunk (unsigned long addr, int len)
-{
-       int i;
-
-       for (i = 0; i < m68k_num_memory; i++)
-               if (m68k_memory[i].addr + m68k_memory[i].size == addr + len)
-                       return 1;
-       return 0;
-}
-#endif