--- /dev/null
+diff --git a/driver/linux/check_kernel_headers.sh b/driver/linux/check_kernel_headers.sh
+index b0b9b851c0a1..7afec9fae138 100755
+--- a/driver/linux/check_kernel_headers.sh
++++ b/driver/linux/check_kernel_headers.sh
+@@ -330,6 +330,19 @@ else
+ echo no
+ fi
+
++# timer_setup() added in v4.14-rc3
++echo -n " checking (in kernel headers) timer_setup() availability ... "
++if test -e ${LINUX_HDR}/include/linux/timer.h > /dev/null ; then
++ if grep timer_setup ${LINUX_HDR}/include/linux/timer.h > /dev/null ; then
++ echo "#define HAVE_TIMER_SETUP 1" >> ${TMP_CHECKS_NAME}
++ echo yes
++ else
++ echo no
++ fi
++else
++ echo no
++fi
++
+ # add the footer
+ echo "" >> ${TMP_CHECKS_NAME}
+ echo "#endif /* __knem_checks_h__ */" >> ${TMP_CHECKS_NAME}
+diff --git a/driver/linux/knem_main.c b/driver/linux/knem_main.c
+index e12aad3c0ea5..ddae2af14449 100644
+--- a/driver/linux/knem_main.c
++++ b/driver/linux/knem_main.c
+@@ -2610,9 +2610,17 @@ knem_kthread_func(void *data)
+
+ #ifdef KNEM_HAVE_DMA_ENGINE
+ static void
++#ifdef HAVE_TIMER_SETUP
++knem_dmacpy_cleanup_timer_handler(struct timer_list *t)
++#else
+ knem_dmacpy_cleanup_timer_handler(unsigned long data)
++#endif
+ {
++#ifdef HAVE_TIMER_SETUP
++ struct knem_context * ctx = from_timer(ctx, t, dmacpy_cleanup_timer);
++#else
+ struct knem_context * ctx = (void *) data;
++#endif
+
+ wake_up(&ctx->kthread_work_wq);
+ knem_counter_inc(DMACPY_CLEANUP_TIMEOUT);
+@@ -2665,7 +2673,11 @@ knem_miscdev_open(struct inode * inode, struct file * file)
+ if (ctx->dmacpy_chan) {
+ INIT_LIST_HEAD(&ctx->dmacpy_cleanup_work_list);
+ spin_lock_init(&ctx->dmacpy_cleanup_work_lock);
++#ifdef HAVE_TIMER_SETUP
++ timer_setup(&ctx->dmacpy_cleanup_timer, knem_dmacpy_cleanup_timer_handler, 0);
++#else
+ setup_timer(&ctx->dmacpy_cleanup_timer, knem_dmacpy_cleanup_timer_handler, (unsigned long) ctx);
++#endif
+ #if (defined CONFIG_NUMA) && (defined KNEM_HAVE_CPUMASK_OF_NODE)
+ {
+ int node = dev_to_node(ctx->dmacpy_chan->device->dev);
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-EAPI=5
+EAPI=6
inherit autotools linux-mod linux-info toolchain-funcs udev multilib
inherit git-2
KEYWORDS=""
else
- SRC_URI="http://runtime.bordeaux.inria.fr/knem/download/${P}.tar.gz"
+ SRC_URI="http://gforge.inria.fr/frs/download.php/37186/${P}.tar.gz"
KEYWORDS="~amd64 ~x86"
fi
BUILD_TARGETS="all"
BUILD_PARAMS="KDIR=${KERNEL_DIR}"
+PATCHES=( "${FILESDIR}/${P}-setup_timer.patch" )
+
pkg_setup() {
linux-info_pkg_setup
+ CONFIG_CHECK="DMA_ENGINE"
+ check_extra_config
linux-mod_pkg_setup
ARCH="$(tc-arch-kernel)"
ABI="${KERNEL_ABI}"
src_prepare() {
sed 's:driver/linux::g' -i Makefile.am
eautoreconf
+ default
}
src_configure() {
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-EAPI=5
+EAPI=6
inherit autotools linux-mod linux-info toolchain-funcs udev multilib
HOMEPAGE="http://runtime.bordeaux.inria.fr/knem/"
if [[ ${PV} == "9999" ]] ; then
EGIT_REPO_URI="https://gforge.inria.fr/git/knem/knem.git"
- inherit git-2
+ inherit git-r3
KEYWORDS=""
else
SRC_URI="http://runtime.bordeaux.inria.fr/knem/download/${P}.tar.gz"
src_prepare() {
sed 's:driver/linux::g' -i Makefile.am
eautoreconf
+ default
}
src_configure() {