summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/pmap.h
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-09-21 06:23:03 +0000
committerpeter <peter@FreeBSD.org>2001-09-21 06:23:03 +0000
commit7290545b37b990f88ce4868276e6341c59bf623d (patch)
tree54566470d8072fc43361997979af72c05e327e93 /sys/i386/include/pmap.h
parent297dc90746f0278c0b594f39111f30765eaca913 (diff)
downloadFreeBSD-src-7290545b37b990f88ce4868276e6341c59bf623d.zip
FreeBSD-src-7290545b37b990f88ce4868276e6341c59bf623d.tar.gz
Introduce a new option, KVA_SPACE, which can be used to reconfigure
the size of the kernel virtual address space relatively painlessly. Userland will adapt via the exported kernbase symbol. Increasing this causes the user part of address space to reduce.
Diffstat (limited to 'sys/i386/include/pmap.h')
-rw-r--r--sys/i386/include/pmap.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/sys/i386/include/pmap.h b/sys/i386/include/pmap.h
index ab923fb..a6eabae 100644
--- a/sys/i386/include/pmap.h
+++ b/sys/i386/include/pmap.h
@@ -83,19 +83,28 @@
#define PGEX_U 0x04 /* access from User mode (UPL) */
/*
+ * Size of Kernel address space. This is the number of page table pages
+ * (4MB each) to use for the kernel. 256 pages == 1 Gigabyte.
+ * This **MUST** be a multiple of 4 (eg: 252, 256, 260, etc).
+ */
+#ifndef KVA_PAGES
+#define KVA_PAGES 256
+#endif
+
+/*
* Pte related macros
*/
#define VADDR(pdi, pti) ((vm_offset_t)(((pdi)<<PDRSHIFT)|((pti)<<PAGE_SHIFT)))
#ifndef NKPT
-#define NKPT 30 /* actual number of kernel page tables */
+#define NKPT 30 /* actual number of kernel page tables */
#endif
#ifndef NKPDE
#ifdef SMP
-#define NKPDE 254 /* addressable number of page tables/pde's */
+#define NKPDE (KVA_PAGES - 2) /* addressable number of page tables/pde's */
#else
-#define NKPDE 255 /* addressable number of page tables/pde's */
-#endif /* SMP */
+#define NKPDE (KVA_PAGES - 1) /* addressable number of page tables/pde's */
+#endif
#endif
/*
OpenPOWER on IntegriCloud