79 lines
2.6 KiB
Diff
79 lines
2.6 KiB
Diff
|
From 9990e19bc554d11c4123986692c5e0572682467a Mon Sep 17 00:00:00 2001
|
||
|
From: Josef Baumgartner <josef.baumgartner@br-automation.com>
|
||
|
Date: Wed, 14 Aug 2013 10:22:21 +0200
|
||
|
Subject: [PATCH 1/1] [FIX] Fix compilation issue for kernels > 3.5
|
||
|
|
||
|
With kernel version 3.5 the interface of kmap_atomic() and
|
||
|
kunmap_atomic is changed. The fix adapts to the new interface.
|
||
|
|
||
|
Change-Id: I0885b87dc594bf48d1ff4eaeaf188268ceb3b112
|
||
|
Reviewed-on: http://brateggevoat1/gerrit/1261
|
||
|
Tested-by: Jenkins <jenkins@brateggevoat1.br-automation.co.at>
|
||
|
Reviewed-by: Josef Baumgartner <josef.baumgartner@br-automation.com>
|
||
|
---
|
||
|
EplStack/EplApiProcessImage.c | 24 +++++++++++++++++++-----
|
||
|
1 file changed, 19 insertions(+), 5 deletions(-)
|
||
|
|
||
|
diff --git a/EplStack/EplApiProcessImage.c b/EplStack/EplApiProcessImage.c
|
||
|
index a1a049f..02907bc 100644
|
||
|
--- a/EplStack/EplApiProcessImage.c
|
||
|
+++ b/EplStack/EplApiProcessImage.c
|
||
|
@@ -573,7 +573,7 @@ tEplApiProcessImageCopyJobInt IntCopyJob;
|
||
|
#elif (TARGET_SYSTEM == _WIN32_)
|
||
|
if (EplApiProcessImageInstance_g.m_dwCurrentThreadId == GetCurrentThreadId())
|
||
|
#elif (TARGET_SYSTEM == _VXWORKS_)
|
||
|
- if (EplApiProcessImageInstance_g.m_currentThreadId == taskIdSelf())
|
||
|
+ if (EplApiProcessImageInstance_g.m_currentThreadId == taskIdSelf())
|
||
|
#else
|
||
|
#error "OS currently not supported by EplApiProcessImage!"
|
||
|
#endif
|
||
|
@@ -1018,13 +1018,20 @@ void* pVirtUserPart;
|
||
|
}
|
||
|
|
||
|
ulSize = min ((PAGE_SIZE - ulOffset), pPart->m_uiSize - ulLength);
|
||
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
|
||
|
pVirtUserPart = kmap_atomic(ppPage[nIndex], KM_USER0);
|
||
|
+#else
|
||
|
+ pVirtUserPart = kmap_atomic(ppPage[nIndex]);
|
||
|
+#endif
|
||
|
|
||
|
EPL_MEMCPY(pPIVar,
|
||
|
pVirtUserPart + ulOffset,
|
||
|
ulSize);
|
||
|
-
|
||
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
|
||
|
kunmap_atomic(pVirtUserPart, KM_USER0);
|
||
|
+#else
|
||
|
+ kunmap_atomic(pVirtUserPart);
|
||
|
+#endif
|
||
|
|
||
|
pPIVar += ulSize;
|
||
|
ulLength += ulSize;
|
||
|
@@ -1063,14 +1070,21 @@ void* pVirtUserPart;
|
||
|
}
|
||
|
|
||
|
ulSize = min ((PAGE_SIZE - ulOffset), pPart->m_uiSize - ulLength);
|
||
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
|
||
|
pVirtUserPart = kmap_atomic(ppPage[nIndex], KM_USER0);
|
||
|
+#else
|
||
|
+ pVirtUserPart = kmap_atomic(ppPage[nIndex]);
|
||
|
+#endif
|
||
|
|
||
|
EPL_MEMCPY(pVirtUserPart + ulOffset,
|
||
|
pPIVar,
|
||
|
ulSize);
|
||
|
|
||
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
|
||
|
kunmap_atomic(pVirtUserPart, KM_USER0);
|
||
|
-
|
||
|
+#else
|
||
|
+ kunmap_atomic(pVirtUserPart);
|
||
|
+#endif
|
||
|
pPIVar += ulSize;
|
||
|
ulLength += ulSize;
|
||
|
ulOffset = 0;
|
||
|
|
||
|
--
|
||
|
1.8.4
|
||
|
|