summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mutils.c')
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mutils.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mutils.c b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mutils.c
index 8e57476..9e83d85 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mutils.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mutils.c
@@ -57,6 +57,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
57#include "mutils.h" 57#include "mutils.h"
58 58
59#if defined(SUPPORT_LINUX_X86_PAT) 59#if defined(SUPPORT_LINUX_X86_PAT)
60
61#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0))
62#define _PAGE_CACHE_WC pgprot_val(cachemode2pgprot(_PAGE_CACHE_MODE_WC))
63#endif
64
60#define PAT_LINUX_X86_WC 1 65#define PAT_LINUX_X86_WC 1
61 66
62#define PAT_X86_ENTRY_BITS 8 67#define PAT_X86_ENTRY_BITS 8
@@ -113,7 +118,11 @@ PVRLinuxX86PATProbe(IMG_VOID)
113 PVR_TRACE(("%s: Top 32 bits of PAT: 0x%.8x", __FUNCTION__, (IMG_UINT)(pat >> 32))); 118 PVR_TRACE(("%s: Top 32 bits of PAT: 0x%.8x", __FUNCTION__, (IMG_UINT)(pat >> 32)));
114 PVR_TRACE(("%s: Bottom 32 bits of PAT: 0x%.8x", __FUNCTION__, (IMG_UINT)(pat))); 119 PVR_TRACE(("%s: Bottom 32 bits of PAT: 0x%.8x", __FUNCTION__, (IMG_UINT)(pat)));
115 120
121#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0))
122 pat_index = pvr_pat_index(_PAGE_CACHE_MODE_WC);
123#else
116 pat_index = pvr_pat_index(_PAGE_CACHE_WC); 124 pat_index = pvr_pat_index(_PAGE_CACHE_WC);
125#endif
117 PVR_TRACE(("%s: PAT index for write combining: %u", __FUNCTION__, pat_index)); 126 PVR_TRACE(("%s: PAT index for write combining: %u", __FUNCTION__, pat_index));
118 127
119 pat_entry = pvr_pat_entry(pat, pat_index); 128 pat_entry = pvr_pat_entry(pat, pat_index);
@@ -152,7 +161,11 @@ pvr_pgprot_writecombine(pgprot_t prot)
152 */ 161 */
153 /* PRQA S 0481,0482 2 */ /* scalar expressions */ 162 /* PRQA S 0481,0482 2 */ /* scalar expressions */
154 return (g_write_combining_available) ? 163 return (g_write_combining_available) ?
164#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0))
165 __pgprot((pgprot_val(prot) & ~_PAGE_CACHE_MASK) | _PAGE_CACHE_MODE_WC) : pgprot_noncached(prot);
166#else
155 __pgprot((pgprot_val(prot) & ~_PAGE_CACHE_MASK) | _PAGE_CACHE_WC) : pgprot_noncached(prot); 167 __pgprot((pgprot_val(prot) & ~_PAGE_CACHE_MASK) | _PAGE_CACHE_WC) : pgprot_noncached(prot);
168#endif
156} 169}
157#endif /* defined(SUPPORT_LINUX_X86_PAT) */ 170#endif /* defined(SUPPORT_LINUX_X86_PAT) */
158 171