/* Compute powers of two for the given integer. */
static inline int floor_log2(unsigned long word)
{
+--- linux-2.4.26/drivers/char/drm/drmP.h.org 2004-04-19 02:52:58.034427096 +0200
++++ linux-2.4.26/drivers/char/drm/drmP.h 2004-04-19 02:53:24.323430560 +0200
+@@ -105,108 +105,6 @@
+ defined(CONFIG_AGP_MODULE)))
+ #define __REALLY_HAVE_MTRR (__HAVE_MTRR && defined(CONFIG_MTRR))
+
+-
+- /* Generic cmpxchg added in 2.3.x */
+-#ifndef __HAVE_ARCH_CMPXCHG
+- /* Include this here so that driver can be
+- used with older kernels. */
+-#if defined(__alpha__)
+-static __inline__ unsigned long
+-__cmpxchg_u32(volatile int *m, int old, int new)
+-{
+- unsigned long prev, cmp;
+-
+- __asm__ __volatile__(
+- "1: ldl_l %0,%2\n"
+- " cmpeq %0,%3,%1\n"
+- " beq %1,2f\n"
+- " mov %4,%1\n"
+- " stl_c %1,%2\n"
+- " beq %1,3f\n"
+- "2: mb\n"
+- ".subsection 2\n"
+- "3: br 1b\n"
+- ".previous"
+- : "=&r"(prev), "=&r"(cmp), "=m"(*m)
+- : "r"((long) old), "r"(new), "m"(*m));
+-
+- return prev;
+-}
+-
+-static __inline__ unsigned long
+-__cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new)
+-{
+- unsigned long prev, cmp;
+-
+- __asm__ __volatile__(
+- "1: ldq_l %0,%2\n"
+- " cmpeq %0,%3,%1\n"
+- " beq %1,2f\n"
+- " mov %4,%1\n"
+- " stq_c %1,%2\n"
+- " beq %1,3f\n"
+- "2: mb\n"
+- ".subsection 2\n"
+- "3: br 1b\n"
+- ".previous"
+- : "=&r"(prev), "=&r"(cmp), "=m"(*m)
+- : "r"((long) old), "r"(new), "m"(*m));
+-
+- return prev;
+-}
+-
+-static __inline__ unsigned long
+-__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
+-{
+- switch (size) {
+- case 4:
+- return __cmpxchg_u32(ptr, old, new);
+- case 8:
+- return __cmpxchg_u64(ptr, old, new);
+- }
+- return old;
+-}
+-#define cmpxchg(ptr,o,n) \
+- ({ \
+- __typeof__(*(ptr)) _o_ = (o); \
+- __typeof__(*(ptr)) _n_ = (n); \
+- (__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
+ #define __REALLY_HAVE_SG (__HAVE_SG)
+
+ /* Begin the DRM...