summaryrefslogtreecommitdiff
path: root/i386/i386/vm_param.h
diff options
context:
space:
mode:
Diffstat (limited to 'i386/i386/vm_param.h')
-rw-r--r--i386/i386/vm_param.h61
1 files changed, 54 insertions, 7 deletions
diff --git a/i386/i386/vm_param.h b/i386/i386/vm_param.h
index ffd91d6..16f9119 100644
--- a/i386/i386/vm_param.h
+++ b/i386/i386/vm_param.h
@@ -25,6 +25,7 @@
/* XXX use xu/vm_param.h */
#include <mach/vm_param.h>
+#include <kern/macros.h>
#ifdef MACH_PV_PAGETABLES
#include <xen/public/xen.h>
#endif
@@ -54,19 +55,65 @@
#define VM_MAX_KERNEL_ADDRESS (LINEAR_MAX_KERNEL_ADDRESS - LINEAR_MIN_KERNEL_ADDRESS + VM_MIN_KERNEL_ADDRESS)
#endif /* MACH_PV_PAGETABLES */
-/* Reserve mapping room for kmem. */
-#ifdef MACH_XEN
-#define VM_KERNEL_MAP_SIZE (224 * 1024 * 1024)
-#else
-#define VM_KERNEL_MAP_SIZE (192 * 1024 * 1024)
-#endif
-
/* The kernel virtual address space is actually located
at high linear addresses.
This is the kernel address range in linear addresses. */
#define LINEAR_MIN_KERNEL_ADDRESS (VM_MAX_ADDRESS)
#define LINEAR_MAX_KERNEL_ADDRESS (0xffffffffUL)
+/*
+ * Direct physical mapping boundaries.
+ */
+#ifdef __LP64__
+#define VM_MIN_DIRECTMAP_ADDRESS VM_MIN_KERNEL_ADDRESS
+#define VM_MAX_DIRECTMAP_ADDRESS DECL_CONST(0xffffc00000000000, UL)
+#else /* __LP64__ */
+#define VM_MIN_DIRECTMAP_ADDRESS VM_MAX_ADDRESS
+#define VM_MAX_DIRECTMAP_ADDRESS DECL_CONST(0xf8000000, UL)
+#endif /* __LP64__ */
+
+/* Reserve mapping room for virtual kernel memory, mainly used for IPC
+ and temporary mappings. */
+#define VM_KERNEL_MAP_SIZE (128 * 1024 * 1024)
+
+/*
+ * Physical memory properties.
+ */
+
+#define VM_PAGE_DMA_LIMIT DECL_CONST(0x1000000, UL)
+
+#ifdef __LP64__
+#define VM_PAGE_MAX_SEGS 4
+#define VM_PAGE_DMA32_LIMIT DECL_CONST(0x100000000, UL)
+#define VM_PAGE_DIRECTMAP_LIMIT DECL_CONST(0x400000000000, UL)
+#define VM_PAGE_HIGHMEM_LIMIT DECL_CONST(0x10000000000000, UL)
+#else /* __LP64__ */
+#define VM_PAGE_DIRECTMAP_LIMIT DECL_CONST(0x38000000, ULL)
+#ifdef X86_PAE
+#define VM_PAGE_MAX_SEGS 3
+#define VM_PAGE_HIGHMEM_LIMIT DECL_CONST(0x10000000000000, ULL)
+#else /* X86_PAE */
+#define VM_PAGE_MAX_SEGS 3
+#define VM_PAGE_HIGHMEM_LIMIT DECL_CONST(0xfffff000, UL)
+#endif /* X86_PAE */
+#endif /* __LP64__ */
+
+/*
+ * Physical segment indexes.
+ */
+#define VM_PAGE_SEG_DMA 0
+
+#ifdef __LP64__
+#define VM_PAGE_SEG_DMA32 1
+#define VM_PAGE_SEG_DIRECTMAP 2
+#define VM_PAGE_SEG_HIGHMEM 3
+#else /* __LP64__ */
+#define VM_PAGE_SEG_DMA32 1 /* Alias for the DIRECTMAP segment */
+#define VM_PAGE_SEG_DIRECTMAP 1
+#define VM_PAGE_SEG_HIGHMEM 2
+#endif /* __LP64__ */
+
+
#ifdef MACH_PV_PAGETABLES
/* need room for mmu updates (2*8bytes) */
#define KERNEL_STACK_SIZE (4*I386_PGBYTES)