summaryrefslogtreecommitdiff
path: root/i386/i386/vm_param.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2016-01-30 01:25:52 +0100
committerRichard Braun <rbraun@sceen.net>2016-01-30 01:51:48 +0100
commit945f51bfe865e122d73986dd8219762450ffc0f3 (patch)
tree858283023412ddf46f7504cad5f5aa26dbce0496 /i386/i386/vm_param.h
parentc29915fccda96258dbccf49b052ee4ddd7d51169 (diff)
Fix early page allocation on Xen
The Xen target was completely ignored when porting the biosmem and vm_page physical memory allocators. Let's fix this. * i386/Makefrag.am (libkernel_a_SOURCES): Add i386/i386at/biosmem.{c,h}. * i386/i386/vm_page.h (VM_PAGE_MAX_SEGS, VM_PAGE_DIRECTMAP_LIMIT, VM_PAGE_HIGHMEM_LIMIT): Define for Xen. * i386/i386at/biosmem.c: Include mach/xen.h. (biosmem_panic_setup_msg): Comment out for Xen since it's unused. (biosmem_map_build, biosmem_map_build_simple, biosmem_save_cmdline_sizes, biosmem_find_boot_data_update, biosmem_find_boot_data, biosmem_setup_allocator): Likewise. (biosmem_bootstrap_common): New function. (biosmem_xen_bootstrap): Likewise, for Xen. (biosmem_bootalloc): Perform bottom-up allocations for Xen. * i386/i386at/biosmem.h (biosmem_xen_bootstrap): New prototype, for Xen. * i386/i386at/model_dep.c (i386at_init): Call biosmem_xen_bootstrap instead of biosmem_bootstrap on Xen. * i386/include/mach/i386/vm_types.h (phys_addr_t): Define as an unsigned 64-bits integer when PAE is enabled.
Diffstat (limited to 'i386/i386/vm_param.h')
-rw-r--r--i386/i386/vm_param.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/i386/i386/vm_param.h b/i386/i386/vm_param.h
index da3126c..3769ef7 100644
--- a/i386/i386/vm_param.h
+++ b/i386/i386/vm_param.h
@@ -108,6 +108,14 @@
*/
#define VM_PAGE_DMA_LIMIT DECL_CONST(0x1000000, UL)
+#ifdef MACH_XEN
+/* TODO Completely check Xen physical/virtual layout */
+#define VM_PAGE_MAX_SEGS 3
+#define VM_PAGE_DIRECTMAP_LIMIT (VM_MAX_KERNEL_ADDRESS \
+ - VM_MIN_KERNEL_ADDRESS \
+ - VM_KERNEL_MAP_SIZE)
+#define VM_PAGE_HIGHMEM_LIMIT DECL_CONST(0x10000000000000, ULL)
+#else /* MACH_XEN */
#ifdef __LP64__
#define VM_PAGE_MAX_SEGS 4
#define VM_PAGE_DMA32_LIMIT DECL_CONST(0x100000000, UL)
@@ -125,6 +133,7 @@
#define VM_PAGE_HIGHMEM_LIMIT DECL_CONST(0xfffff000, UL)
#endif /* PAE */
#endif /* __LP64__ */
+#endif /* MACH_XEN */
/*
* Physical segment indexes.