summaryrefslogtreecommitdiffstats
path: root/system/virtualbox-kernel/kernel_4.17.patch
diff options
context:
space:
mode:
author Matteo Bernardini2019-09-14 07:57:43 +0200
committer Matteo Bernardini2019-09-14 07:57:43 +0200
commitde40343a1db85e9c173db1c195923e0157d93cfe (patch)
tree72c35cdc13e9823bcfb4d26866f4b97b1440420b /system/virtualbox-kernel/kernel_4.17.patch
parent50b7e832ae3d4c1f51d3d0e93ab9face1a8d036d (diff)
downloadslackbuilds-de40343a1db85e9c173db1c195923e0157d93cfe.tar.gz
20190914.1 global branch merge.current-20190914.1
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'system/virtualbox-kernel/kernel_4.17.patch')
-rw-r--r--system/virtualbox-kernel/kernel_4.17.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/system/virtualbox-kernel/kernel_4.17.patch b/system/virtualbox-kernel/kernel_4.17.patch
new file mode 100644
index 0000000000..007bf737f2
--- /dev/null
+++ b/system/virtualbox-kernel/kernel_4.17.patch
@@ -0,0 +1,32 @@
+In kernel 4.17, pci_get_bus_and_slot() has been removed in favor of
+pci_get_domain_bus_and_slot(). It appears that VirtualBox only uses
+domain number 0, thus pci_get_domain_bus_and_slot(0, bus, devfn)
+is a suitable replacement for pci_get_bus_and_slot(bus, devfn).
+
+The resulting code compiles; however, I do not use PCI passthru, which
+I think means that I have not actually tested the code.
+
+This patch released under a combined MIT/GPLv2 license.
+
+Shamelessly copied by the patch from Larry Finger.
+
+Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
+
+diff -Naur virtualbox-kernel-5.2.8.orig/vboxpci/linux/VBoxPci-linux.c virtualbox-kernel-5.2.8/vboxpci/linux/VBoxPci-linux.c
+--- virtualbox-kernel-5.2.8.orig/vboxpci/linux/VBoxPci-linux.c 2018-03-14 20:33:31.000000000 +0100
++++ virtualbox-kernel-5.2.8/vboxpci/linux/VBoxPci-linux.c 2019-04-16 23:18:10.607698000 +0200
+@@ -89,7 +89,14 @@
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
+ # define PCI_DEV_GET(v,d,p) pci_get_device(v,d,p)
+ # define PCI_DEV_PUT(x) pci_dev_put(x)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
++/* assume the domain number to be zero - exactly the same assumption of
++* pci_get_bus_and_slot()
++*/
++# define PCI_DEV_GET_SLOT(bus, devfn) pci_get_domain_bus_and_slot(0, bus, devfn)
++#else
+ # define PCI_DEV_GET_SLOT(bus, devfn) pci_get_bus_and_slot(bus, devfn)
++#endif
+ #else
+ # define PCI_DEV_GET(v,d,p) pci_find_device(v,d,p)
+ # define PCI_DEV_PUT(x) do { } while (0)