forked from pool/virtualbox
1a50dafe4d
- Add file "fixes_for_5.6.patch" to handle API changes. OBS-URL: https://build.opensuse.org/request/show/773985 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=531
38 lines
2.0 KiB
Diff
38 lines
2.0 KiB
Diff
Index: VirtualBox-6.1.2/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c
|
|
===================================================================
|
|
--- VirtualBox-6.1.2.orig/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c
|
|
+++ VirtualBox-6.1.2/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c
|
|
@@ -843,9 +843,13 @@ DECLHIDDEN(int) vboxPciOsDevMapRegion(PV
|
|
if (!rcLnx)
|
|
{
|
|
/* For now no caching, try to optimize later. */
|
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
|
|
+ RTR0PTR R0PtrMapping = ioremap(pci_resource_start(pPciDev, iRegion),
|
|
+ pci_resource_len(pPciDev, iRegion));
|
|
+#else
|
|
RTR0PTR R0PtrMapping = ioremap_nocache(pci_resource_start(pPciDev, iRegion),
|
|
pci_resource_len(pPciDev, iRegion));
|
|
-
|
|
+#endif
|
|
if (R0PtrMapping != NIL_RTR0PTR)
|
|
pIns->aRegionR0Mapping[iRegion] = R0PtrMapping;
|
|
else
|
|
Index: VirtualBox-6.1.2/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
|
|
===================================================================
|
|
--- VirtualBox-6.1.2.orig/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
|
|
+++ VirtualBox-6.1.2/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
|
|
@@ -1461,9 +1461,13 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKerne
|
|
* MMIO / physical memory.
|
|
*/
|
|
Assert(pMemLnxToMap->Core.enmType == RTR0MEMOBJTYPE_PHYS && !pMemLnxToMap->Core.u.Phys.fAllocated);
|
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
|
|
+ pMemLnx->Core.pv = ioremap(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub);
|
|
+#else
|
|
pMemLnx->Core.pv = pMemLnxToMap->Core.u.Phys.uCachePolicy == RTMEM_CACHE_POLICY_MMIO
|
|
? ioremap_nocache(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub)
|
|
: ioremap(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub);
|
|
+#endif
|
|
if (pMemLnx->Core.pv)
|
|
{
|
|
/** @todo fix protection. */
|