summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/pmap.h
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2010-11-26 19:36:26 +0000
committeralc <alc@FreeBSD.org>2010-11-26 19:36:26 +0000
commit754459840f135c55c128d215423864087090523d (patch)
tree0f8f199cf699cb1bab5eb8a9c608694b0004c429 /sys/amd64/include/pmap.h
parented99de310cdfe5c10e78419f94ca812947b1fe29 (diff)
downloadFreeBSD-src-754459840f135c55c128d215423864087090523d.zip
FreeBSD-src-754459840f135c55c128d215423864087090523d.tar.gz
Make the size of the direct map easily configurable. Changing NDMPML4E
now suffices. Increase the size of the direct map to 1TB. An earler version of this patch was tested by sbruno@.
Diffstat (limited to 'sys/amd64/include/pmap.h')
-rw-r--r--sys/amd64/include/pmap.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h
index 45ccc64..c597cb2 100644
--- a/sys/amd64/include/pmap.h
+++ b/sys/amd64/include/pmap.h
@@ -125,15 +125,21 @@
#define NUPDPE (NUPML4E*NPDPEPG)/* number of userland PDP pages */
#define NUPDE (NUPDPE*NPDEPG) /* number of userland PD entries */
-#define NDMPML4E 1 /* number of dmap PML4 slots */
+/*
+ * NDMPML4E is the number of PML4 entries that are used to implement the
+ * direct map. It must be a power of two.
+ */
+#define NDMPML4E 2
/*
- * The *PDI values control the layout of virtual memory
+ * The *PDI values control the layout of virtual memory. The starting address
+ * of the direct map, which is controlled by DMPML4I, must be a multiple of
+ * its size. (See the PHYS_TO_DMAP() and DMAP_TO_PHYS() macros.)
*/
#define PML4PML4I (NPML4EPG/2) /* Index of recursive pml4 mapping */
#define KPML4I (NPML4EPG-1) /* Top 512GB for KVM */
-#define DMPML4I (KPML4I-1) /* Next 512GB down for direct map */
+#define DMPML4I rounddown(KPML4I - NDMPML4E, NDMPML4E) /* Below KVM */
#define KPDPI (NPDPEPG-2) /* kernbase at -2GB */
OpenPOWER on IntegriCloud