aboutsummaryrefslogtreecommitdiff
path: root/i386/i386at/model_dep.c
diff options
context:
space:
mode:
Diffstat (limited to 'i386/i386at/model_dep.c')
-rw-r--r--i386/i386at/model_dep.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/i386/i386at/model_dep.c b/i386/i386at/model_dep.c
index 9dbe7e01..e0995c96 100644
--- a/i386/i386at/model_dep.c
+++ b/i386/i386at/model_dep.c
@@ -66,6 +66,7 @@
#include <i386/locore.h>
#include <i386/model_dep.h>
#include <i386/smp.h>
+#include <i386/seg.h>
#include <i386at/acpi_parse_apic.h>
#include <i386at/autoconf.h>
#include <i386at/biosmem.h>
@@ -125,6 +126,9 @@ char *kernel_cmdline = "";
extern char version[];
+/* Realmode temporary GDT */
+extern struct pseudo_descriptor gdt_descr_tmp;
+
/* If set, reboot the system on ctrl-alt-delete. */
boolean_t rebootflag = FALSE; /* exported to kdintr */
@@ -207,6 +211,20 @@ void machine_init(void)
*/
pmap_unmap_page_zero();
#endif
+
+#ifdef APIC
+ /*
+ * Grab an early page for AP boot code
+ */
+ /* FIXME: this may not allocate from below 1MB, if within first 16MB */
+ apboot_addr = vm_page_to_pa(vm_page_grab_contig(PAGE_SIZE, VM_PAGE_SEL_DMA));
+ assert (apboot_addr < 0x100000);
+
+ /*
+ * Patch the realmode gdt with the correct offset
+ */
+ gdt_descr_tmp.linear_base += apboot_addr;
+#endif
}
/* Conserve power on processor CPU. */