]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/x86/include/asm/i387.h
Merge branch 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / arch / x86 / include / asm / i387.h
index 2e7529295f5539fbeb2310c58939c370bc9edbe0..0b20bbb758f26594358f55c8ceb827dc2d35bdaf 100644 (file)
@@ -302,6 +302,14 @@ static inline void kernel_fpu_end(void)
        preempt_enable();
 }
 
+static inline bool irq_fpu_usable(void)
+{
+       struct pt_regs *regs;
+
+       return !in_interrupt() || !(regs = get_irq_regs()) || \
+               user_mode(regs) || (read_cr0() & X86_CR0_TS);
+}
+
 /*
  * Some instructions like VIA's padlock instructions generate a spurious
  * DNA fault but don't modify SSE registers. And these instructions