diff options
-rw-r--r-- | sys/amd64/include/pmap.h | 27 | ||||
-rw-r--r-- | sys/amd64/include/vmparam.h | 10 | ||||
-rw-r--r-- | sys/i386/include/param.h | 15 | ||||
-rw-r--r-- | sys/i386/include/pmap.h | 27 | ||||
-rw-r--r-- | sys/i386/include/vmparam.h | 10 |
5 files changed, 36 insertions, 53 deletions
diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 3e73824..3fe1248 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -34,17 +34,15 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)pmap.h 7.4 (Berkeley) 5/12/91 - */ - -/* * Derived from hp300 version by Mike Hibler, this version by William * Jolitz uses a recursive map [a pde points to the page directory] to * map the page tables using the pagetables themselves. This is done to * reduce the impact on kernel virtual memory for lots of sparse address * space, and to reduce the cost of memory to each process. * - * from hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 + * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 + * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 + * $Id$ */ #ifndef _PMAP_MACHINE_ @@ -54,7 +52,6 @@ * 386 page table entry and page table directory * W.Jolitz, 8/89 */ - struct pde { unsigned int @@ -109,10 +106,10 @@ unsigned int /* Garbage for current bastardized pager that assumes a hp300 */ #define PG_NV 0 #define PG_CI 0 + /* * Page Protection Exception bits */ - #define PGEX_P 0x01 /* Protection violation vs. not present */ #define PGEX_W 0x02 /* during a Write cycle */ #define PGEX_U 0x04 /* access from User mode (UPL) */ @@ -123,10 +120,8 @@ typedef struct pte pt_entry_t; /* Mach page table entry */ /* * NKPDE controls the virtual space of the kernel, what ever is left is * given to the user (NUPDE) - * - * XXX NKPDE should be 8, but until locore.s is fixed it needs to be 3 */ -#define NKPDE 3 /* number of kernel pde's */ +#define NKPDE 7 /* number of kernel pde's */ #define NUPDE (NPTEPG-NKPDE) /* number of user pde's */ /* * The *PTDI values control the layout of virtual memory @@ -134,10 +129,8 @@ typedef struct pte pt_entry_t; /* Mach page table entry */ * XXX This works for now, but I am not real happy with it, I'll fix it * right after I fix locore.s and the magic 28K hole */ -#define LASTPTDI (NPTEPG-1) /* reserved for the future (unused) */ -#define APTDPTDI (LASTPTDI-1) /* alt ptd entry that points to APTD */ -#define RSVDPTDI (APTDPTDI-3) /* reserved for the near future */ -#define KPTDI (RSVDPTDI-NKPDE)/* start of kernel virtual pde's */ +#define APTDPTDI (NPTEPG-1) /* alt ptd entry that points to APTD */ +#define KPTDI (APTDPTDI-NKPDE)/* start of kernel virtual pde's */ #define PTDPTDI (KPTDI-1) /* ptd entry that points to ptd! */ #define UPTDI (PTDPTDI-1) /* ptd entry for u./kernel&user stack */ @@ -148,7 +141,7 @@ typedef struct pte pt_entry_t; /* Mach page table entry */ #ifdef KERNEL extern struct pte PTmap[], APTmap[], Upte; extern struct pde PTD[], APTD[], PTDpde, APTDpde, Upde; -extern pt_entry_t *Sysmap; +extern pt_entry_t *Sysmap; extern int IdlePTD; /* physical address of "Idle" state directory */ #endif @@ -162,12 +155,12 @@ extern int IdlePTD; /* physical address of "Idle" state directory */ #define vtopte(va) (PTmap + i386_btop(va)) #define kvtopte(va) vtopte(va) #define ptetov(pt) (i386_ptob(pt - PTmap)) -#define vtophys(va) (i386_ptob(vtopte(va)->pg_pfnum) | ((int)(va) & PGOFSET)) +#define vtophys(va) (i386_ptob(vtopte(va)->pg_pfnum) | ((int)(va) & PGOFSET)) #define ispt(va) ((va) >= UPT_MIN_ADDRESS && (va) <= KPT_MAX_ADDRESS) #define avtopte(va) (APTmap + i386_btop(va)) #define ptetoav(pt) (i386_ptob(pt - APTmap)) -#define avtophys(va) (i386_ptob(avtopte(va)->pg_pfnum) | ((int)(va) & PGOFSET)) +#define avtophys(va) (i386_ptob(avtopte(va)->pg_pfnum) | ((int)(va) & PGOFSET)) /* * macros to generate page directory/table indicies diff --git a/sys/amd64/include/vmparam.h b/sys/amd64/include/vmparam.h index 2285680..700b697 100644 --- a/sys/amd64/include/vmparam.h +++ b/sys/amd64/include/vmparam.h @@ -33,7 +33,8 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)vmparam.h 5.9 (Berkeley) 5/12/91 + * from: @(#)vmparam.h 5.9 (Berkeley) 5/12/91 + * $Id$ */ @@ -94,7 +95,7 @@ * Size of the Shared Memory Pages page table. */ #ifndef SHMMAXPGS -#define SHMMAXPGS 64 /* XXX until we have more kmap space */ +#define SHMMAXPGS 512 /* XXX until we have more kmap space */ #endif /* @@ -219,12 +220,9 @@ /* virtual sizes (bytes) for various kernel submaps */ #define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES) -#define VM_KMEM_SIZE (NKMEMCLUSTERS*CLBYTES) +#define VM_KMEM_SIZE (16 * 1024 * 1024) #define VM_PHYS_SIZE (USRIOSIZE*CLBYTES) -/* # of kernel PT pages (initial only, can grow dynamically) */ -#define VM_KERNEL_PT_PAGES ((vm_size_t)2) /* XXX: SYSPTSIZE */ - /* pcb base */ #define pcbb(p) ((u_int)(p)->p_addr) diff --git a/sys/i386/include/param.h b/sys/i386/include/param.h index 65ccd9d..546a8f31 100644 --- a/sys/i386/include/param.h +++ b/sys/i386/include/param.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)param.h 5.8 (Berkeley) 6/28/91 - * $Id: param.h,v 1.5 1993/10/12 07:13:12 rgrimes Exp $ + * $Id: param.h,v 1.6 1993/10/12 12:08:16 rgrimes Exp $ */ /* @@ -52,15 +52,22 @@ #define ALIGNBYTES (sizeof(int) - 1) #define ALIGN(p) (((u_int)(p) + ALIGNBYTES) &~ ALIGNBYTES) +/* XXX PGSHIFT and PG_SHIFT are two names for the same thing */ #define PGSHIFT 12 /* LOG2(NBPG) */ #define NBPG (1 << PGSHIFT) /* bytes/page */ #define PGOFSET (NBPG-1) /* byte offset into page */ #define NPTEPG (NBPG/(sizeof (struct pte))) +/* XXX PDRSHIFT and PD_SHIFT are two names for the same thing */ #define PDRSHIFT 22 /* LOG2(NBPDR) */ #define NBPDR (1 << PDRSHIFT) /* bytes/page dir */ #define PDROFSET (NBPDR-1) /* byte offset into page dir */ +/* + * XXX This should really be KPTDPTDI << PDRSHIFT, but since KPTDPTDI is + * defined in pmap.h which is included after this we can't do that + * (YET!) + */ #define KERNBASE 0xFE000000 /* start of kernel virtual */ #define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT) @@ -107,12 +114,6 @@ #endif /* NMBCLUSTERS */ /* - * Size of kernel malloc arena in CLBYTES-sized logical pages - */ -#ifndef NKMEMCLUSTERS -#define NKMEMCLUSTERS (3072*1024/CLBYTES) -#endif -/* * Some macros for units conversion */ /* Core clicks (4096 bytes) to segments and vice versa */ diff --git a/sys/i386/include/pmap.h b/sys/i386/include/pmap.h index 3e73824..3fe1248 100644 --- a/sys/i386/include/pmap.h +++ b/sys/i386/include/pmap.h @@ -34,17 +34,15 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)pmap.h 7.4 (Berkeley) 5/12/91 - */ - -/* * Derived from hp300 version by Mike Hibler, this version by William * Jolitz uses a recursive map [a pde points to the page directory] to * map the page tables using the pagetables themselves. This is done to * reduce the impact on kernel virtual memory for lots of sparse address * space, and to reduce the cost of memory to each process. * - * from hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 + * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 + * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 + * $Id$ */ #ifndef _PMAP_MACHINE_ @@ -54,7 +52,6 @@ * 386 page table entry and page table directory * W.Jolitz, 8/89 */ - struct pde { unsigned int @@ -109,10 +106,10 @@ unsigned int /* Garbage for current bastardized pager that assumes a hp300 */ #define PG_NV 0 #define PG_CI 0 + /* * Page Protection Exception bits */ - #define PGEX_P 0x01 /* Protection violation vs. not present */ #define PGEX_W 0x02 /* during a Write cycle */ #define PGEX_U 0x04 /* access from User mode (UPL) */ @@ -123,10 +120,8 @@ typedef struct pte pt_entry_t; /* Mach page table entry */ /* * NKPDE controls the virtual space of the kernel, what ever is left is * given to the user (NUPDE) - * - * XXX NKPDE should be 8, but until locore.s is fixed it needs to be 3 */ -#define NKPDE 3 /* number of kernel pde's */ +#define NKPDE 7 /* number of kernel pde's */ #define NUPDE (NPTEPG-NKPDE) /* number of user pde's */ /* * The *PTDI values control the layout of virtual memory @@ -134,10 +129,8 @@ typedef struct pte pt_entry_t; /* Mach page table entry */ * XXX This works for now, but I am not real happy with it, I'll fix it * right after I fix locore.s and the magic 28K hole */ -#define LASTPTDI (NPTEPG-1) /* reserved for the future (unused) */ -#define APTDPTDI (LASTPTDI-1) /* alt ptd entry that points to APTD */ -#define RSVDPTDI (APTDPTDI-3) /* reserved for the near future */ -#define KPTDI (RSVDPTDI-NKPDE)/* start of kernel virtual pde's */ +#define APTDPTDI (NPTEPG-1) /* alt ptd entry that points to APTD */ +#define KPTDI (APTDPTDI-NKPDE)/* start of kernel virtual pde's */ #define PTDPTDI (KPTDI-1) /* ptd entry that points to ptd! */ #define UPTDI (PTDPTDI-1) /* ptd entry for u./kernel&user stack */ @@ -148,7 +141,7 @@ typedef struct pte pt_entry_t; /* Mach page table entry */ #ifdef KERNEL extern struct pte PTmap[], APTmap[], Upte; extern struct pde PTD[], APTD[], PTDpde, APTDpde, Upde; -extern pt_entry_t *Sysmap; +extern pt_entry_t *Sysmap; extern int IdlePTD; /* physical address of "Idle" state directory */ #endif @@ -162,12 +155,12 @@ extern int IdlePTD; /* physical address of "Idle" state directory */ #define vtopte(va) (PTmap + i386_btop(va)) #define kvtopte(va) vtopte(va) #define ptetov(pt) (i386_ptob(pt - PTmap)) -#define vtophys(va) (i386_ptob(vtopte(va)->pg_pfnum) | ((int)(va) & PGOFSET)) +#define vtophys(va) (i386_ptob(vtopte(va)->pg_pfnum) | ((int)(va) & PGOFSET)) #define ispt(va) ((va) >= UPT_MIN_ADDRESS && (va) <= KPT_MAX_ADDRESS) #define avtopte(va) (APTmap + i386_btop(va)) #define ptetoav(pt) (i386_ptob(pt - APTmap)) -#define avtophys(va) (i386_ptob(avtopte(va)->pg_pfnum) | ((int)(va) & PGOFSET)) +#define avtophys(va) (i386_ptob(avtopte(va)->pg_pfnum) | ((int)(va) & PGOFSET)) /* * macros to generate page directory/table indicies diff --git a/sys/i386/include/vmparam.h b/sys/i386/include/vmparam.h index 2285680..700b697 100644 --- a/sys/i386/include/vmparam.h +++ b/sys/i386/include/vmparam.h @@ -33,7 +33,8 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)vmparam.h 5.9 (Berkeley) 5/12/91 + * from: @(#)vmparam.h 5.9 (Berkeley) 5/12/91 + * $Id$ */ @@ -94,7 +95,7 @@ * Size of the Shared Memory Pages page table. */ #ifndef SHMMAXPGS -#define SHMMAXPGS 64 /* XXX until we have more kmap space */ +#define SHMMAXPGS 512 /* XXX until we have more kmap space */ #endif /* @@ -219,12 +220,9 @@ /* virtual sizes (bytes) for various kernel submaps */ #define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES) -#define VM_KMEM_SIZE (NKMEMCLUSTERS*CLBYTES) +#define VM_KMEM_SIZE (16 * 1024 * 1024) #define VM_PHYS_SIZE (USRIOSIZE*CLBYTES) -/* # of kernel PT pages (initial only, can grow dynamically) */ -#define VM_KERNEL_PT_PAGES ((vm_size_t)2) /* XXX: SYSPTSIZE */ - /* pcb base */ #define pcbb(p) ((u_int)(p)->p_addr) |