source: pkg/frankie/non-free/fglrx-driver/trunk/debian/patches/05_fix_cmpxchg.diff @ 6577

Revision 6577, 8.8 KB checked in by alanbach-guest, 4 years ago (diff)
  • Sync'd with Debian 1:10-4-1
  • common/lib/modules/fglrx/build_mod/drmP.h

    # Fix broken usage of internal macro; fixes compiling with 2.6.33
    
    diff -Naur fglrx-driver-10-4.orig//common/lib/modules/fglrx/build_mod/drmP.h fglrx-driver-10-4/common/lib/modules/fglrx/build_mod/drmP.h
    old new  
    4242 * can build the DRM (part of PI DRI). 4/21/2000 S + B */ 
    4343#include <asm/current.h> 
    4444#endif /* __alpha__ */ 
     45#include <linux/version.h> 
     46#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) 
     47#include <generated/autoconf.h> 
     48#else 
    4549#include <linux/autoconf.h> 
     50#endif 
    4651#include <linux/module.h> 
    4752#include <linux/kernel.h> 
    4853#include <linux/miscdevice.h> 
     
    5156#include <linux/init.h> 
    5257#include <linux/file.h> 
    5358#include <linux/pci.h> 
    54 #include <linux/version.h> 
    5559#include <linux/sched.h> 
    5660#include <linux/smp_lock.h>     /* For (un)lock_kernel */ 
    5761#include <linux/mm.h> 
  • common/lib/modules/fglrx/build_mod/firegl_public.c

    diff -Naur fglrx-driver-10-4.orig//common/lib/modules/fglrx/build_mod/firegl_public.c fglrx-driver-10-4/common/lib/modules/fglrx/build_mod/firegl_public.c
    old new  
    2828#error Kernel versions older than 2.6.0 are no longer supported by this module. 
    2929#endif  
    3030 
     31#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) 
     32#include <generated/autoconf.h> 
     33#else 
    3134#include <linux/autoconf.h> 
     35#endif 
    3236 
    3337#if !defined(CONFIG_X86)  
    3438#if !defined(CONFIG_X86_PC)  
     
    165169 
    166170//  For 2.6.18 or higher, the UTS_RELEASE is defined in the linux/utsrelease.h.  
    167171#ifndef UTS_RELEASE  
     172#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) 
     173#include <generated/utsrelease.h> 
     174#else 
    168175#include <linux/utsrelease.h> 
    169176#endif 
     177#endif 
    170178 
    171179#if defined(__i386__) 
    172180#ifndef do_div 
     
    14721480#ifndef __HAVE_ARCH_CMPXCHG 
    14731481    return __fgl_cmpxchg(ptr,old,new,size); 
    14741482#else 
    1475     return __cmpxchg(ptr,old,new,size); 
     1483    switch (size) { 
     1484    case 1: { volatile u8 *_ptr = ptr; return cmpxchg(_ptr, old, new); } 
     1485    case 2: { volatile u16 *_ptr = ptr; return cmpxchg(_ptr, old, new); } 
     1486    case 4: { volatile u32 *_ptr = ptr; return cmpxchg(_ptr, old, new); } 
     1487#ifdef __x86_64__ 
     1488    case 8: { volatile u64 *_ptr = ptr; return cmpxchg(_ptr, old, new); } 
     1489#endif 
     1490    default: 
     1491        return old; 
     1492    } 
    14761493#endif 
    14771494} 
    14781495 
  • common/lib/modules/fglrx/build_mod/kcl_acpi.c

    diff -Naur fglrx-driver-10-4.orig//common/lib/modules/fglrx/build_mod/kcl_acpi.c fglrx-driver-10-4/common/lib/modules/fglrx/build_mod/kcl_acpi.c
    old new  
    1515 ****************************************************************************/ 
    1616 
    1717#include <linux/version.h> 
     18#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) 
     19#include <generated/autoconf.h> 
     20#else 
    1821#include <linux/autoconf.h> 
     22#endif 
    1923#include <linux/acpi.h> 
    2024#include <linux/pci.h> 
    2125 
  • common/lib/modules/fglrx/build_mod/kcl_agp.c

    diff -Naur fglrx-driver-10-4.orig//common/lib/modules/fglrx/build_mod/kcl_agp.c fglrx-driver-10-4/common/lib/modules/fglrx/build_mod/kcl_agp.c
    old new  
    3131 */ 
    3232 
    3333#include <linux/version.h> 
     34#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) 
     35#include <generated/autoconf.h> 
     36#else 
    3437#include <linux/autoconf.h> 
     38#endif 
    3539#include <linux/pci.h> 
    3640#include <linux/agp_backend.h> 
    3741#include <linux/string.h> 
  • common/lib/modules/fglrx/build_mod/kcl_io.c

    diff -Naur fglrx-driver-10-4.orig//common/lib/modules/fglrx/build_mod/kcl_io.c fglrx-driver-10-4/common/lib/modules/fglrx/build_mod/kcl_io.c
    old new  
    3737 */ 
    3838 
    3939#include <linux/version.h> 
     40#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) 
     41#include <generated/autoconf.h> 
     42#else 
    4043#include <linux/autoconf.h> 
     44#endif 
    4145#include <linux/poll.h> 
    4246#include <linux/signal.h> 
    4347#include <asm/io.h> 
  • common/lib/modules/fglrx/build_mod/kcl_osconfig.h

    diff -Naur fglrx-driver-10-4.orig//common/lib/modules/fglrx/build_mod/kcl_osconfig.h fglrx-driver-10-4/common/lib/modules/fglrx/build_mod/kcl_osconfig.h
    old new  
    2020#define KCL_OSCONFIG_H 
    2121 
    2222#include <linux/version.h> 
     23#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) 
     24#include <generated/autoconf.h> 
     25#else 
    2326#include <linux/autoconf.h> 
     27#endif 
    2428 
    2529// Choose modern way to call 32-on-64 IOCTLs if configured in the kernel 
    2630#if defined(CONFIG_COMPAT) && LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9) 
  • common/lib/modules/fglrx/build_mod/kcl_pci.c

    diff -Naur fglrx-driver-10-4.orig//common/lib/modules/fglrx/build_mod/kcl_pci.c fglrx-driver-10-4/common/lib/modules/fglrx/build_mod/kcl_pci.c
    old new  
    3131 */ 
    3232 
    3333#include <linux/version.h> 
     34#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) 
     35#include <generated/autoconf.h> 
     36#else 
    3437#include <linux/autoconf.h> 
     38#endif 
    3539#include <linux/pci.h> 
    3640 
    3741#include "kcl_config.h" 
  • common/lib/modules/fglrx/build_mod/kcl_str.c

    diff -Naur fglrx-driver-10-4.orig//common/lib/modules/fglrx/build_mod/kcl_str.c fglrx-driver-10-4/common/lib/modules/fglrx/build_mod/kcl_str.c
    old new  
    3030 * 
    3131 */ 
    3232 
     33#include <linux/version.h> 
     34#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) 
     35#include <generated/autoconf.h> 
     36#else 
    3337#include <linux/autoconf.h> 
     38#endif 
    3439#include <linux/string.h> 
    3540#include <linux/module.h> 
    3641 
  • common/lib/modules/fglrx/build_mod/kcl_wait.c

    diff -Naur fglrx-driver-10-4.orig//common/lib/modules/fglrx/build_mod/kcl_wait.c fglrx-driver-10-4/common/lib/modules/fglrx/build_mod/kcl_wait.c
    old new  
    3131 */ 
    3232 
    3333#include <linux/version.h> 
     34#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) 
     35#include <generated/autoconf.h> 
     36#else 
    3437#include <linux/autoconf.h> 
     38#endif 
    3539#include <linux/wait.h> 
    3640#include <linux/highmem.h> 
    3741#include <linux/sched.h> 
  • common/lib/modules/fglrx/build_mod/make.sh

    diff -Naur fglrx-driver-10-4.orig//common/lib/modules/fglrx/build_mod/make.sh fglrx-driver-10-4/common/lib/modules/fglrx/build_mod/make.sh
    old new  
    218218        # UTS-define is in external version-*.h files, i.e. linux-2.2.14-5.0-RedHat does this flaw 
    219219        kernel_release=`cat $linuxincludes/linux/version-*.h | grep UTS_RELEASE | grep \"$OsRelease\" | cut -d'"' -f2`  
    220220    else 
    221         # For 2.6.18 or higher, UTS-define is defined in utsrelease.h. 
    222         kernel_release=`cat $linuxincludes/linux/utsrelease.h | grep UTS_RELEASE | grep \"$OsRelease\" | cut -d'"' -f2`  
     221        UTS_REL_COUNT=`cat $linuxincludes/generated/utsrelease.h 2>/dev/null | grep UTS_RELEASE -c` 
     222 
     223        if [ $UTS_REL_COUNT -gt 0 ]; then 
     224            # 2.6.33+ 
     225            kernel_release=`cat $linuxincludes/generated/utsrelease.h | grep UTS_RELEASE | grep \"$OsRelease\" | cut -d'"' -f2` 
     226        else 
     227            # For 2.6.18 to 2.6.32, UTS-define is defined in utsrelease.h. 
     228            kernel_release=`cat $linuxincludes/linux/utsrelease.h | grep UTS_RELEASE | grep \"$OsRelease\" | cut -d'"' -f2` 
     229        fi 
    223230    fi 
    224231  fi 
    225232fi 
     
    302309# 3 
    303310# linux/autoconf.h may contain this: #define CONFIG_SMP 1 
    304311 
    305 src_file=$linuxincludes/linux/autoconf.h 
     312src_file=$linuxincludes/generated/autoconf.h 
     313[ -e $src_file ] || src_file=$linuxincludes/linux/autoconf.h 
    306314 
    307315if [ ! -e $src_file ]; then 
    308316  echo "Warning:"                                                  >> $logfile 
     
    355363MODVERSIONS=0 
    356364 
    357365# linux/autoconf.h may contain this: #define CONFIG_MODVERSIONS 1 
    358 src_file=$linuxincludes/linux/autoconf.h 
     366src_file=$linuxincludes/generated/autoconf.h 
     367[ -e $src_file ] || src_file=$linuxincludes/linux/autoconf.h 
    359368if [ ! -e $src_file ]; 
    360369then 
    361370  echo "Warning:"                                                  >> $logfile 
Note: See TracBrowser for help on using the repository browser.