diff -u ./drmP.h /tmp/fglrx-install.k5lxSp/common/lib/modules/fglrx/build_mod/drmP.h --- ./drmP.h 2010-04-07 17:33:36.000000000 +0200 +++ /tmp/fglrx-install.k5lxSp/common/lib/modules/fglrx/build_mod/drmP.h 2010-04-10 16:57:14.000000000 +0200 @@ -42,7 +42,11 @@ * can build the DRM (part of PI DRI). 4/21/2000 S + B */ #include #endif /* __alpha__ */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) +#include +#else #include +#endif #include #include #include diff -u ./firegl_public.c /tmp/fglrx-install.k5lxSp/common/lib/modules/fglrx/build_mod/firegl_public.c --- ./firegl_public.c 2010-04-07 17:33:36.000000000 +0200 +++ /tmp/fglrx-install.k5lxSp/common/lib/modules/fglrx/build_mod/firegl_public.c 2010-04-10 16:55:24.000000000 +0200 @@ -26,9 +26,11 @@ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) #error Kernel versions older than 2.6.0 are no longer supported by this module. -#endif - +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) +#include +#else #include +#endif #if !defined(CONFIG_X86) #if !defined(CONFIG_X86_PC) @@ -162,9 +164,13 @@ #endif // For 2.6.18 or higher, the UTS_RELEASE is defined in the linux/utsrelease.h. -#ifndef UTS_RELEASE +#ifndef UTS_RELEASE +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) +#include +#else #include #endif +#endif #if defined(__i386__) #ifndef do_div @@ -1470,7 +1470,16 @@ #ifndef __HAVE_ARCH_CMPXCHG return __fgl_cmpxchg(ptr,old,new,size); #else - return __cmpxchg(ptr,old,new,size); + switch (size) { + case 1: { volatile u8 *_ptr = ptr; return cmpxchg(_ptr, old, new); } + case 2: { volatile u16 *_ptr = ptr; return cmpxchg(_ptr, old, new); } + case 4: { volatile u32 *_ptr = ptr; return cmpxchg(_ptr, old, new); } +#ifdef __x86_64__ + case 8: { volatile u64 *_ptr = ptr; return cmpxchg(_ptr, old, new); } +#endif + default: + return old; + } #endif } diff -u ./kcl_acpi.c /tmp/fglrx-install.k5lxSp/common/lib/modules/fglrx/build_mod/kcl_acpi.c --- ./kcl_acpi.c 2010-04-07 17:33:36.000000000 +0200 +++ /tmp/fglrx-install.k5lxSp/common/lib/modules/fglrx/build_mod/kcl_acpi.c 2010-04-10 16:59:45.000000000 +0200 @@ -15,7 +15,11 @@ ****************************************************************************/ #include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) +#include +#else #include +#endif #include #include diff -u ./kcl_agp.c /tmp/fglrx-install.k5lxSp/common/lib/modules/fglrx/build_mod/kcl_agp.c --- ./kcl_agp.c 2010-04-07 17:33:36.000000000 +0200 +++ /tmp/fglrx-install.k5lxSp/common/lib/modules/fglrx/build_mod/kcl_agp.c 2010-04-10 17:00:12.000000000 +0200 @@ -31,7 +31,11 @@ */ #include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) +#include +#else #include +#endif #include #include #include diff -u ./kcl_io.c /tmp/fglrx-install.k5lxSp/common/lib/modules/fglrx/build_mod/kcl_io.c --- ./kcl_io.c 2010-04-07 17:33:36.000000000 +0200 +++ /tmp/fglrx-install.k5lxSp/common/lib/modules/fglrx/build_mod/kcl_io.c 2010-04-10 17:00:40.000000000 +0200 @@ -37,7 +37,11 @@ */ #include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) +#include +#else #include +#endif #include #include #include diff -u ./kcl_osconfig.h /tmp/fglrx-install.k5lxSp/common/lib/modules/fglrx/build_mod/kcl_osconfig.h --- ./kcl_osconfig.h 2010-04-07 17:33:36.000000000 +0200 +++ /tmp/fglrx-install.k5lxSp/common/lib/modules/fglrx/build_mod/kcl_osconfig.h 2010-04-10 16:56:17.000000000 +0200 @@ -20,7 +20,12 @@ #define KCL_OSCONFIG_H #include + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) +#include +#else #include +#endif // Choose modern way to call 32-on-64 IOCTLs if configured in the kernel #if defined(CONFIG_COMPAT) && LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9) diff -u ./kcl_pci.c /tmp/fglrx-install.k5lxSp/common/lib/modules/fglrx/build_mod/kcl_pci.c --- ./kcl_pci.c 2010-04-07 17:33:36.000000000 +0200 +++ /tmp/fglrx-install.k5lxSp/common/lib/modules/fglrx/build_mod/kcl_pci.c 2010-04-10 17:00:54.000000000 +0200 @@ -31,7 +31,11 @@ */ #include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) +#include +#else #include +#endif #include #include "kcl_config.h" diff -u ./kcl_str.c /tmp/fglrx-install.k5lxSp/common/lib/modules/fglrx/build_mod/kcl_str.c --- ./kcl_str.c 2010-04-07 17:33:36.000000000 +0200 +++ /tmp/fglrx-install.k5lxSp/common/lib/modules/fglrx/build_mod/kcl_str.c 2010-04-10 17:01:50.000000000 +0200 @@ -30,7 +30,12 @@ * */ +#include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) +#include +#else #include +#endif #include #include diff -u ./kcl_wait.c /tmp/fglrx-install.k5lxSp/common/lib/modules/fglrx/build_mod/kcl_wait.c --- ./kcl_wait.c 2010-04-07 17:33:36.000000000 +0200 +++ /tmp/fglrx-install.k5lxSp/common/lib/modules/fglrx/build_mod/kcl_wait.c 2010-04-10 17:01:44.000000000 +0200 @@ -31,7 +31,11 @@ */ #include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) +#include +#else #include +#endif #include #include #include diff -u ./make.sh /tmp/fglrx-install.k5lxSp/common/lib/modules/fglrx/build_mod/make.sh --- ./make.sh 2010-04-07 17:33:36.000000000 +0200 +++ /tmp/fglrx-install.k5lxSp/common/lib/modules/fglrx/build_mod/make.sh 2010-04-10 16:52:02.000000000 +0200 @@ -218,8 +218,13 @@ # UTS-define is in external version-*.h files, i.e. linux-2.2.14-5.0-RedHat does this flaw kernel_release=`cat $linuxincludes/linux/version-*.h | grep UTS_RELEASE | grep \"$OsRelease\" | cut -d'"' -f2` else - # For 2.6.18 or higher, UTS-define is defined in utsrelease.h. - kernel_release=`cat $linuxincludes/linux/utsrelease.h | grep UTS_RELEASE | grep \"$OsRelease\" | cut -d'"' -f2` + # For 2.6.18 to 2.6.32.11, UTS-define is defined in linux/utsrelease.h. + # For 2.6.33 or higer, UTS-define is defined in generated/utsrelease.h. + if [ -f $linuxincludes/generated/utsrelease.h ]; then + kernel_release=`cat $linuxincludes/generated/utsrelease.h | grep UTS_RELEASE | grep \"$OsRelease\" | cut -d'"' -f2` + else + kernel_release=`cat $linuxincludes/linux/utsrelease.h | grep UTS_RELEASE | grep \"$OsRelease\" | cut -d'"' -f2` + fi fi fi fi @@ -302,7 +307,12 @@ # 3 # linux/autoconf.h may contain this: #define CONFIG_SMP 1 -src_file=$linuxincludes/linux/autoconf.h +# For 2.6.33 or higher autoconf.h is under generated/ +if [ -f $linuxincludes/generated/autoconf.h ]; then + src_file=$linuxincludes/generated/autoconf.h +else + src_file=$linuxincludes/linux/autoconf.h +fi if [ ! -e $src_file ]; then echo "Warning:" >> $logfile @@ -355,7 +365,13 @@ MODVERSIONS=0 # linux/autoconf.h may contain this: #define CONFIG_MODVERSIONS 1 -src_file=$linuxincludes/linux/autoconf.h +# For 2.6.33 or higher autoconf.h is under generated/ +if [ -f $linuxincludes/generated/autoconf.h ]; then + src_file=$linuxincludes/generated/autoconf.h +else + src_file=$linuxincludes/linux/autoconf.h +fi + if [ ! -e $src_file ]; then echo "Warning:" >> $logfile