aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-05-15 13:22:09 -0400
committerIan Moffett <ian@osmora.org>2024-05-15 13:22:09 -0400
commit84da00bbc2bb8a93507179a404dfc91c630c6e96 (patch)
tree7ecd7f27d3ff706b15556b5decd1f21b047b914e
parente0ea82ad2ffd856da1c351a5ea7f4afd6d103d0e (diff)
kernel/amd64: machdep: Cleanup processor_init()
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r--sys/arch/amd64/amd64/machdep.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index a075532..0f04e7a 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -335,8 +335,8 @@ processor_init(void)
/* Set %GS to cpu_info */
amd64_write_gs_base((uintptr_t)cur_cpu);
+ /* Try to enable SSE/SSE2 */
if (is_sse_supported()) {
- /* Enable SSE/SSE2 */
reg_tmp = amd64_read_cr0();
reg_tmp &= ~(__BIT(2));
reg_tmp |= __BIT(1);
@@ -353,10 +353,7 @@ processor_init(void)
CPU_INFO_LOCK(cur_cpu);
init_tss(cur_cpu);
- /*
- * See if there are things that have not been set up,
- * set them up if so...
- */
+ /* Set up some ACPI things */
if (!__TEST(init_flags, INIT_FLAG_ACPI)) {
/*
* Parse the MADT... This is needed to fetch required information
@@ -365,6 +362,8 @@ processor_init(void)
init_flags |= INIT_FLAG_ACPI;
acpi_parse_madt(cur_cpu);
}
+
+ /* Setup I/O APIC */
if (!__TEST(init_flags, INIT_FLAG_IOAPIC)) {
init_flags |= INIT_FLAG_IOAPIC;
ioapic_init();
@@ -372,7 +371,6 @@ processor_init(void)
cur_cpu->lapic_base = acpi_get_lapic_base();
CPU_INFO_UNLOCK(cur_cpu);
-
lapic_init();
/* Use spectre mitigation if enabled */