Comment 2 for bug 998486

Revision history for this message
Jurjen Stellingwerff (jurjen-stwerff) wrote :

The following patch made it compile again:
source-url http://phoronix.com/forums/showthread.php?68922-Patch-to-compile-fgrlx-module-on-Linux-3-3-rc4-with-x86-32-bit-arch/page2

diff --git a/firegl_public.c b/firegl_public.c
index a56fff1..b4bdfb7 100644
--- a/firegl_public.c
+++ b/firegl_public.c
@@ -187,6 +187,9 @@
 #include <linux/gfp.h>
 #include <linux/swap.h>
 #include "asm/i387.h"
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
+#include <asm/fpu-internal.h>
+#endif

 #include "firegl_public.h"
 #include "kcl_osconfig.h"
@@ -4181,7 +4184,11 @@ static int kasInitExecutionLevels(unsigned long level_init)
 {
     unsigned int p;
     KCL_DEBUG5(FN_FIREGL_KAS, "%d\n", level_init);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
+ for_each_cpu_mask(p, cpu_possible_mask)
+#else
     for_each_cpu_mask(p, cpu_possible_map)
+#endif
     {
         KCL_DEBUG1(FN_FIREGL_KAS,"Setting initial execution level for CPU # %d\n", p);
         preempt_disable();
@@ -5799,10 +5806,16 @@ void ATI_API_CALL KCL_fpu_begin(void)
 #ifdef CONFIG_X86_64
     kernel_fpu_begin();
 #else
+#ifndef TS_USEDFPU
+ preempt_disable();
+ if (__thread_has_fpu(current))
+ __save_init_fpu(current);
+#else
     struct thread_info *cur_task = current_thread_info();
     preempt_disable();
     if (cur_task->status & TS_USEDFPU)
         __save_init_fpu(cur_task->task);
+#endif
     else
         clts();
 #endif