minor optimizations and additional output messages

This commit is contained in:
Stefan Lankes 2011-10-07 16:10:34 +02:00
parent c90a533521
commit 5fe4f8895b
2 changed files with 6 additions and 3 deletions

View file

@ -170,13 +170,14 @@ static void fpu_init(union fpu_state* fpu)
if (has_fxsr()) {
i387_fxsave_t* fx = &fpu->fxsave;
memset(fx, 0x00, sizeof(union fpu_state));
memset(fx, 0x00, sizeof(i387_fxsave_t));
fx->cwd = 0x37f;
if (has_xmm())
fx->mxcsr = 0x1f80;
} else {
i387_fsave_t *fp = &fpu->fsave;
memset(fp, 0x00, sizeof(union fpu_state));
memset(fp, 0x00, sizeof(i387_fsave_t));
fp->cwd = 0xffff037fu;
fp->swd = 0xffff0000u;
fp->twd = 0xffffffffu;

View file

@ -45,8 +45,10 @@ int cpu_detection(void)
if (has_avx())
kprintf("The CPU owns the Advanced Vector Extensions (AVX). However, MetalSVM doesn't support AVX!\n");
if (has_fpu())
if (has_fpu()) {
kputs("Found and initialize FPU!\n");
asm volatile ("fninit");
}
return 0;
}