Re: Fglrx too: 2.6.20 is a no-go

Dario Castellarin <[email protected]>
Newsgroups gmane.linux.freshrpms.user
Message-ID <[email protected]>
Now I see that livna needed this patch to make it build, dunno if it 
applies also to freshrpms'

Dario Castellarin ha scritto:
> Hello,
> also the ATI driver fails to build on the new 2.6.20 kernel, at least 
> on x86_64...
> Is there a build log I can check to see what goes wrong?
>
> Dario
>
fglrx-firegl_public_2.6.20.diff (text/x-patch, 2.7 KB)
--- firegl_public.c	2006-12-18 10:58:15.000000000 -0500
+++ firegl_public.c	2006-12-18 11:14:04.000000000 -0500
@@ -181,6 +181,70 @@
 int errno;
 #endif // __ia64__
 
+#if defined(__i386__)
+#define __syscall_return(type, res) \
+do { \
+        if ((unsigned long)(res) >= (unsigned long)(-(128 + 1))) { \
+                errno = -(res); \
+                res = -1; \
+        } \
+        return (type) (res); \
+} while (0)
+#define _syscall2(type,name,type1,arg1,type2,arg2) \
+type name(type1 arg1,type2 arg2) \
+{ \
+long __res; \
+__asm__ volatile ("push %%ebx ; movl %2,%%ebx ; int $0x80 ; pop %%ebx" \
+        : "=a" (__res) \
+        : "0" (__NR_##name),"ri" ((long)(arg1)),"c" ((long)(arg2)) \
+        : "memory"); \
+__syscall_return(type,__res); \
+}
+
+#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
+type name(type1 arg1,type2 arg2,type3 arg3) \
+{ \
+long __res; \
+__asm__ volatile ("push %%ebx ; movl %2,%%ebx ; int $0x80 ; pop %%ebx" \
+        : "=a" (__res) \
+        : "0" (__NR_##name),"ri" ((long)(arg1)),"c" ((long)(arg2)), \
+                  "d" ((long)(arg3)) : "memory"); \
+__syscall_return(type,__res); \
+}
+#elif defined(__x86_64__)
+#define __syscall_clobber "r11","rcx","memory" 
+#define __syscall "syscall"
+
+#define __syscall_return(type, res) \
+do { \
+        if ((unsigned long)(res) >= (unsigned long)(-127)) { \
+                errno = -(res); \
+                res = -1; \
+        } \
+        return (type) (res); \
+} while (0)
+#define _syscall2(type,name,type1,arg1,type2,arg2) \
+type name(type1 arg1,type2 arg2) \
+{ \
+long __res; \
+__asm__ volatile (__syscall \
+        : "=a" (__res) \
+        : "0" (__NR_##name),"D" ((long)(arg1)),"S" ((long)(arg2)) : __syscall_clobber ); \
+__syscall_return(type,__res); \
+}
+
+#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
+type name(type1 arg1,type2 arg2,type3 arg3) \
+{ \
+long __res; \
+__asm__ volatile (__syscall \
+        : "=a" (__res) \
+        : "0" (__NR_##name),"D" ((long)(arg1)),"S" ((long)(arg2)), \
+                  "d" ((long)(arg3)) : __syscall_clobber); \
+__syscall_return(type,__res); \
+}
+#endif
+
 // int mlock(const void *addr, size_t len);
 _syscall2(int, mlock, const void *, addr, size_t, len )
 // int munlock(const void *addr, size_t len);

--- firegl_public.c-orig	2007-01-21 23:09:10.027497362 -0600
+++ firegl_public.c	2007-01-21 23:09:25.219179776 -0600
@@ -5256,7 +5256,7 @@
     kasThread_t* thread_obj = (kasThread_t*)hThread;
     init_MUTEX(&(thread_obj->sleep_finished));
     init_waitqueue_head(&(thread_obj->wq_head));
-    INIT_WORK(&(thread_obj->work), routine, pcontext);
+    INIT_WORK(&(thread_obj->work), routine);
     schedule_work(&(thread_obj->work));
     return 1;
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.