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.
This commit is contained in:
parent
53beacfa00
commit
f83fbaf22d
@ -82,20 +82,29 @@
|
||||
#define PGEX_W 0x02 /* during a Write cycle */
|
||||
#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
|
||||
|
||||
/*
|
||||
|
@ -35,6 +35,9 @@ PECOFF_DEBUG opt_pecoff.h
|
||||
# i386 SMP options
|
||||
APIC_IO opt_global.h
|
||||
|
||||
# Change KVM size. Changes things all over the kernel.
|
||||
KVA_PAGES opt_global.h
|
||||
|
||||
CLK_CALIBRATION_LOOP opt_clock.h
|
||||
CLK_USE_I8254_CALIBRATION opt_clock.h
|
||||
CLK_USE_TSC_CALIBRATION opt_clock.h
|
||||
|
@ -35,6 +35,9 @@ PECOFF_DEBUG opt_pecoff.h
|
||||
# i386 SMP options
|
||||
APIC_IO opt_global.h
|
||||
|
||||
# Change KVM size. Changes things all over the kernel.
|
||||
KVA_PAGES opt_global.h
|
||||
|
||||
CLK_CALIBRATION_LOOP opt_clock.h
|
||||
CLK_USE_I8254_CALIBRATION opt_clock.h
|
||||
CLK_USE_TSC_CALIBRATION opt_clock.h
|
||||
|
@ -82,20 +82,29 @@
|
||||
#define PGEX_W 0x02 /* during a Write cycle */
|
||||
#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
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user