pmap.h (1310) | pmap.h (1549) |
---|---|
1/* 2 * Copyright (c) 1991 Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * the Systems Programming Group of the University of Utah Computer 7 * Science Department and William Jolitz of UUNET Technologies Inc. 8 * --- 34 unchanged lines hidden (view full) --- 43 * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 44 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 45 * $Id: pmap.h,v 1.12 1994/03/24 23:12:48 davidg Exp $ 46 */ 47 48#ifndef _PMAP_MACHINE_ 49#define _PMAP_MACHINE_ 1 50 | 1/* 2 * Copyright (c) 1991 Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * the Systems Programming Group of the University of Utah Computer 7 * Science Department and William Jolitz of UUNET Technologies Inc. 8 * --- 34 unchanged lines hidden (view full) --- 43 * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 44 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 45 * $Id: pmap.h,v 1.12 1994/03/24 23:12:48 davidg Exp $ 46 */ 47 48#ifndef _PMAP_MACHINE_ 49#define _PMAP_MACHINE_ 1 50 |
51#include "vm/vm_prot.h" 52/* 53 * 386 page table entry and page table directory 54 * W.Jolitz, 8/89 55 */ 56struct pde 57{ 58unsigned int 59 pd_v:1, /* valid bit */ 60 pd_prot:2, /* access control */ 61 pd_mbz1:2, /* reserved, must be zero */ 62 pd_u:1, /* hardware maintained 'used' bit */ 63 :1, /* not used */ 64 pd_mbz2:2, /* reserved, must be zero */ 65 :3, /* reserved for software */ 66 pd_pfnum:20; /* physical page frame number of pte's*/ 67}; | 51#include <machine/pte.h> |
68 | 52 |
69#define PD_MASK 0xffc00000UL /* page directory address bits */ 70#define PT_MASK 0x003ff000UL /* page table address bits */ 71#define PD_SHIFT 22 /* page directory address shift */ 72#define PG_SHIFT 12 /* page table address shift */ 73 74struct pte 75{ 76unsigned int 77 pg_v:1, /* valid bit */ 78 pg_prot:2, /* access control */ 79 pg_mbz1:2, /* reserved, must be zero */ 80 pg_u:1, /* hardware maintained 'used' bit */ 81 pg_m:1, /* hardware maintained modified bit */ 82 pg_mbz2:2, /* reserved, must be zero */ 83 pg_w:1, /* software, wired down page */ 84 :1, /* software (unused) */ 85 pg_nc:1, /* 'uncacheable page' bit */ 86 pg_pfnum:20; /* physical page frame number */ 87}; 88 89#define PG_V 0x00000001 90#define PG_RO 0x00000000 91#define PG_RW 0x00000002 92#define PG_u 0x00000004 93#define PG_PROT 0x00000006 /* all protection bits . */ 94#define PG_W 0x00000200 95#define PG_N 0x00000800 /* Non-cacheable */ 96#define PG_M 0x00000040 97#define PG_U 0x00000020 98#define PG_FRAME 0xfffff000UL 99 100#define PG_NOACC 0 101#define PG_KR 0x00000000 102#define PG_KW 0x00000002 103#define PG_URKR 0x00000004 104#define PG_URKW 0x00000004 105#define PG_UW 0x00000006 106 107/* Garbage for current bastardized pager that assumes a hp300 */ 108#define PG_NV 0 109#define PG_CI 0 110 111/* 112 * Page Protection Exception bits 113 */ 114#define PGEX_P 0x01 /* Protection violation vs. not present */ 115#define PGEX_W 0x02 /* during a Write cycle */ 116#define PGEX_U 0x04 /* access from User mode (UPL) */ 117 118/* typedef struct pde pd_entry_t; */ /* page directory entry */ 119/* typedef struct pte pt_entry_t; */ /* Mach page table entry */ | |
120typedef unsigned int *pd_entry_t; 121typedef unsigned int *pt_entry_t; 122 123/* 124 * NKPDE controls the virtual space of the kernel, what ever is left, minus 125 * the alternate page table area is given to the user (NUPDE) 126 */ 127/* 128 * NKPDE controls the virtual space of the kernel, what ever is left is 129 * given to the user (NUPDE) 130 */ 131#ifndef NKPT | 53typedef unsigned int *pd_entry_t; 54typedef unsigned int *pt_entry_t; 55 56/* 57 * NKPDE controls the virtual space of the kernel, what ever is left, minus 58 * the alternate page table area is given to the user (NUPDE) 59 */ 60/* 61 * NKPDE controls the virtual space of the kernel, what ever is left is 62 * given to the user (NUPDE) 63 */ 64#ifndef NKPT |
132#define NKPT 15 /* actual number of kernel pte's */ | 65#define NKPT 24 /* actual number of kernel pte's */ |
133#endif 134#ifndef NKPDE 135#define NKPDE 63 /* addressable number of kpte's */ 136#endif 137 138#define NUPDE (NPTEPG-NKPDE) /* number of user pde's */ 139 140/* --- 13 unchanged lines hidden (view full) --- 154 155/* 156 * Address of current and alternate address space page table maps 157 * and directories. 158 */ 159#ifdef KERNEL 160extern pt_entry_t PTmap[], APTmap[], Upte; 161extern pd_entry_t PTD[], APTD[], PTDpde, APTDpde, Upde; | 66#endif 67#ifndef NKPDE 68#define NKPDE 63 /* addressable number of kpte's */ 69#endif 70 71#define NUPDE (NPTEPG-NKPDE) /* number of user pde's */ 72 73/* --- 13 unchanged lines hidden (view full) --- 87 88/* 89 * Address of current and alternate address space page table maps 90 * and directories. 91 */ 92#ifdef KERNEL 93extern pt_entry_t PTmap[], APTmap[], Upte; 94extern pd_entry_t PTD[], APTD[], PTDpde, APTDpde, Upde; |
162extern pt_entry_t *Sysmap; | |
163 164extern int IdlePTD; /* physical address of "Idle" state directory */ 165#endif 166 167/* 168 * virtual address to page table entry and 169 * to physical address. Likewise for alternate address space. 170 * Note: these work recursively, thus vtopte of a pte will give --- 115 unchanged lines hidden --- | 95 96extern int IdlePTD; /* physical address of "Idle" state directory */ 97#endif 98 99/* 100 * virtual address to page table entry and 101 * to physical address. Likewise for alternate address space. 102 * Note: these work recursively, thus vtopte of a pte will give --- 115 unchanged lines hidden --- |