Rev 906 | Rev 958 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 906 | Rev 924 | ||
|---|---|---|---|
| Line 32... | Line 32... | ||
| 32 | #include <arch/cp0.h> |
32 | #include <arch/cp0.h> |
| 33 | #include <proc/thread.h> |
33 | #include <proc/thread.h> |
| 34 | 34 | ||
| 35 | void fpu_disable(void) |
35 | void fpu_disable(void) |
| 36 | { |
36 | { |
| 37 | #ifdef HAVE_FPU |
37 | #ifdef ARCH_HAS_FPU |
| 38 | cp0_status_write(cp0_status_read() & ~cp0_status_fpu_bit); |
38 | cp0_status_write(cp0_status_read() & ~cp0_status_fpu_bit); |
| 39 | if (THREAD && THREAD->pstate) |
39 | if (THREAD && THREAD->pstate) |
| 40 | THREAD->pstate->status &= ~cp0_status_fpu_bit; |
40 | THREAD->pstate->status &= ~cp0_status_fpu_bit; |
| 41 | #endif |
41 | #endif |
| 42 | } |
42 | } |
| 43 | 43 | ||
| 44 | void fpu_enable(void) |
44 | void fpu_enable(void) |
| 45 | { |
45 | { |
| 46 | #ifdef HAVE_FPU |
46 | #ifdef ARCH_HAS_FPU |
| 47 | cp0_status_write(cp0_status_read() | cp0_status_fpu_bit); |
47 | cp0_status_write(cp0_status_read() | cp0_status_fpu_bit); |
| 48 | if (THREAD && THREAD->pstate) |
48 | if (THREAD && THREAD->pstate) |
| 49 | THREAD->pstate->status |= cp0_status_fpu_bit; |
49 | THREAD->pstate->status |= cp0_status_fpu_bit; |
| 50 | #endif |
50 | #endif |
| 51 | } |
51 | } |