Rev 309 | Rev 341 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 309 | Rev 326 | ||
---|---|---|---|
Line 26... | Line 26... | ||
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | * |
27 | * |
28 | */ |
28 | */ |
29 | 29 | ||
30 | #include <fpu_context.h> |
30 | #include <fpu_context.h> |
- | 31 | #include <arch.h> |
|
- | 32 | #include <arch/cp0.h> |
|
31 | 33 | ||
32 | void fpu_context_save(fpu_context_t *fctx) |
34 | void fpu_disable(void) |
33 | { |
35 | { |
- | 36 | #ifdef HAVE_FPU |
|
- | 37 | cp0_status_write(cp0_status_read() & ~cp0_status_fpu_bit); |
|
- | 38 | if (THREAD && THREAD->pstate) |
|
- | 39 | THREAD->pstate->status &= ~cp0_status_fpu_bit; |
|
- | 40 | #endif |
|
34 | } |
41 | } |
35 | 42 | ||
36 | - | ||
37 | void fpu_context_restore(fpu_context_t *fctx) |
43 | void fpu_enable(void) |
38 | { |
44 | { |
- | 45 | #ifdef HAVE_FPU |
|
- | 46 | cp0_status_write(cp0_status_read() | cp0_status_fpu_bit); |
|
- | 47 | if (THREAD && THREAD->pstate) |
|
- | 48 | THREAD->pstate->status |= cp0_status_fpu_bit; |
|
- | 49 | #endif |
|
39 | } |
50 | } |
40 | 51 | ||
- | 52 | void fpu_init(void) |
|
- | 53 | { |
|
- | 54 | /* TODO: Zero all registers */ |
|
- | 55 | } |