Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F171647305
D39448.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D39448.diff
View Options
diff --git a/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd_aarch64.h b/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd_aarch64.h
--- a/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd_aarch64.h
+++ b/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd_aarch64.h
@@ -44,13 +44,39 @@
#define _FREEBSD_SIMD_AARCH64_H
#include <sys/types.h>
+#include <sys/ucontext.h>
#include <machine/elf.h>
+#include <machine/fpu.h>
#include <machine/md_var.h>
+#include <machine/pcb.h>
+
+#ifdef _STANDALONE
#define kfpu_allowed() 0
-#define kfpu_initialize(tsk) do {} while (0)
#define kfpu_begin() do {} while (0)
#define kfpu_end() do {} while (0)
+
+#else
+
+/*
+ * XXX kfpu_allowed() should be 1, but this is pending a fix to the BLAKE3
+ * generated assembly to avoid clobbering x18. Turn it back on after that
+ * lands.
+ */
+#define kfpu_allowed() 0
+#define kfpu_begin() do { \
+ if (__predict_false(!is_fpu_kern_thread(0))) \
+ fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX); \
+} while(0)
+
+#define kfpu_end() do { \
+ if (__predict_false(curthread->td_pcb->pcb_fpflags & PCB_FP_NOSAVE)) \
+ fpu_kern_leave(curthread, NULL); \
+} while(0)
+
+#endif
+
+#define kfpu_initialize(tsk) do {} while (0)
#define kfpu_init() (0)
#define kfpu_fini() do {} while (0)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Sep 13, 10:25 AM (5 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38848749
Default Alt Text
D39448.diff (1 KB)
Attached To
Mode
D39448: openzfs: arm64: implement kfpu_begin/kfpu_end
Attached
Detach File
Event Timeline
Log In to Comment