summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-02-22 22:34:51 -0500
committerIan Moffett <ian@osmora.org>2024-02-22 22:34:51 -0500
commitd098b398c22fab4936d2237cc64ded888c3bf7ee (patch)
treeba4980fa7e35392cb3552e6d17ef7298725e4cd3
parent6f2e70067b9fd62818117eb2969169d549179ee0 (diff)
kernel/amd64: machdep: Isolate BSP-only calls
Some routines are to be called on the BSP only during processor startup, this commit isolates them for the BSP onto in pre_init() Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r--sys/arch/amd64/amd64/machdep.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index 6d8648d..4efae64 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -105,21 +105,29 @@ chips_init(void)
}
/*
- * Things set up before processor_init() call...
+ * These are critical things that need to be set up as soon as possible
+ * way before the processor_init() call.
*/
void
pre_init(void)
{
+ struct cpu_info *ci;
+ static bool is_bsp = true;
+
/*
- * These are critical things that need to be set up as soon as possible
- * way before the processor_init() call.
+ * Certain things like serial ports, virtual memory,
+ * etc, need to be set up only once! These things
+ * are to be done on the BSP only...
*/
- uart8250_try_init();
+ if (is_bsp) {
+ is_bsp = false;
+
+ uart8250_try_init();
+ vm_physseg_init();
+ vm_init();
+ }
interrupts_init();
gdt_load(&g_gdtr);
-
- vm_physseg_init();
- vm_init();
}
void