Gentoo Archives: gentoo-commits

From: "Lars Wendler (polynomial-c)" <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-emulation/virtualbox-modules/files: virtualbox-modules-4.1.6-kernel-3.2-vboxpci.patch
Date: Sat, 03 Dec 2011 17:36:30
Message-Id: 20111203173618.F07882004B@flycatcher.gentoo.org
1 polynomial-c 11/12/03 17:36:18
2
3 Added: virtualbox-modules-4.1.6-kernel-3.2-vboxpci.patch
4 Log:
5 Fixed compilation with kernel-3.2 (bug #389953)
6
7 (Portage version: 2.2.0_alpha79/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 app-emulation/virtualbox-modules/files/virtualbox-modules-4.1.6-kernel-3.2-vboxpci.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/virtualbox-modules/files/virtualbox-modules-4.1.6-kernel-3.2-vboxpci.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/virtualbox-modules/files/virtualbox-modules-4.1.6-kernel-3.2-vboxpci.patch?rev=1.1&content-type=text/plain
14
15 Index: virtualbox-modules-4.1.6-kernel-3.2-vboxpci.patch
16 ===================================================================
17 https://bugs.gentoo.org/389953
18
19 --- vboxpci/linux/VBoxPci-linux.c
20 +++ vboxpci/linux/VBoxPci-linux.c
21 @@ -33,14 +33,22 @@
22 #include "VBoxPciInternal.h"
23
24 #ifdef VBOX_WITH_IOMMU
25 -#include <linux/dmar.h>
26 -#include <linux/intel-iommu.h>
27 -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0)
28 -# include <asm/amd_iommu.h>
29 -#else
30 -# include <linux/amd-iommu.h>
31 -#endif
32 -#endif
33 +# include <linux/dmar.h>
34 +# include <linux/intel-iommu.h>
35 +# include <linux/pci.h>
36 +# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0)
37 +# include <asm/amd_iommu.h>
38 +# else
39 +# include <linux/amd-iommu.h>
40 +# endif
41 +# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
42 +# define IOMMU_PRESENT() iommu_found()
43 +# define IOMMU_DOMAIN_ALLOC() iommu_domain_alloc()
44 +# else
45 +# define IOMMU_PRESENT() iommu_present(&pci_bus_type)
46 +# define IOMMU_DOMAIN_ALLOC() iommu_domain_alloc(&pci_bus_type)
47 +# endif
48 +#endif /* VBOX_WITH_IOMMU */
49
50
51 /*******************************************************************************
52 @@ -146,7 +154,7 @@
53 #endif
54
55 #ifdef VBOX_WITH_IOMMU
56 - if (iommu_found())
57 + if (IOMMU_PRESENT())
58 printk(KERN_INFO "vboxpci: IOMMU found\n");
59 else
60 printk(KERN_INFO "vboxpci: IOMMU not found (not registered)\n");
61 @@ -984,9 +992,9 @@
62 printk(KERN_DEBUG "vboxPciOsInitVm: %p\n", pThis);
63 #endif
64 #ifdef VBOX_WITH_IOMMU
65 - if (iommu_found())
66 + if (IOMMU_PRESENT())
67 {
68 - pThis->pIommuDomain = iommu_domain_alloc();
69 + pThis->pIommuDomain = IOMMU_DOMAIN_ALLOC();
70 if (!pThis->pIommuDomain)
71 {
72 printk(KERN_DEBUG "cannot allocate IOMMU domain\n");