Rev 58 | Rev 75 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 58 | Rev 73 | ||
---|---|---|---|
Line 38... | Line 38... | ||
38 | } |
38 | } |
39 | 39 | ||
40 | 40 | ||
41 | void fpu_context_restore(fpu_context_t *fctx) |
41 | void fpu_context_restore(fpu_context_t *fctx) |
42 | { |
42 | { |
43 | if(THREAD==CPU->arch.fpu_owner) reset_TS_flag(); |
43 | if(THREAD==CPU->arch.fpu_owner) {reset_TS_flag(); } |
44 | else set_TS_flag(); |
44 | else {set_TS_flag(); ((CPU->arch).fpu_owner)->fpu_context_engaged=1;} |
45 | } |
45 | } |
46 | 46 | ||
47 | 47 | ||
48 | void fpu_lazy_context_save(fpu_context_t *fctx) |
48 | void fpu_lazy_context_save(fpu_context_t *fctx) |
49 | { |
49 | { |
50 | /* |
- | |
51 | pushl %eax |
50 | asm( |
52 | mov 8(%esp),%eax |
51 | "mov %0,%%eax;" |
53 | fxsave (%eax) |
52 | "fxsave (%%eax);" |
54 | popl %eax |
53 | "ret;" |
55 | ret |
54 | :"=m"(fctx) |
56 | */ |
55 | : |
- | 56 | :"%eax" |
|
- | 57 | ); |
|
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 | /* |
- | |
62 | pushl %eax |
62 | asm( |
63 | mov 8(%esp),%eax |
63 | "mov %0,%%eax;" |
64 | fxrstor (%eax) |
64 | "fxrstor (%%eax);" |
65 | popl %eax |
65 | "ret;" |
66 | ret |
66 | :"=m"(fctx) |
67 | */ |
67 | : |
- | 68 | :"%eax" |
|
- | 69 | ); |
|
68 | } |
70 | } |
- | 71 | ||
- | 72 | void fpu_init(void) |
|
- | 73 | { |
|
- | 74 | asm( |
|
- | 75 | "fninit;" |
|
- | 76 | ); |
|
- | 77 | } |
|
- | 78 |