patch-2.2.0-pre9 linux/include/asm-m68k/pgtable.h

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

diff -u --recursive --new-file v2.2.0-pre8/linux/include/asm-m68k/pgtable.h linux/include/asm-m68k/pgtable.h
@@ -13,14 +13,7 @@
  * the m68k page table tree.
  */
 
-/* For virtual address to physical address conversion */
-extern unsigned long mm_vtop(unsigned long addr) __attribute__ ((const));
-extern unsigned long mm_ptov(unsigned long addr) __attribute__ ((const));
-
-#include<asm/virtconvert.h>
-
-#define VTOP(addr)  (mm_vtop((unsigned long)(addr)))
-#define PTOV(addr)  (mm_ptov((unsigned long)(addr)))
+#include <asm/virtconvert.h>
 
 /*
  * Cache handling functions
@@ -436,34 +429,24 @@
 extern inline void pmd_set(pmd_t * pmdp, pte_t * ptep)
 {
 	int i;
-
-	ptep = (pte_t *) virt_to_phys(ptep);
-	for (i = 0; i < 16; i++, ptep += PTRS_PER_PTE/16)
-		pmdp->pmd[i] = _PAGE_TABLE | _PAGE_ACCESSED | (unsigned long)ptep;
-}
-
-/* early termination version of the above */
-extern inline void pmd_set_et(pmd_t * pmdp, pte_t * ptep)
-{
-	int i;
-
-	ptep = (pte_t *) virt_to_phys(ptep);
-	for (i = 0; i < 16; i++, ptep += PTRS_PER_PTE/16)
-		pmdp->pmd[i] = _PAGE_PRESENT | _PAGE_ACCESSED | (unsigned long)ptep;
+	unsigned long ptbl;
+	ptbl = virt_to_phys(ptep);
+	for (i = 0; i < 16; i++, ptbl += sizeof(pte_table)/16)
+		pmdp->pmd[i] = _PAGE_TABLE | _PAGE_ACCESSED | ptbl;
 }
 
 extern inline void pgd_set(pgd_t * pgdp, pmd_t * pmdp)
 { pgd_val(*pgdp) = _PAGE_TABLE | _PAGE_ACCESSED | virt_to_phys(pmdp); }
 
 extern inline unsigned long pte_page(pte_t pte)
-{ return (unsigned long)phys_to_virt((unsigned long)(pte_val(pte) & PAGE_MASK)); }
+{ return (unsigned long)phys_to_virt(pte_val(pte) & PAGE_MASK); }
 
 extern inline unsigned long pmd_page2(pmd_t *pmd)
-{ return (unsigned long)phys_to_virt((unsigned long)(pmd_val(*pmd) & _TABLE_MASK)); }
+{ return (unsigned long)phys_to_virt(pmd_val(*pmd) & _TABLE_MASK); }
 #define pmd_page(pmd) pmd_page2(&(pmd))
 
 extern inline unsigned long pgd_page(pgd_t pgd)
-{ return (unsigned long)phys_to_virt((unsigned long)(pgd_val(pgd) & _TABLE_MASK)); }
+{ return (unsigned long)phys_to_virt(pgd_val(pgd) & _TABLE_MASK); }
 
 extern inline int pte_none(pte_t pte)		{ return !pte_val(pte); }
 extern inline int pte_present(pte_t pte)	{ return pte_val(pte) & (_PAGE_PRESENT | _PAGE_FAKE_SUPER); }
@@ -547,7 +530,7 @@
 	return mm->pgd + (address >> PGDIR_SHIFT);
 }
 
-extern pgd_t swapper_pg_dir[128];
+#define swapper_pg_dir kernel_pg_dir
 extern pgd_t kernel_pg_dir[128];
 
 extern inline pgd_t * pgd_offset_k(unsigned long address)
@@ -625,8 +608,6 @@
 
 extern pmd_t *get_pointer_table(void);
 extern int free_pointer_table(pmd_t *);
-extern pmd_t *get_kpointer_table(void);
-extern void free_kpointer_table(pmd_t *);
 
 extern __inline__ pte_t *get_pte_fast(void)
 {
@@ -754,29 +735,12 @@
 
 extern inline void pmd_free_kernel(pmd_t * pmd)
 {
-	free_kpointer_table(pmd);
+	free_pmd_fast(pmd);
 }
 
 extern inline pmd_t * pmd_alloc_kernel(pgd_t * pgd, unsigned long address)
 {
-	address = (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1);
-	if (pgd_none(*pgd)) {
-		pmd_t *page = get_kpointer_table();
-		if (pgd_none(*pgd)) {
-			if (page) {
-				pgd_set(pgd, page);
-				return page + address;
-			}
-			pgd_set(pgd, (pmd_t *)BAD_PAGETABLE);
-			return NULL;
-		}
-		free_kpointer_table(page);
-	}
-	if (pgd_bad(*pgd)) {
-		__bad_pmd(pgd);
-		return NULL;
-	}
-	return (pmd_t *) pgd_page(*pgd) + address;
+	return pmd_alloc(pgd, address);
 }
 
 extern inline void pgd_free(pgd_t * pgd)
@@ -815,26 +779,7 @@
 int mm_end_of_chunk (unsigned long addr, int len);
 #endif
 
-/*
- * Map some physical address range into the kernel address space.
- */
-extern unsigned long kernel_map(unsigned long paddr, unsigned long size,
-				int nocacheflag, unsigned long *memavailp );
-/*
- * Unmap a region alloced by kernel_map().
- */
-extern void kernel_unmap( unsigned long addr );
-/*
- * Change the cache mode of some kernel address range.
- */
-extern void kernel_set_cachemode( unsigned long address, unsigned long size,
-				  unsigned cmode );
-
-/* Values for nocacheflag and cmode */
-#define	KERNELMAP_FULL_CACHING		0
-#define	KERNELMAP_NOCACHE_SER		1
-#define	KERNELMAP_NOCACHE_NONSER	2
-#define	KERNELMAP_NO_COPYBACK		3
+extern void kernel_set_cachemode(void *addr, unsigned long size, int cmode);
 
 /*
  * The m68k doesn't have any external MMU info: the kernel page

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov