Skip to content

Instantly share code, notes, and snippets.

@evilJazz
Last active July 30, 2018 08:47
Show Gist options
  • Save evilJazz/291796d2fd6fe32fe822dc1b3346dc95 to your computer and use it in GitHub Desktop.
Save evilJazz/291796d2fd6fe32fe822dc1b3346dc95 to your computer and use it in GitHub Desktop.
Patch for VirtualBox 5.2.8/5.2.10 modules to compile against Linux Kernel 4.17
--- /original/VBoxPci-linux.c
+++ /patched/VBoxPci-linux.c
@@ -89,7 +89,11 @@
#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)
-# define PCI_DEV_GET_SLOT(bus, devfn) pci_get_bus_and_slot(bus, devfn)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 16, 0)
+ # 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)
@sera5-dev
Copy link

how to apply them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment