Home | History | Annotate | Line # | Download | only in include
pte.h revision 1.2
      1 /*	$NetBSD: pte.h,v 1.2 1997/06/15 17:24:22 mhitch Exp $	*/
      2 
      3 /*
      4  * Copyright 1996 The Board of Trustees of The Leland Stanford
      5  * Junior University. All Rights Reserved.
      6  *
      7  * Permission to use, copy, modify, and distribute this
      8  * software and its documentation for any purpose and without
      9  * fee is hereby granted, provided that the above copyright
     10  * notice appear in all copies.  Stanford University
     11  * makes no representations about the suitability of this
     12  * software for any purpose.  It is provided "as is" without
     13  * express or implied warranty.
     14  */
     15 
     16 #ifndef  __MIPS_PTE_H__
     17 #define  __MIPS_PTE_H__
     18 
     19 
     20 #if defined(MIPS1) && defined(MIPS3)
     21 #error  Cannot yet support both  "MIPS1" (r2000 family) and "MIPS3" (r4000 family) in the same kernel.
     22 #endif
     23 
     24 #ifndef MIPS3
     25 #include <mips/mips1_pte.h>
     26 #endif
     27 
     28 #ifdef MIPS3
     29 #include <mips/mips3_pte.h>
     30 #endif
     31 
     32 
     33 #if defined(_KERNEL) && !defined(_LOCORE)
     34 /*
     35  * Kernel virtual address to page table entry and visa versa.
     36  */
     37 #define	kvtopte(va) \
     38 	(Sysmap + (((vm_offset_t)(va) - VM_MIN_KERNEL_ADDRESS) >> PGSHIFT))
     39 #define	ptetokv(pte) \
     40 	((((pt_entry_t *)(pte) - Sysmap) << PGSHIFT) + VM_MIN_KERNEL_ADDRESS)
     41 
     42 extern	pt_entry_t *Sysmap;		/* kernel pte table */
     43 extern	u_int Sysmapsize;		/* number of pte's in Sysmap */
     44 #endif	/* defined(_KERNEL) && !defined(_LOCORE) */
     45 
     46 #endif /* __MIPS_PTE_H__ */
     47