Rev 2071 | Rev 2089 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 2071 | Rev 2082 | ||
|---|---|---|---|
| Line 38... | Line 38... | ||
| 38 | #include <cpu.h> |
38 | #include <cpu.h> |
| 39 | 39 | ||
| 40 | /** Save FPU (mmx, sse) context using fxsave instruction */ |
40 | /** Save FPU (mmx, sse) context using fxsave instruction */ |
| 41 | void fpu_context_save(fpu_context_t *fctx) |
41 | void fpu_context_save(fpu_context_t *fctx) |
| 42 | { |
42 | { |
| 43 | __asm__ volatile ( |
43 | asm volatile ( |
| 44 | "fxsave %0" |
44 | "fxsave %0" |
| 45 | : "=m"(*fctx) |
45 | : "=m"(*fctx) |
| 46 | ); |
46 | ); |
| 47 | } |
47 | } |
| 48 | 48 | ||
| 49 | /** Restore FPU (mmx,sse) context using fxrstor instruction */ |
49 | /** Restore FPU (mmx,sse) context using fxrstor instruction */ |
| 50 | void fpu_context_restore(fpu_context_t *fctx) |
50 | void fpu_context_restore(fpu_context_t *fctx) |
| 51 | { |
51 | { |
| 52 | __asm__ volatile ( |
52 | asm volatile ( |
| 53 | "fxrstor %0" |
53 | "fxrstor %0" |
| 54 | : "=m"(*fctx) |
54 | : "=m"(*fctx) |
| 55 | ); |
55 | ); |
| 56 | } |
56 | } |
| 57 | 57 | ||
| 58 | void fpu_init() |
58 | void fpu_init() |
| 59 | { |
59 | { |
| 60 | /* TODO: Zero all SSE, MMX etc. registers */ |
60 | /* TODO: Zero all SSE, MMX etc. registers */ |
| 61 | __asm__ volatile ( |
61 | asm volatile ( |
| 62 | "fninit;" |
62 | "fninit;" |
| 63 | ); |
63 | ); |
| 64 | } |
64 | } |
| 65 | 65 | ||
| 66 | /** @} |
66 | /** @} |