diff options
Diffstat (limited to 'arch/x86/include/asm/i387.h')
-rw-r--r-- | arch/x86/include/asm/i387.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h index 175adf58dd4f..fb7f0d64e14f 100644 --- a/arch/x86/include/asm/i387.h +++ b/arch/x86/include/asm/i387.h | |||
@@ -301,6 +301,14 @@ static inline void kernel_fpu_end(void) | |||
301 | preempt_enable(); | 301 | preempt_enable(); |
302 | } | 302 | } |
303 | 303 | ||
304 | static inline bool irq_fpu_usable(void) | ||
305 | { | ||
306 | struct pt_regs *regs; | ||
307 | |||
308 | return !in_interrupt() || !(regs = get_irq_regs()) || \ | ||
309 | user_mode(regs) || (read_cr0() & X86_CR0_TS); | ||
310 | } | ||
311 | |||
304 | /* | 312 | /* |
305 | * Some instructions like VIA's padlock instructions generate a spurious | 313 | * Some instructions like VIA's padlock instructions generate a spurious |
306 | * DNA fault but don't modify SSE registers. And these instructions | 314 | * DNA fault but don't modify SSE registers. And these instructions |