[etherlab-dev] [PATCH]Support changed struct vm_fault from kernel 4.10
Patrick Brünn
P.Bruenn at beckhoff.com
Tue Jan 3 10:37:38 CET 2017
Hi list,
I want to share a small patch to compile etherlab for kernel 4.10-rc2.
Today, I stumbled upon the following error:
In file included from /tmp/build/ethercat-hg/master/cdev.c:42:0:
/tmp/build/ethercat-hg/master/cdev.c: In function 'eccdev_vma_fault':
/tmp/build/ethercat-hg/master/cdev.c:278:46: error: 'struct vm_fault' has no member named 'virtual_address'
" offset = %lu, page = %p\n", vmf->virtual_address, offset, page);
^
/tmp/build/ethercat-hg/master/master.h:115:38: note: in definition of macro 'EC_MASTER_DBG'
master->index, ##args); \
^~~~
I am not sure the inline patch will survive our mail server, so I attached it, too. If you prefer a bundle, you can find one here:
https://github.com/Beckhoff/CCAT/blob/master/etherlab.bundle
Regards, Patrick
# HG changeset patch
# User Patrick Bruenn <p.bruenn at beckhoff.com>
# Date 1483428925 -3600
# Tue Jan 03 08:35:25 2017 +0100
# Branch stable-1.5
# Node ID 2ce48dd8624ce9c9cc0994cc720d6e64254fb9a9
# Parent a1079c6242a5e8d0a294ec5706ea30ed5ea1bc0d
Support changed struct vm_fault from kernel 4.10.
vm_fault->virtual_address was renamed into vm_fault->address by
kernel commit 82b0f8c39a3869b6fd2a10e180a862248736ec6f
diff -r a1079c6242a5 -r 2ce48dd8624c master/cdev.c
--- a/master/cdev.c Tue Oct 18 10:20:47 2016 +0200
+++ b/master/cdev.c Tue Jan 03 08:35:25 2017 +0100
@@ -274,7 +274,11 @@
vmf->page = page;
EC_MASTER_DBG(priv->cdev->master, 1, "Vma fault, virtual_address = %p,"
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
+ " offset = %lu, page = %p\n", (void*)vmf->address, offset, page);
+#else
" offset = %lu, page = %p\n", vmf->virtual_address, offset, page);
+#endif
return 0;
}
---
Beckhoff Automation GmbH & Co. KG | Managing Director: Dipl. Phys. Hans Beckhoff
Registered office: Verl, Germany | Register court: Guetersloh HRA 7075
-------------- next part --------------
A non-text attachment was scrubbed...
Name: support-vm_fault-kernel-v4.10.patch
Type: application/octet-stream
Size: 944 bytes
Desc: support-vm_fault-kernel-v4.10.patch
URL: <http://lists.etherlab.org/pipermail/etherlab-dev/attachments/20170103/c61d1b51/attachment.obj>
More information about the etherlab-dev
mailing list