From 4ac9855d4f829238871a9042e59a47e275d2adce Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 10 May 2015 08:41:25 +0200 Subject: [PATCH] catalyst: linux 4.0 support via AUR. --- .../catalyst/files/kolasa_4.0-cr4-strn.patch | 70 +++++++++++++++++++ srcpkgs/catalyst/template | 3 +- 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/catalyst/files/kolasa_4.0-cr4-strn.patch diff --git a/srcpkgs/catalyst/files/kolasa_4.0-cr4-strn.patch b/srcpkgs/catalyst/files/kolasa_4.0-cr4-strn.patch new file mode 100644 index 00000000000..7bce698bad3 --- /dev/null +++ b/srcpkgs/catalyst/files/kolasa_4.0-cr4-strn.patch @@ -0,0 +1,70 @@ +diff -uNr 14.12/common/lib/modules/fglrx/build_mod/firegl_public.c 14.12_2/common/lib/modules/fglrx/build_mod/firegl_public.c +--- 14.12/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-11-28 21:02:10.000000000 +0100 ++++ 14.12_2/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-03-08 13:30:42.565275902 +0100 +@@ -4468,8 +4468,13 @@ + + if (cpu_has_pge) + { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0) + cr4 = read_cr4(); + write_cr4(cr4 & ~X86_CR4_PGE); ++#else ++ cr4 = __read_cr4(); ++ __write_cr4(cr4 & ~X86_CR4_PGE); ++#endif + } + __flush_tlb(); + +@@ -4482,7 +4487,11 @@ + write_cr0(cr0 & 0xbfffffff); + if (cpu_has_pge) + { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0) + write_cr4(cr4); ++#else ++ __write_cr4(cr4); ++#endif + } + local_irq_restore(flags); + +@@ -4509,8 +4518,13 @@ + + if (cpu_has_pge) + { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0) + cr4 = read_cr4(); + write_cr4(cr4 & ~X86_CR4_PGE); ++#else ++ cr4 = __read_cr4(); ++ __write_cr4(cr4 & ~X86_CR4_PGE); ++#endif + } + __flush_tlb(); + +@@ -4522,7 +4536,11 @@ + write_cr0(cr0 & 0xbfffffff); + if (cpu_has_pge) + { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0) + write_cr4(cr4); ++#else ++ __write_cr4(cr4); ++#endif + } + local_irq_restore(flags); + +diff -uNr 14.12/common/lib/modules/fglrx/build_mod/kcl_str.c 14.12_2/common/lib/modules/fglrx/build_mod/kcl_str.c +--- 14.12/common/lib/modules/fglrx/build_mod/kcl_str.c 2014-11-28 21:02:10.000000000 +0100 ++++ 14.12_2/common/lib/modules/fglrx/build_mod/kcl_str.c 2015-03-08 13:25:11.568396701 +0100 +@@ -169,7 +169,11 @@ + const char* s2, + KCL_TYPE_SizeSigned count) + { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0) + return strnicmp(s1, s2, count); ++#else ++ return strncasecmp(s1, s2, count); ++#endif + } + + /** \brief Locate character in string diff --git a/srcpkgs/catalyst/template b/srcpkgs/catalyst/template index abd4d467686..cfe98731858 100644 --- a/srcpkgs/catalyst/template +++ b/srcpkgs/catalyst/template @@ -4,7 +4,7 @@ _distver="14.12" pkgname=catalyst version=14.501.1003 -revision=6 +revision=7 maintainer="Juan RP " license="Propietary AMD license" homepage="http://www.amd.com" @@ -39,6 +39,7 @@ do_build() { patch -Np1 -i ${FILESDIR}/fglrx_3.17rc6-no_hotplug.patch patch -Np1 -i ${FILESDIR}/lano1106_fglrx-13.8_proc.patch patch -Np1 -i ${FILESDIR}/kolasa-3.19-get_cpu_var.patch + patch -Np1 -i ${FILESDIR}/kolasa_4.0-cr4-strn.patch } do_install() { cd fglrx