From be52ef13998704e51e36593ef23c7bda79d1e196 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Thu, 15 May 2003 00:20:17 +0000 Subject: [PATCH] Use compile time constants for things like PTmap[] etc because they're about to move outside of the +/- 2GB range Suggested by: jake Approved by: re (amd64/* blanket) --- sys/amd64/amd64/locore.S | 9 --------- sys/amd64/include/pmap.h | 10 +++------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/sys/amd64/amd64/locore.S b/sys/amd64/amd64/locore.S index 65b01ac9845..04d2ac55151 100644 --- a/sys/amd64/amd64/locore.S +++ b/sys/amd64/amd64/locore.S @@ -33,15 +33,6 @@ #include "assym.s" -/* - * PTmap is recursive pagemap at top of virtual address space. - * Within PTmap, the page directory can be found (third indirection). - */ - .globl PTmap,PTD,PTDpde - .set PTmap,(PTDPTDI << PDRSHIFT) - .set PTD,PTmap + (PTDPTDI * PAGE_SIZE) - .set PTDpde,PTD + (PTDPTDI * PDESIZE) - /* * Compiled KERNBASE location */ diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index d3e2104c3be..5ffa0542214 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -145,13 +145,9 @@ typedef u_int64_t pml4_entry_t; * in the page tables and the evil overlapping. */ #ifdef _KERNEL -extern pt_entry_t PTmap[]; -extern pd_entry_t PDmap[]; -extern pdp_entry_t PDPmap[]; -extern pml4_entry_t PML4[]; -extern pdp_entry_t PDP[]; -extern pd_entry_t PTD[]; -extern pd_entry_t PTDpde[]; +#define PTmap ((pt_entry_t *)(VADDR(0, 0, PTDPTDI, 0))) +#define PTD ((pd_entry_t *)(VADDR(0, 0, PTDPTDI, PTDPTDI))) +#define PTDpde ((pd_entry_t *)(VADDR(0, 0, PTDPTDI, PTDPTDI) + (PTDPTDI * sizeof(pd_entry_t)))) extern u_int64_t IdlePML4; /* physical address of "Idle" state directory */ extern u_int64_t IdlePDP; /* physical address of "Idle" state directory */