patch-2.2.4 linux/include/asm-sparc64/pgtable.h

Next file: linux/include/asm-sparc64/posix_types.h
Previous file: linux/include/asm-sparc64/pbm.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.3/linux/include/asm-sparc64/pgtable.h linux/include/asm-sparc64/pgtable.h
@@ -1,4 +1,4 @@
-/* $Id: pgtable.h,v 1.96 1998/10/27 23:28:42 davem Exp $
+/* $Id: pgtable.h,v 1.102 1999/01/22 16:19:29 jj Exp $
  * pgtable.h: SpitFire page table operations.
  *
  * Copyright 1996,1997 David S. Miller (davem@caip.rutgers.edu)
@@ -14,6 +14,7 @@
 
 #ifndef __ASSEMBLY__
 #include <linux/mm.h>
+#include <linux/pagemap.h>
 #endif
 #include <asm/spitfire.h>
 #include <asm/asi.h>
@@ -106,8 +107,9 @@
 
 #define PAGE_NONE	__pgprot (_PAGE_PRESENT | _PAGE_ACCESSED)
 
+/* Don't set the TTE _PAGE_W bit here, else the dirty bit never gets set. */
 #define PAGE_SHARED	__pgprot (_PAGE_PRESENT | _PAGE_VALID | _PAGE_CACHE | \
-				  __ACCESS_BITS | _PAGE_W | _PAGE_WRITE)
+				  __ACCESS_BITS | _PAGE_WRITE)
 
 #define PAGE_COPY	__pgprot (_PAGE_PRESENT | _PAGE_VALID | _PAGE_CACHE | \
 				  __ACCESS_BITS)
@@ -250,11 +252,13 @@
 #define mk_pte_phys(physpage, pgprot)	(__pte((physpage) | pgprot_val(pgprot)))
 #define pte_modify(_pte, newprot) \
 	(pte_val(_pte) = ((pte_val(_pte) & _PAGE_CHG_MASK) | pgprot_val(newprot)))
-#define pmd_set(pmdp, ptep)		(pmd_val(*(pmdp)) = __pa((unsigned long) (ptep)))
-#define pgd_set(pgdp, pmdp)		(pgd_val(*(pgdp)) = __pa((unsigned long) (pmdp)))
+#define pmd_set(pmdp, ptep)	\
+	(pmd_val(*(pmdp)) = (__pa((unsigned long) (ptep)) >> 11UL))
+#define pgd_set(pgdp, pmdp)	\
+	(pgd_val(*(pgdp)) = (__pa((unsigned long) (pmdp)) >> 11UL))
 #define pte_page(pte)   ((unsigned long) __va(((pte_val(pte)&~PAGE_OFFSET)&~(0xfffUL))))
-#define pmd_page(pmd)			((unsigned long) __va(pmd_val(pmd)))
-#define pgd_page(pgd)			((unsigned long) __va(pgd_val(pgd)))
+#define pmd_page(pmd)			((unsigned long) __va((pmd_val(pmd)<<11UL)))
+#define pgd_page(pgd)			((unsigned long) __va((pgd_val(pgd)<<11UL)))
 #define pte_none(pte) 			(!pte_val(pte))
 #define pte_present(pte)		(pte_val(pte) & _PAGE_PRESENT)
 #define pte_clear(pte)			(pte_val(*(pte)) = 0UL)
@@ -371,7 +375,7 @@
 		(unsigned long)ret->pprev_hash = mask;
 		if (!mask)
 			pgd_quicklist = (unsigned long *)ret->next_hash;
-                ret = (struct page *) (page_address(ret) + off);
+                ret = (struct page *)(page_address(ret) + off);
                 pgd_cache_size--;
         } else {
 		ret = (struct page *) __get_free_page(GFP_KERNEL);
@@ -519,7 +523,7 @@
 
 extern inline void SET_PAGE_DIR(struct task_struct *tsk, pgd_t *pgdir)
 {
-	if(pgdir != swapper_pg_dir && tsk->mm == current->mm) {
+	if(pgdir != swapper_pg_dir && tsk == current) {
 		register unsigned long paddr asm("o5");
 
 		paddr = __pa(pgdir);
@@ -642,9 +646,11 @@
 
 extern void * module_map (unsigned long size);
 extern void module_unmap (void *addr);
+extern unsigned long *sparc64_valid_addr_bitmap;
 
 /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
 #define PageSkip(page)		(test_bit(PG_skip, &(page)->flags))
+#define kern_addr_valid(addr)	(test_bit(__pa((unsigned long)(addr))>>22, sparc64_valid_addr_bitmap))
 
 extern int io_remap_page_range(unsigned long from, unsigned long offset,
 			       unsigned long size, pgprot_t prot, int space);

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