|
MentOS
0.8.0
The Mentoring Operating System
|
Floating Point Unit (FPU). More...
Macros | |
| #define | __DEBUG_HEADER__ "[FPU ]" |
| Change header. | |
| #define | __DEBUG_LEVEL__ LOGLEVEL_NOTICE |
| Set log level. | |
Functions | |
| static void | __set_fpu_cw (const uint16_t cw) |
| Set the FPU control word. More... | |
| static void | __enable_fpu (void) |
| Enable the FPU and SSE. | |
| static void | __disable_fpu (void) |
| Disable FPU and SSE so it traps to the kernel. | |
| static void | __restore_fpu (task_struct *proc) |
| Restore the FPU for a process. More... | |
| static void | __save_fpu (task_struct *proc) |
| Save the FPU for a process. More... | |
| static void | __init_fpu (void) |
| Initialize the FPU. | |
| static void | __invalid_op (pt_regs *f) |
| static void | __sigfpe_handler (pt_regs *f) |
| static int | __fpu_test (void) |
| Ensure basic FPU functionality works. More... | |
| void | switch_fpu (void) |
| Called during a context switch to save the FPU registers status of the currently running thread. | |
| void | unswitch_fpu (void) |
| Called during a context switch to load the FPU registers status of the currently running thread inside the FPU. | |
| int | fpu_install (void) |
| Enable the FPU context handling. More... | |
Variables | |
| task_struct * | thread_using_fpu = NULL |
| Pointerst to the current thread using the FPU. | |
| uint8_t saves[512] | _syscall0 = _syscall0( (aligned(16)) )= _syscall1( (aligned(16)) )= _syscall2( (aligned(16)) )= _syscall3( (aligned(16)) )= |
| Temporary aligned buffer for copying around FPU contexts. | |
Floating Point Unit (FPU).
|
static |
Ensure basic FPU functionality works.
For processors without a FPU, this tests that maths libraries link correctly.
|
inlinestatic |
Kernel trap for FPU usage when FPU is disabled.
| f | The interrupt stack frame. |
|
inlinestatic |
Restore the FPU for a process.
| proc | the process for which we are restoring the FPU registers. |
|
inlinestatic |
Save the FPU for a process.
| proc | the process for which we are saving the FPU registers. |
|
inlinestatic |
Set the FPU control word.
| cw | What to set the control word to. |
|
inlinestatic |
Kernel trap for various integer and floating-point errors
| f | The interrupt stack frame. |