Rev 282 | Rev 501 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 282 | Rev 309 | ||
---|---|---|---|
Line 31... | Line 31... | ||
31 | #include <arch.h> |
31 | #include <arch.h> |
32 | #include <cpu.h> |
32 | #include <cpu.h> |
33 | 33 | ||
34 | void fpu_context_save(fpu_context_t *fctx) |
34 | void fpu_context_save(fpu_context_t *fctx) |
35 | { |
35 | { |
36 | } |
- | |
37 | - | ||
38 | - | ||
39 | void fpu_context_restore(fpu_context_t *fctx) |
- | |
40 | { |
- | |
41 | if (THREAD==CPU->fpu_owner) |
- | |
42 | reset_TS_flag(); |
- | |
43 | else { |
- | |
44 | set_TS_flag(); |
- | |
45 | if (CPU->fpu_owner != NULL) |
- | |
46 | (CPU->fpu_owner)->fpu_context_engaged=1; |
- | |
47 | } |
- | |
48 | } |
- | |
49 | - | ||
50 | - | ||
51 | void fpu_lazy_context_save(fpu_context_t *fctx) |
- | |
52 | { |
- | |
53 | __asm__ volatile ( |
36 | __asm__ volatile ( |
54 | "fnsave %0" |
37 | "fnsave %0" |
55 | : "=m"(*fctx) |
38 | : "=m"(*fctx) |
56 | ); |
39 | ); |
57 | } |
40 | } |
58 | 41 | ||
- | 42 | ||
59 | void fpu_lazy_context_restore(fpu_context_t *fctx) |
43 | void fpu_context_restore(fpu_context_t *fctx) |
60 | { |
44 | { |
61 | __asm__ volatile ( |
45 | __asm__ volatile ( |
62 | "frstor %0" |
46 | "frstor %0" |
63 | : "=m"(*fctx) |
47 | : "=m"(*fctx) |
64 | ); |
48 | ); |