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

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

diff -u --recursive --new-file v2.1.35/linux/include/asm-sparc64/pgtable.h linux/include/asm-sparc64/pgtable.h
@@ -1,4 +1,4 @@
-/* $Id: pgtable.h,v 1.27 1997/04/10 23:32:46 davem Exp $
+/* $Id: pgtable.h,v 1.28 1997/04/14 17:05:19 jj Exp $
  * pgtable.h: SpitFire page table operations.
  *
  * Copyright 1996 David S. Miller (davem@caip.rutgers.edu)
@@ -672,6 +672,31 @@
 #define SWP_TYPE(entry)		(((entry>>PAGE_SHIFT) & 0xff))
 #define SWP_OFFSET(entry)	((entry) >> (PAGE_SHIFT+8))
 #define SWP_ENTRY(type,offset)	pte_val(mk_swap_pte((type),(offset)))
+
+extern __inline__ unsigned long
+sun4u_get_pte (unsigned long addr)
+{
+	pgd_t *pgdp;
+	pmd_t *pmdp;
+	pte_t *ptep;
+	
+	pgdp = pgd_offset (current->mm, addr);
+	pmdp = pmd_offset (pgdp, addr);
+	ptep = pte_offset (pmdp, addr);
+	return pte_val (*ptep) & _PAGE_PADDR;
+}
+
+extern __inline__ unsigned int
+__get_phys (unsigned long addr)
+{
+	return (sun4u_get_pte (addr) & 0x0fffffff);
+}
+
+extern __inline__ int
+__get_iospace (unsigned long addr)
+{
+	return ((sun4u_get_pte (addr) & 0xf0000000) >> 28);
+}
 
 #endif /* !(__ASSEMBLY__) */
 

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