patch-2.4.6 linux/include/asm-m68k/sun3_pgalloc.h

Next file: linux/include/asm-m68k/sun3_pgtable.h
Previous file: linux/include/asm-m68k/string.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.5/linux/include/asm-m68k/sun3_pgalloc.h linux/include/asm-m68k/sun3_pgalloc.h
@@ -74,46 +74,30 @@
         return (pmd_t *) pgd;
 }
 
+#define pmd_alloc_one_fast(mm, address) ({ BUG(); ((pmd_t *)1); })
+#define pmd_alloc_one(mm,address)       ({ BUG(); ((pmd_t *)2); })
+
 extern inline void pte_free(pte_t * pte)
 {
         free_page((unsigned long) pte);
 }
 
-extern inline pte_t * pte_alloc(pmd_t * pmd, unsigned long address)
-{
-	address = (address >> (PAGE_SHIFT-2)) & 4*(PTRS_PER_PTE - 1);
-
-repeat:
-	if (pmd_none(*pmd))
-		goto getnew;
-	if (pmd_bad(*pmd))
-		goto fix;
-	return (pte_t *) (__pmd_page(*pmd) + address);
-
-getnew:
+static inline pte_t *pte_alloc_one(struct mm_struct *mm, unsigned long address)
 {
 	unsigned long page = __get_free_page(GFP_KERNEL);
-	if (!pmd_none(*pmd))
-		goto freenew;
+
 	if (!page)
-		goto oom;
+		return NULL;
+		
 	memset((void *)page, 0, PAGE_SIZE);
 //	pmd_val(*pmd) = SUN3_PMD_MAGIC + __pa(page);
-	pmd_val(*pmd) = __pa(page);
-	return (pte_t *) (page + address);
-freenew:
-	free_page(page);
-	goto repeat;
+/*	pmd_val(*pmd) = __pa(page); */
+	return (pte_t *) (page);
 }
 
-fix:
-	printk(bad_pmd_string, pmd_val(*pmd));
-	printk("in normal pgd offset %08x\n", (unsigned int)pmd);
-oom:
-//	pmd_val(*pmd) = SUN3_PMD_MAGIC + __pa(BAD_PAGETABLE);
-	pmd_val(*pmd) = __pa(BAD_PAGETABLE);
-	return NULL;
-}
+#define pte_alloc_one_fast(mm,addr) pte_alloc_one(mm,addr)
+
+#define pmd_populate(mm, pmd, pte) (pmd_val(*pmd) = __pa((unsigned long)pte))
 
 /*
  * allocating and freeing a pmd is trivial: the 1-entry pmd is
@@ -124,11 +108,6 @@
         pmd_val(*pmd) = 0;
 }
 
-extern inline pmd_t * pmd_alloc(pgd_t * pgd, unsigned long address)
-{
-        return (pmd_t *) pgd;
-}
-
 extern inline void pgd_free(pgd_t * pgd)
 {
         free_page((unsigned long) pgd);
@@ -143,6 +122,8 @@
      memset(new_pgd, 0, (PAGE_OFFSET >> PGDIR_SHIFT));
      return new_pgd;
 }
+
+#define pgd_populate(mm, pmd, pte) BUG()
 
 /* FIXME: the sun3 doesn't have a page table cache! 
    (but the motorola routine should just return 0) */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)