From 6ef2d9a02df8e4b33853fa0d326ae28552b2b4e4 Mon Sep 17 00:00:00 2001 From: Jake Burkholder Date: Sat, 20 Oct 2001 16:17:04 +0000 Subject: Parameterize the size of the kernel virtual address space on KVA_PAGES. Don't use a hard coded address constant for the virtual address of the kernel tsb. Allocate kernel virtual address space for the kernel tsb at runtime. Remove unused parameter to pmap_bootstrap. Adapt pmap.c to use KVA_PAGES. Map the message buffer too. Add some traces. Implement pmap_protect. --- sys/sparc64/include/vmparam.h | 46 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) (limited to 'sys/sparc64/include/vmparam.h') diff --git a/sys/sparc64/include/vmparam.h b/sys/sparc64/include/vmparam.h index 2b3c2449e732..fd2bae466a7d 100644 --- a/sys/sparc64/include/vmparam.h +++ b/sys/sparc64/include/vmparam.h @@ -90,10 +90,50 @@ #define VM_KMEM_SIZE (12*1024*1024) #endif -#define VM_MIN_KERNEL_ADDRESS (0xc0000000) -#define VM_MAX_KERNEL_ADDRESS (0xffffe000) +/* + * Number of 4 meg pages to use for the kernel tsb. + */ +#ifndef KVA_PAGES +#define KVA_PAGES (1) +#endif + +/* + * Range of kernel virtual addresses. max = min + range. + */ +#define KVA_RANGE \ + ((KVA_PAGES * PAGE_SIZE_4M) << (PAGE_SHIFT - STTE_SHIFT)) + +/* + * Lowest kernel virtual address, where the kernel is loaded. + * + * If we are using less than 4 super pages for the kernel tsb, the address + * space is less than 4 gigabytes, so put it at the end of the first 4 + * gigbytes. This allows the kernel and the firmware mappings to be mapped + * with a single contiguous tsb. Otherwise start at 0, we'll cover them + * anyway. + * + * ie: + * kva_pages = 1 + * vm_max_kernel_address 0xffffe000 + * openfirmware 0xf0000000 + * kernbase 0xc0000000 + * kva_pages = 8 + * vm_max_kernel_address 0x1ffffe000 + * openfirmware 0xf0000000 + * kernbase 0x0 + * + * There are at least 4 pages of dynamic linker junk before kernel text begins, + * so starting at zero is fairly safe. + */ +#if KVA_PAGES < 4 +#define VM_MIN_KERNEL_ADDRESS ((1UL << 32) - KVA_RANGE) +#else +#define VM_MIN_KERNEL_ADDRESS (0) +#endif -#define KERNBASE (0xc0000000) +#define VM_MAX_KERNEL_ADDRESS (VM_MIN_KERNEL_ADDRESS + KVA_RANGE - PAGE_SIZE) +#define UPT_MIN_ADDRESS (VM_MIN_KERNEL_ADDRESS + KVA_RANGE) +#define KERNBASE (VM_MIN_KERNEL_ADDRESS) /* * Initial pagein size of beginning of executable file. -- cgit v1.2.3