1 1.14 thorpej /* $NetBSD: pte.h,v 1.14 1998/03/07 01:44:08 thorpej Exp $ */ 2 1.1 cgd 3 1.1 cgd /* 4 1.8 cgd * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. 5 1.1 cgd * All rights reserved. 6 1.1 cgd * 7 1.1 cgd * Author: Chris G. Demetriou 8 1.1 cgd * 9 1.1 cgd * Permission to use, copy, modify and distribute this software and 10 1.1 cgd * its documentation is hereby granted, provided that both the copyright 11 1.1 cgd * notice and this permission notice appear in all copies of the 12 1.1 cgd * software, derivative works or modified versions, and any portions 13 1.1 cgd * thereof, and that both notices appear in supporting documentation. 14 1.1 cgd * 15 1.1 cgd * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 16 1.1 cgd * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 17 1.1 cgd * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 18 1.1 cgd * 19 1.1 cgd * Carnegie Mellon requests users of this software to return to 20 1.1 cgd * 21 1.1 cgd * Software Distribution Coordinator or Software.Distribution (at) CS.CMU.EDU 22 1.1 cgd * School of Computer Science 23 1.1 cgd * Carnegie Mellon University 24 1.1 cgd * Pittsburgh PA 15213-3890 25 1.1 cgd * 26 1.1 cgd * any improvements or extensions that they make and grant Carnegie the 27 1.1 cgd * rights to redistribute these changes. 28 1.1 cgd */ 29 1.1 cgd 30 1.14 thorpej #ifndef _ALPHA_PTE_H_ 31 1.14 thorpej #define _ALPHA_PTE_H_ 32 1.14 thorpej 33 1.1 cgd /* 34 1.1 cgd * Alpha page table entry. 35 1.1 cgd * Things which are in the VMS PALcode but not in the OSF PALcode 36 1.1 cgd * are marked with "(VMS)". 37 1.1 cgd * 38 1.1 cgd * This information derived from pp. (II) 3-3 - (II) 3-6 and 39 1.1 cgd * (III) 3-3 - (III) 3-5 of the "Alpha Architecture Reference Manual" by 40 1.1 cgd * Richard L. Sites. 41 1.1 cgd */ 42 1.1 cgd 43 1.1 cgd /* 44 1.1 cgd * Alpha Page Table Entry 45 1.1 cgd */ 46 1.5 cgd 47 1.5 cgd #include <machine/alpha_cpu.h> 48 1.5 cgd 49 1.5 cgd typedef alpha_pt_entry_t pt_entry_t; 50 1.5 cgd 51 1.1 cgd #define PT_ENTRY_NULL ((pt_entry_t *) 0) 52 1.1 cgd #define PTESHIFT 3 /* pte size == 1 << PTESHIFT */ 53 1.1 cgd 54 1.5 cgd #define PG_V ALPHA_PTE_VALID 55 1.5 cgd #define PG_NV 0 56 1.5 cgd #define PG_FOR ALPHA_PTE_FAULT_ON_READ 57 1.5 cgd #define PG_FOW ALPHA_PTE_FAULT_ON_WRITE 58 1.5 cgd #define PG_FOE ALPHA_PTE_FAULT_ON_EXECUTE 59 1.5 cgd #define PG_ASM ALPHA_PTE_ASM 60 1.5 cgd #define PG_GH ALPHA_PTE_GRANULARITY 61 1.5 cgd #define PG_KRE ALPHA_PTE_KR 62 1.5 cgd #define PG_URE ALPHA_PTE_UR 63 1.5 cgd #define PG_KWE ALPHA_PTE_KW 64 1.5 cgd #define PG_UWE ALPHA_PTE_UW 65 1.5 cgd #define PG_PROT ALPHA_PTE_PROT 66 1.1 cgd #define PG_RSVD 0x000000000000cc80 /* Reserved fpr hardware */ 67 1.1 cgd #define PG_WIRED 0x0000000000010000 /* Wired. [SOFTWARE] */ 68 1.5 cgd #define PG_FRAME ALPHA_PTE_RAME 69 1.1 cgd #define PG_SHIFT 32 70 1.5 cgd #define PG_PFNUM(x) ALPHA_PTE_TO_PFN(x) 71 1.1 cgd 72 1.4 mycroft #ifndef _LOCORE 73 1.1 cgd #define PTEMASK (NPTEPG - 1) 74 1.11 thorpej #define l3pte_index(va) (((va) >> PGSHIFT) & PTEMASK) 75 1.11 thorpej #define l2pte_index(va) (((va) >> SEGSHIFT) & PTEMASK) 76 1.11 thorpej #define l1pte_index(va) \ 77 1.7 cgd (((vm_offset_t)(va) >> (PGSHIFT + 2*(PGSHIFT-PTESHIFT))) & PTEMASK) 78 1.1 cgd 79 1.3 cgd #define ALPHA_STSIZE ((u_long)NBPG) /* 8k */ 80 1.3 cgd #define ALPHA_MAX_PTSIZE ((u_long)(NPTEPG * NBPG)) /* 8M */ 81 1.1 cgd 82 1.3 cgd #ifdef _KERNEL 83 1.1 cgd extern pt_entry_t *Lev1map; /* Alpha Level One page table */ 84 1.14 thorpej #endif /* _KERNEL */ 85 1.14 thorpej #endif /* ! _LOCORE */ 86 1.14 thorpej 87 1.14 thorpej #endif /* ! _ALPHA_PTE_H_ */ 88