Rev 257 | Rev 282 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 257 | Rev 281 | ||
---|---|---|---|
Line 36... | Line 36... | ||
36 | } |
36 | } |
37 | 37 | ||
38 | 38 | ||
39 | void fpu_context_restore(fpu_context_t *fctx) |
39 | void fpu_context_restore(fpu_context_t *fctx) |
40 | { |
40 | { |
41 | if(THREAD==CPU->fpu_owner) {reset_TS_flag(); } |
41 | if (THREAD==CPU->fpu_owner) |
- | 42 | reset_TS_flag(); |
|
42 | else |
43 | else { |
43 | { |
- | |
44 | set_TS_flag(); |
44 | set_TS_flag(); |
- | 45 | if (CPU->fpu_owner != NULL) |
|
45 | if((CPU->fpu_owner)!=NULL)(CPU->fpu_owner)->fpu_context_engaged=1; |
46 | (CPU->fpu_owner)->fpu_context_engaged=1; |
46 | } |
47 | } |
47 | } |
48 | } |
48 | 49 | ||
49 | 50 | ||
50 | void fpu_lazy_context_save(fpu_context_t *fctx) |
51 | void fpu_lazy_context_save(fpu_context_t *fctx) |
51 | { |
52 | { |
52 | return; |
- | |
53 | __asm__ ( |
53 | __asm__ volatile ( |
54 | "fnsave %0" |
54 | "fnsave %0" |
55 | : "=m"(fctx) |
55 | : "=m"(*fctx) |
56 | ); |
56 | ); |
- | 57 | return; |
|
57 | } |
58 | } |
58 | 59 | ||
59 | void fpu_lazy_context_restore(fpu_context_t *fctx) |
60 | void fpu_lazy_context_restore(fpu_context_t *fctx) |
60 | { |
61 | { |
61 | return; |
- | |
62 | __asm__ ( |
62 | __asm__ volatile ( |
63 | "frstor %0" |
63 | "frstor %0" |
64 | : "=m"(fctx) |
64 | : "=m"(*fctx) |
65 | ); |
65 | ); |
- | 66 | return; |
|
66 | } |
67 | } |
67 | 68 | ||
68 | void fpu_init(void) |
69 | void fpu_init(void) |
69 | { |
70 | { |
70 | asm( |
71 | __asm__ volatile ( |
71 | "fninit;" |
72 | "fninit;" |
72 | ); |
73 | ); |
73 | } |
74 | } |