Bug 2554

Summary: DRM fails to compile on i386
Product: Drivers Reporter: Denis Pilon (dpilon)
Component: Video(DRI - non Intel)Assignee: Dave Airlie (airlied)
Status: REJECTED WILL_NOT_FIX    
Severity: normal    
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.4.26 Subsystem:
Regression: --- Bisected commit-id:

Description Denis Pilon 2004-04-20 20:08:01 UTC
Since http://bugzilla.kernel.org/show_bug.cgi?id=2391 changed the cmpxchg 
define, drivers/char/drm/drmP.h fails when compiling drm for i386, as it define 
its own cmpxchg function for i386.
Comment 1 Denis Pilon 2004-04-20 20:09:40 UTC
The following patch removes the i386 cmpxchg from being defined again:

diff -Nur linux-2.4.26/drivers/char/drm/drmP.h linux-
2.4.26.patched/drivers/char/drm/drmP.h
--- linux-2.4.26/drivers/char/drm/drmP.h        Wed Feb 18 08:36:31 2004
+++ linux-2.4.26.patched/drivers/char/drm/drmP.h        Tue Apr 20 13:10:47 2004
@@ -173,39 +173,7 @@
      (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_,          \
                                    (unsigned long)_n_, sizeof(*(ptr))); \
   })
-
-#elif __i386__
-static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
-                                     unsigned long new, int size)
-{
-       unsigned long prev;
-       switch (size) {
-       case 1:
-               __asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2"
-                                    : "=a"(prev)
-                                    : "q"(new), "m"(*__xg(ptr)), "0"(old)
-                                    : "memory");
-               return prev;
-       case 2:
-               __asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2"
-                                    : "=a"(prev)
-                                    : "q"(new), "m"(*__xg(ptr)), "0"(old)
-                                    : "memory");
-               return prev;
-       case 4:
-               __asm__ __volatile__(LOCK_PREFIX "cmpxchgl %1,%2"
-                                    : "=a"(prev)
-                                    : "q"(new), "m"(*__xg(ptr)), "0"(old)
-                                    : "memory");
-               return prev;
-       }
-       return old;
-}
-
-#define cmpxchg(ptr,o,n)                                               \
-  ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),             \
-                                (unsigned long)(n),sizeof(*(ptr))))
-#endif /* i386 & alpha */
+#endif /* alpha */
 #endif
 #define __REALLY_HAVE_SG       (__HAVE_SG)

Comment 2 Dave Airlie 2005-06-04 21:22:42 UTC
this is a 2.4 only problem

I doubt it'll ever get fixed in 2.4 unless someone really cares..