enable_fpu_exception() - only write cr0 if bit isn't already on.
(NMI profiling results indicate this both is relatively expensive and happens a lot unnecessarily if the fpu is in use.)
This commit is contained in:
parent
b0572bfd1e
commit
82d576c9ca
1 changed files with 3 additions and 1 deletions
|
@ -285,7 +285,9 @@ PUBLIC void proc_stacktrace(struct proc *whichproc)
|
|||
|
||||
PUBLIC void enable_fpu_exception(void)
|
||||
{
|
||||
write_cr0(read_cr0() | I386_CR0_TS);
|
||||
u32_t cr0 = read_cr0();
|
||||
if(!(cr0 & I386_CR0_TS))
|
||||
write_cr0(cr0 | I386_CR0_TS);
|
||||
}
|
||||
|
||||
PUBLIC void disable_fpu_exception(void)
|
||||
|
|
Loading…
Reference in a new issue