static IMG_VOID PVRLinuxX86PATProbe(IMG_VOID) { /* * cpu_has_pat indicates whether PAT support is available on the CPU, * but doesn't indicate if it has been enabled. */ if (cpu_has_pat) /* PRQA S 3335 */ /* ignore 'no function declared' */ { u64 pat; IMG_UINT pat_index; IMG_UINT pat_entry; PVR_TRACE(("%s: PAT available", __FUNCTION__)); /* * There is no Linux API for finding out if write combining * is avaialable through the PAT, so we take the direct * approach, and see if the PAT MSR contains a write combining * entry. */ rdmsrl(MSR_IA32_CR_PAT, pat); PVR_TRACE(("%s: Top 32 bits of PAT: 0x%.8x", __FUNCTION__, (IMG_UINT)(pat >> 32))); PVR_TRACE(("%s: Bottom 32 bits of PAT: 0x%.8x", __FUNCTION__, (IMG_UINT)(pat))); pat_index = pvr_pat_index(_PAGE_CACHE_WC); PVR_TRACE(("%s: PAT index for write combining: %u", __FUNCTION__, pat_index)); pat_entry = pvr_pat_entry(pat, pat_index); PVR_TRACE(("%s: PAT entry for write combining: 0x%.2x (should be 0x%.2x)", __FUNCTION__, pat_entry, PAT_LINUX_X86_WC)); #if defined(SUPPORT_LINUX_X86_WRITECOMBINE) g_write_combining_available = (IMG_BOOL)(pat_entry == PAT_LINUX_X86_WC); #endif } #if defined(DEBUG) #if defined(SUPPORT_LINUX_X86_WRITECOMBINE) if (g_write_combining_available) { PVR_TRACE(("%s: Write combining available via PAT", __FUNCTION__)); } else { PVR_TRACE(("%s: Write combining not available", __FUNCTION__)); } #else /* defined(SUPPORT_LINUX_X86_WRITECOMBINE) */ PVR_TRACE(("%s: Write combining disabled in driver build", __FUNCTION__)); #endif /* defined(SUPPORT_LINUX_X86_WRITECOMBINE) */ #endif /* DEBUG */ }
static IMG_VOID PVRLinuxX86PATProbe(IMG_VOID) { if (cpu_has_pat) { u64 pat; IMG_UINT pat_index; IMG_UINT pat_entry; PVR_TRACE(("%s: PAT available", __FUNCTION__)); rdmsrl(MSR_IA32_CR_PAT, pat); PVR_TRACE(("%s: Top 32 bits of PAT: 0x%.8x", __FUNCTION__, (IMG_UINT)(pat >> 32))); PVR_TRACE(("%s: Bottom 32 bits of PAT: 0x%.8x", __FUNCTION__, (IMG_UINT)(pat))); pat_index = pvr_pat_index(_PAGE_CACHE_WC); PVR_TRACE(("%s: PAT index for write combining: %u", __FUNCTION__, pat_index)); pat_entry = pvr_pat_entry(pat, pat_index); PVR_TRACE(("%s: PAT entry for write combining: 0x%.2x (should be 0x%.2x)", __FUNCTION__, pat_entry, PAT_LINUX_X86_WC)); #if defined(SUPPORT_LINUX_X86_WRITECOMBINE) g_write_combining_available = (IMG_BOOL)(pat_entry == PAT_LINUX_X86_WC); #endif } #if defined(DEBUG) #if defined(SUPPORT_LINUX_X86_WRITECOMBINE) if (g_write_combining_available) { PVR_TRACE(("%s: Write combining available via PAT", __FUNCTION__)); } else { PVR_TRACE(("%s: Write combining not available", __FUNCTION__)); } #else PVR_TRACE(("%s: Write combining disabled in driver build", __FUNCTION__)); #endif #endif }