diff options
author | phk <phk@FreeBSD.org> | 1996-04-30 12:02:12 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1996-04-30 12:02:12 +0000 |
commit | 9502945d5babe42ab98a0a861784f84c983635f2 (patch) | |
tree | 5285e538e31862d70153bd471ed6fb9542241c9c /sys/amd64 | |
parent | f7fbc2347dcece19b9a6f3c63246ad184e82a821 (diff) | |
download | FreeBSD-src-9502945d5babe42ab98a0a861784f84c983635f2.zip FreeBSD-src-9502945d5babe42ab98a0a861784f84c983635f2.tar.gz |
pte.h: Add the VADDR(pdi,pti) macro to construct virtual address from
page dir+table index.
pmap.h: remove NUPDE, it was wrong and not used. Sanitize KSTKPTEOFF.
vmparam.h: Calculate virtual addr from PDI+PTI from pmap.h rather than
using magic math. Remove UPDT, not used.
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/include/pmap.h | 6 | ||||
-rw-r--r-- | sys/amd64/include/vmparam.h | 35 |
2 files changed, 23 insertions, 18 deletions
diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 3f54f18..87e483f 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -42,7 +42,7 @@ * * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 - * $Id: pmap.h,v 1.34 1996/02/25 03:02:53 dyson Exp $ + * $Id: pmap.h,v 1.35 1996/04/03 05:23:44 dyson Exp $ */ #ifndef _MACHINE_PMAP_H_ @@ -73,8 +73,6 @@ struct vm_map; #define NKPDE 63 /* addressable number of page tables/pde's */ #endif -#define NUPDE (NPTEPG-NKPDE) /* number of user pde's */ - /* * The *PTDI values control the layout of virtual memory * @@ -85,7 +83,7 @@ struct vm_map; #define KPTDI (APTDPTDI-NKPDE)/* start of kernel virtual pde's */ #define PTDPTDI (KPTDI-1) /* ptd entry that points to ptd! */ #define KSTKPTDI (PTDPTDI-1) /* ptd entry for u./kernel&user stack */ -#define KSTKPTEOFF (NBPG/sizeof(pd_entry_t)-UPAGES) /* pte entry for kernel stack */ +#define KSTKPTEOFF (NPTEPG-UPAGES) /* pte entry for kernel stack */ #define PDESIZE sizeof(pd_entry_t) /* for assembly files */ #define PTESIZE sizeof(pt_entry_t) /* for assembly files */ diff --git a/sys/amd64/include/vmparam.h b/sys/amd64/include/vmparam.h index 942f742..7212da9 100644 --- a/sys/amd64/include/vmparam.h +++ b/sys/amd64/include/vmparam.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)vmparam.h 5.9 (Berkeley) 5/12/91 - * $Id: vmparam.h,v 1.18 1995/05/25 07:41:28 davidg Exp $ + * $Id: vmparam.h,v 1.19 1996/03/12 15:37:58 davidg Exp $ */ @@ -87,24 +87,31 @@ */ #define MAXSLP 20 + /* - * Mach derived constants + * Virtual addresses of things. Derived from the page directory and + * page table indexes from pmap.h for precision. + * Because of the page that is both a PD and PT, it looks a little + * messy at times, but hey, we'll do anything to save a page :-) */ -/* user/kernel map constants */ -#define KERNBASE ((0x400-1-NKPDE)*(NBPG*NPTEPG)) +#define VM_MAX_KERNEL_ADDRESS VADDR(KPTDI+NKPDE, 0) +#define VM_MIN_KERNEL_ADDRESS VADDR(PTDPTDI, PTDPTDI) + +#define KERNBASE VADDR(KPTDI, 0) + +#define KPT_MAX_ADDRESS VADDR(PTDPTDI, APTDPTDI) +#define KPT_MIN_ADDRESS VADDR(PTDPTDI, KPTDI) + +#define UPT_MAX_ADDRESS VADDR(PTDPTDI, PTDPTDI) +#define UPT_MIN_ADDRESS VADDR(PTDPTDI, 0) + +#define VM_MAXUSER_ADDRESS VADDR(KSTKPTDI, KSTKPTEOFF) + +#define USRSTACK VM_MAXUSER_ADDRESS +#define VM_MAX_ADDRESS VADDR(PTDPTDI, PTDPTDI) #define VM_MIN_ADDRESS ((vm_offset_t)0) -#define VM_MAXUSER_ADDRESS ((vm_offset_t)KERNBASE - (NBPG*(NPTEPG+UPAGES))) -#define USRSTACK VM_MAXUSER_ADDRESS -#define UPT_MIN_ADDRESS ((vm_offset_t)KERNBASE - (NBPG*NPTEPG)) -#define UPT_MAX_ADDRESS ((vm_offset_t)KERNBASE - (NBPG*(NKPDE+2))) -#define VM_MAX_ADDRESS UPT_MAX_ADDRESS -#define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)KERNBASE - (NBPG*(NKPDE+2))) -#define UPDT VM_MIN_KERNEL_ADDRESS -#define KPT_MIN_ADDRESS ((vm_offset_t)KERNBASE - NBPG*(NKPDE+1)) -#define KPT_MAX_ADDRESS ((vm_offset_t)KERNBASE - NBPG) -#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)KERNBASE + NKPDE*NBPG*NPTEPG) /* virtual sizes (bytes) for various kernel submaps */ #define VM_KMEM_SIZE (32 * 1024 * 1024) |