[PATCH 1/2] Refactor: module: sys_funcs.c: create a init_fpu() define for kernels 4.1 and up

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is done in preparation for kernel 4.14 where the name of the function
changed again.
---
 module/sys_funcs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/module/sys_funcs.c b/module/sys_funcs.c
index 7d5282f..6676463 100644
--- a/module/sys_funcs.c
+++ b/module/sys_funcs.c
@@ -53,6 +53,10 @@
 #include <asm-generic/set_memory.h>
 #endif
 
+#if LINUX_VERSION_CODE > KERNEL_VERSION(4,2,0)
+#define init_fpu(current)	fpu__activate_curr(&current->thread.fpu);
+#endif
+
 #include <hvx_ioctls.h>
 #include <hvx_host_iface.h>
 #include <hvx_version.h>
@@ -1215,12 +1219,8 @@ static void hvx_cpu_ioctl_prerun(struct hvx_iface_cpu *cpu_iface)
 
 	pr_debug("CPU-%d: start prerun\n", hvx_run->cpu_id);
 
-#if LINUX_VERSION_CODE > KERNEL_VERSION(4,2,0)
-	fpu__activate_curr(&current->thread.fpu);
-#else
 	/* Save host FPU state and set cr0.ts */
 	init_fpu(current);
-#endif
 
 	/* Make sure host doesn't run with cr4.pge bit set */
 	BUG_ON(native_read_cr4() & X86_CR4_PGE);
-- 
1.9.1




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux