34,6 → 34,10 |
/** Save FPU (mmx, sse) context using fxsave instruction */ |
void fpu_context_save(fpu_context_t *fctx) |
{ |
/* Align on 16-byte boundary */ |
if (((__u64)fctx) & 0xf) |
fctx = (fpu_context_t *)((((__u64)fctx) | 0xf) + 1); |
|
__asm__ volatile ( |
"fxsave %0" |
: "=m"(*fctx) |
43,6 → 47,9 |
/** Restore FPU (mmx,sse) context using fxrstor instruction */ |
void fpu_context_restore(fpu_context_t *fctx) |
{ |
/* Align on 16-byte boundary */ |
if (((__u64)fctx) & 0xf) |
fctx = (fpu_context_t *)((((__u64)fctx) | 0xf) + 1); |
__asm__ volatile ( |
"fxrstor %0" |
: "=m"(*fctx) |
49,7 → 56,7 |
); |
} |
|
void fpu_init() |
void fpu_init(fpu_context_t *fctx) |
{ |
/* TODO: Zero all SSE, MMX etc. registers */ |
__asm__ volatile ( |