Rev 2787 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2787 | Rev 4377 | ||
---|---|---|---|
Line 37... | Line 37... | ||
37 | 37 | ||
38 | /** Save FPU (mmx, sse) context using fxsave instruction */ |
38 | /** Save FPU (mmx, sse) context using fxsave instruction */ |
39 | void fpu_context_save(fpu_context_t *fctx) |
39 | void fpu_context_save(fpu_context_t *fctx) |
40 | { |
40 | { |
41 | asm volatile ( |
41 | asm volatile ( |
42 | "fxsave %0" |
42 | "fxsave %[fctx]\n" |
43 | : "=m"(*fctx) |
43 | : [fctx] "=m" (*fctx) |
44 | ); |
44 | ); |
45 | } |
45 | } |
46 | 46 | ||
47 | /** Restore FPU (mmx,sse) context using fxrstor instruction */ |
47 | /** Restore FPU (mmx,sse) context using fxrstor instruction */ |
48 | void fpu_context_restore(fpu_context_t *fctx) |
48 | void fpu_context_restore(fpu_context_t *fctx) |
49 | { |
49 | { |
50 | asm volatile ( |
50 | asm volatile ( |
51 | "fxrstor %0" |
51 | "fxrstor %[fctx]\n" |
52 | : "=m"(*fctx) |
52 | : [fctx] "=m" (*fctx) |
53 | ); |
53 | ); |
54 | } |
54 | } |
55 | 55 | ||
56 | void fpu_init() |
56 | void fpu_init() |
57 | { |
57 | { |
58 | /* TODO: Zero all SSE, MMX etc. registers */ |
58 | /* TODO: Zero all SSE, MMX etc. registers */ |
59 | asm volatile ( |
59 | asm volatile ( |
60 | "fninit;" |
60 | "fninit\n" |
61 | ); |
61 | ); |
62 | } |
62 | } |
63 | 63 | ||
64 | /** @} |
64 | /** @} |
65 | */ |
65 | */ |