Bug 2554 - DRM fails to compile on i386
Summary: DRM fails to compile on i386
Status: REJECTED WILL_NOT_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Video(DRI - non Intel) (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Dave Airlie
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-20 20:08 UTC by Denis Pilon
Modified: 2005-06-04 21:22 UTC (History)
0 users

See Also:
Kernel Version: 2.4.26
Subsystem:
Regression: ---
Bisected commit-id:


Attachments

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.. 

Note You need to log in before you can comment on or make changes to this bug.