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
This commit is contained in:
Alexander von Gluck IV 2012-02-21 11:58:15 -06:00
parent 4bd6c200c1
commit c1cd48b72f
2 changed files with 7 additions and 1 deletions

View File

@ -26,6 +26,7 @@
#include <vm/VMAddressSpace.h> #include <vm/VMAddressSpace.h>
#include <arch_system_info.h> #include <arch_system_info.h>
#include <arch/x86/apic.h>
#include <arch/x86/selector.h> #include <arch/x86/selector.h>
#include <boot/kernel_args.h> #include <boot/kernel_args.h>
@ -802,6 +803,10 @@ arch_cpu_init_post_vm(kernel_args *args)
DT_DATA_WRITEABLE, DPL_USER); DT_DATA_WRITEABLE, DPL_USER);
} }
if (!apic_available())
x86_init_fpu();
// else fpu gets set up in smp code
return B_OK; return B_OK;
} }

View File

@ -73,10 +73,11 @@ i386_smp_error_interrupt(void *data)
status_t status_t
arch_smp_init(kernel_args *args) arch_smp_init(kernel_args *args)
{ {
TRACE(("arch_smp_init: entry\n")); TRACE(("%s: entry\n", __func__));
if (!apic_available()) { if (!apic_available()) {
// if we don't have an apic we can't do smp // if we don't have an apic we can't do smp
TRACE(("%s: apic not available for smp\n", __func__));
return B_OK; return B_OK;
} }