kernel: Fix FPU SSE + MMX instruction usage.

* Rename init_sse to init_fpu and handle FPU setup.
* Stop trying to set up FPU before VM init.
  We tried to set up the FPU before VM init, then
  set it up again after VM init with SSE extensions,
  this caused SSE and MMX applications to crash.
* Be more logical in FPU setup by detecting CPU flag prior
  to enabling FPU. (it's unlikely Haiku will run on
  a processor without a fpu... but lets be consistant)
* SSE2 gcc code now runs (faster even) without GPF
* tqh confirms his previously crashing mmx code now works
* The non-SSE FPU enable after VM init needs tested!
This commit is contained in:
Alexander von Gluck IV
2012-01-20 15:06:01 -06:00
parent 67f45bfdf2
commit 8dd1e875c1
4 changed files with 29 additions and 10 deletions
@@ -334,6 +334,7 @@ void i386_fnsave(void* fpuState);
void i386_fxsave(void* fpuState);
void i386_frstor(const void* fpuState);
void i386_fxrstor(const void* fpuState);
void i386_noop_swap(void* oldFpuState, const void* newFpuState);
void i386_fnsave_swap(void* oldFpuState, const void* newFpuState);
void i386_fxsave_swap(void* oldFpuState, const void* newFpuState);
uint32 x86_read_ebp();