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