From c1cd48b72f6be4828edf9a25ed306f354e99dcd0 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Tue, 21 Feb 2012 11:58:15 -0600 Subject: [PATCH] kernel: Fix fpu on non-apic systems * If apic is not present, the smp code never gets called to set up the fpu. * Detect lack of apic, and set up fpu in arch_cpu. * Should fix #8346 and #8348 --- src/system/kernel/arch/x86/arch_cpu.cpp | 5 +++++ src/system/kernel/arch/x86/arch_smp.cpp | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/system/kernel/arch/x86/arch_cpu.cpp b/src/system/kernel/arch/x86/arch_cpu.cpp index 632c3a26ba..c199afc81d 100644 --- a/src/system/kernel/arch/x86/arch_cpu.cpp +++ b/src/system/kernel/arch/x86/arch_cpu.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -802,6 +803,10 @@ arch_cpu_init_post_vm(kernel_args *args) DT_DATA_WRITEABLE, DPL_USER); } + if (!apic_available()) + x86_init_fpu(); + // else fpu gets set up in smp code + return B_OK; } diff --git a/src/system/kernel/arch/x86/arch_smp.cpp b/src/system/kernel/arch/x86/arch_smp.cpp index 55e4410f03..0720ae0bc6 100644 --- a/src/system/kernel/arch/x86/arch_smp.cpp +++ b/src/system/kernel/arch/x86/arch_smp.cpp @@ -73,10 +73,11 @@ i386_smp_error_interrupt(void *data) status_t arch_smp_init(kernel_args *args) { - TRACE(("arch_smp_init: entry\n")); + TRACE(("%s: entry\n", __func__)); if (!apic_available()) { // if we don't have an apic we can't do smp + TRACE(("%s: apic not available for smp\n", __func__)); return B_OK; }