alarm/cryptodev-dkms to 1.8-2

This commit is contained in:
moonman 2016-05-30 13:19:19 -06:00
parent bf97e9dc95
commit 38e2a3a900
2 changed files with 50 additions and 3 deletions

View file

@ -5,7 +5,7 @@ _pkgname=${pkgname%-*}
cryptodev_commit=7a3a9ee1329f7224b4fc564b80ef8160457caf76
pkgver=1.8
pkgrel=1
pkgrel=2
pkgdesc="Cryptodev module to take advantage of hardware crypto engines in userspace"
arch=('arm' 'armv6h' 'armv7h' 'aarch64')
@ -15,9 +15,16 @@ depends=('dkms')
install=${pkgname}.install
provides=('cryptodev_friendly')
source=("cryptodev-${cryptodev_commit}.tar.gz::https://github.com/cryptodev-linux/cryptodev-linux/archive/${cryptodev_commit}.tar.gz"
'dkms.conf')
'dkms.conf'
'cryptodev_linux_4.6_fix.patch')
sha256sums=('4ed29c923506c2e25e7250cf5984f659a6a430548fe625092c6a2d5f55d2798a'
'8a4e7273cc8b9b62fddb86e8328b5a511fc6e92cefe7444d8aad45410b41be5f')
'8a4e7273cc8b9b62fddb86e8328b5a511fc6e92cefe7444d8aad45410b41be5f'
'271e8f0891f57e00f50c1dbb67edc6369e3b45eb850a79099cf50916f68cf723')
prepare() {
cd "${srcdir}/cryptodev-linux-${cryptodev_commit}"
patch -Np1 -i "${srcdir}/cryptodev_linux_4.6_fix.patch"
}
package() {
cd "${srcdir}"

View file

@ -0,0 +1,40 @@
From cdbe7ee5978704c788e91170467fe0db064650fe Mon Sep 17 00:00:00 2001
From: moonman <moonman.ca@gmail.com>
Date: Mon, 30 May 2016 03:23:17 -0600
Subject: [PATCH] fix build error on linux >= 4.6.0
---
zc.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/zc.c b/zc.c
index 29b0501..eabfab7 100644
--- a/zc.c
+++ b/zc.c
@@ -59,8 +59,12 @@ int __get_userbuf(uint8_t __user *addr, uint32_t len, int write,
}
down_read(&mm->mmap_sem);
- ret = get_user_pages(task, mm,
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
+ ret = get_user_pages((unsigned long)addr, pgcount, write, 0, pg, NULL);
+#else
+ ret = get_user_pages(task, mm,
(unsigned long)addr, pgcount, write, 0, pg, NULL);
+#endif
up_read(&mm->mmap_sem);
if (ret != pgcount)
return -EINVAL;
@@ -119,7 +123,11 @@ void release_user_pages(struct csession *ses)
else
ses->readonly_pages--;
- page_cache_release(ses->pages[i]);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
+ put_page(ses->pages[i]);
+#else
+ page_cache_release(ses->pages[i]);
+#endif
}
ses->used_pages = 0;
}