aboutsummaryrefslogtreecommitdiff
path: root/sys/sparc64/include/vmparam.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/sparc64/include/vmparam.h')
-rw-r--r--sys/sparc64/include/vmparam.h46
1 files changed, 43 insertions, 3 deletions
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.