We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd2a46b commit 38a93d9Copy full SHA for 38a93d9
include/os/freebsd/spl/sys/simd_powerpc.h
@@ -49,11 +49,18 @@
49
50
#include <machine/pcb.h>
51
#include <machine/cpu.h>
52
+#include <machine/fpu.h>
53
-#define kfpu_allowed() 0
54
+#define kfpu_allowed() 1
55
#define kfpu_initialize(tsk) do {} while (0)
-#define kfpu_begin() do {} while (0)
56
-#define kfpu_end() do {} while (0)
+#define kfpu_begin() { \
57
+ if (__predict_false(!is_fpu_kern_thread(0))) \
58
+ fpu_kern_enter(PCPU_GET(curthread), NULL, FPU_KERN_NOCTX);\
59
+}
60
+#define kfpu_end() { \
61
+ if (__predict_false(PCPU_GET(curpcb)->pcb_flags & PCB_KERN_FPU_NOSAVE))\
62
+ fpu_kern_leave(PCPU_GET(curthread), NULL); \
63
64
#define kfpu_init() (0)
65
#define kfpu_fini() do {} while (0)
66
0 commit comments