[arch-commits] Commit in nvidia-304xx/trunk (PKGBUILD nvidia-4.0.patch)
Felix Yan
fyan at archlinux.org
Mon Apr 13 09:02:02 UTC 2015
Date: Monday, April 13, 2015 @ 11:02:01
Author: fyan
Revision: 236351
upgpkg: nvidia-304xx 304.125-15
rebuild against linux 4.0-1
Added:
nvidia-304xx/trunk/nvidia-4.0.patch
Modified:
nvidia-304xx/trunk/PKGBUILD
------------------+
PKGBUILD | 27 +++++++++++++--------------
nvidia-4.0.patch | 28 ++++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 14 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2015-04-13 08:03:55 UTC (rev 236350)
+++ PKGBUILD 2015-04-13 09:02:01 UTC (rev 236351)
@@ -15,22 +15,20 @@
license=('custom')
install=nvidia.install
options=(!strip)
+source=("http://us.download.nvidia.com/XFree86/Linux-x86/${pkgver}/NVIDIA-Linux-x86-${pkgver}.run"
+ "http://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run"
+ 'nv-drm.patch'
+ 'nvidia-3.19.patch'
+ 'nvidia-4.0.patch')
+sha512sums=('cd77736790876b66c1e88bf30b7a93f755c0f94118edda8fde1701dc07dc4eb60f89a27b0ed432db74729f269cb239f32f3c5e045d701f60baf69da7fc0d0ea7'
+ '3b50d1353ff6cfee9042455b78e889c198e40dfe832dde79eda1a47d9f1f02b29f0161f1ac694dc7502eb2a94bad6b98244568cc353f387b02de6cae1c17d4ae'
+ 'aaa36ef7179acdc86850381de145a3aebab22273cd3c702a9d1343dc3415192c74a35da692312555f36193c5d46a1771ce07ea9508113cb9d0698873064aa19f'
+ 'f52a9f82a73eef9e27046c51ce0b2671ee2893f9b12e17c722f17416c39ac0b8d7d5b1fed51b6ab6f36670b036cd96d5cfeae37300ef041c029fd3d3d136ff3d'
+ 'd00a2a4c5bf38041cf9e4f61aa0ad0d6123451839eb272c36d7e466d77b33d90415cfa6f96a3a9da8688a1048e93a03169f808e6b2ddc2d9d148bab8485dae27')
-if [ "$CARCH" = "i686" ]; then
- _arch='x86'
- _pkg="NVIDIA-Linux-${_arch}-${pkgver}"
- source=("http://us.download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")
- md5sums=('bc3b0ac291fa998d5109a6f7e94fb2d4')
-elif [ "$CARCH" = "x86_64" ]; then
- _arch='x86_64'
- _pkg="NVIDIA-Linux-${_arch}-${pkgver}-no-compat32"
- source=("http://us.download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")
- md5sums=('291d41ccdbcc08f752a38f9e0a7eeea0')
-fi
+[[ "$CARCH" = "i686" ]] && _pkg="NVIDIA-Linux-x86-${pkgver}"
+[[ "$CARCH" = "x86_64" ]] && _pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"
-source+=('nv-drm.patch' 'nvidia-3.19.patch')
-md5sums+=('79671a27131da619a33eb02ed0c2c031' 'd14e651d20054d18e0360c157ae60ae4')
-
prepare() {
cd "${srcdir}"
sh "${_pkg}.run" --extract-only
@@ -38,6 +36,7 @@
# patches here
patch -p0 -i "$srcdir/nv-drm.patch"
patch -p1 -i "$srcdir/nvidia-3.19.patch"
+ patch -p0 -i "$srcdir/nvidia-4.0.patch"
}
build() {
Added: nvidia-4.0.patch
===================================================================
--- nvidia-4.0.patch (rev 0)
+++ nvidia-4.0.patch 2015-04-13 09:02:01 UTC (rev 236351)
@@ -0,0 +1,28 @@
+--- kernel/nv-pat.c~ 2015-02-22 20:39:43.889075396 -0800
++++ kernel/nv-pat.c 2015-02-22 20:29:33.519735577 -0800
+@@ -35,8 +35,13 @@
+ unsigned long cr0 = read_cr0();
+ write_cr0(((cr0 & (0xdfffffff)) | 0x40000000));
+ wbinvd();
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)
++ *cr4 = __read_cr4();
++ if (*cr4 & 0x80) __write_cr4(*cr4 & ~0x80);
++#else
+ *cr4 = read_cr4();
+ if (*cr4 & 0x80) write_cr4(*cr4 & ~0x80);
++#endif
+ __flush_tlb();
+ }
+
+@@ -46,7 +46,11 @@
+ wbinvd();
+ __flush_tlb();
+ write_cr0((cr0 & 0x9fffffff));
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)
++ if (cr4 & 0x80) __write_cr4(cr4);
++#else
+ if (cr4 & 0x80) write_cr4(cr4);
++#endif
+ }
+
+ static int nv_determine_pat_mode(void)
More information about the arch-commits
mailing list