pmap.h (719) | pmap.h (757) |
---|---|
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 * --- 28 unchanged lines hidden (view full) --- 37 * Derived from hp300 version by Mike Hibler, this version by William 38 * Jolitz uses a recursive map [a pde points to the page directory] to 39 * map the page tables using the pagetables themselves. This is done to 40 * reduce the impact on kernel virtual memory for lots of sparse address 41 * space, and to reduce the cost of memory to each process. 42 * 43 * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 44 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 | 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 * --- 28 unchanged lines hidden (view full) --- 37 * Derived from hp300 version by Mike Hibler, this version by William 38 * Jolitz uses a recursive map [a pde points to the page directory] to 39 * map the page tables using the pagetables themselves. This is done to 40 * reduce the impact on kernel virtual memory for lots of sparse address 41 * space, and to reduce the cost of memory to each process. 42 * 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.4 1993/10/15 10:07:44 rgrimes Exp $ | 45 * $Id: pmap.h,v 1.5 1993/11/07 17:43:02 wollman Exp $ |
46 */ 47 48#ifndef _PMAP_MACHINE_ 49#define _PMAP_MACHINE_ 1 50 51/* 52 * 386 page table entry and page table directory 53 * W.Jolitz, 8/89 --- 59 unchanged lines hidden (view full) --- 113#define PGEX_P 0x01 /* Protection violation vs. not present */ 114#define PGEX_W 0x02 /* during a Write cycle */ 115#define PGEX_U 0x04 /* access from User mode (UPL) */ 116 117typedef struct pde pd_entry_t; /* page directory entry */ 118typedef struct pte pt_entry_t; /* Mach page table entry */ 119 120/* | 46 */ 47 48#ifndef _PMAP_MACHINE_ 49#define _PMAP_MACHINE_ 1 50 51/* 52 * 386 page table entry and page table directory 53 * W.Jolitz, 8/89 --- 59 unchanged lines hidden (view full) --- 113#define PGEX_P 0x01 /* Protection violation vs. not present */ 114#define PGEX_W 0x02 /* during a Write cycle */ 115#define PGEX_U 0x04 /* access from User mode (UPL) */ 116 117typedef struct pde pd_entry_t; /* page directory entry */ 118typedef struct pte pt_entry_t; /* Mach page table entry */ 119 120/* |
121 * NKPDE controls the virtual space of the kernel, what ever is left is 122 * given to the user (NUPDE) | 121 * NKPDE controls the virtual space of the kernel, what ever is left, minus 122 * the alternate page table area is given to the user (NUPDE) |
123 */ 124#define NKPDE 7 /* number of kernel pde's */ | 123 */ 124#define NKPDE 7 /* number of kernel pde's */ |
125#define NUPDE (NPTEPG-NKPDE) /* number of user pde's */ | 125#define NUPDE (NPTEPG-NKPDE-1)/* number of user pde's */ |
126/* 127 * The *PTDI values control the layout of virtual memory 128 * 129 * XXX This works for now, but I am not real happy with it, I'll fix it 130 * right after I fix locore.s and the magic 28K hole 131 */ 132#define APTDPTDI (NPTEPG-1) /* alt ptd entry that points to APTD */ 133#define KPTDI (APTDPTDI-NKPDE)/* start of kernel virtual pde's */ 134#define PTDPTDI (KPTDI-1) /* ptd entry that points to ptd! */ | 126/* 127 * The *PTDI values control the layout of virtual memory 128 * 129 * XXX This works for now, but I am not real happy with it, I'll fix it 130 * right after I fix locore.s and the magic 28K hole 131 */ 132#define APTDPTDI (NPTEPG-1) /* alt ptd entry that points to APTD */ 133#define KPTDI (APTDPTDI-NKPDE)/* start of kernel virtual pde's */ 134#define PTDPTDI (KPTDI-1) /* ptd entry that points to ptd! */ |
135#define UPTDI (PTDPTDI-1) /* ptd entry for u./kernel&user stack */ | 135#define KSTKPTDI (PTDPTDI-1) /* ptd entry for u./kernel&user stack */ 136#define KSTKPTEOFF (NBPG/sizeof(struct pde)-UPAGES) /* pte entry for kernel stack */ |
136 | 137 |
138#define PDESIZE sizeof(struct pde) /* for assembly files */ 139#define PTESIZE sizeof(struct pte) /* for assembly files */ 140 |
|
137/* 138 * Address of current and alternate address space page table maps 139 * and directories. 140 */ 141#ifdef KERNEL 142extern struct pte PTmap[], APTmap[], Upte; 143extern struct pde PTD[], APTD[], PTDpde, APTDpde, Upde; 144extern pt_entry_t *Sysmap; --- 89 unchanged lines hidden --- | 141/* 142 * Address of current and alternate address space page table maps 143 * and directories. 144 */ 145#ifdef KERNEL 146extern struct pte PTmap[], APTmap[], Upte; 147extern struct pde PTD[], APTD[], PTDpde, APTDpde, Upde; 148extern pt_entry_t *Sysmap; --- 89 unchanged lines hidden --- |