Ticket #553: generic_x86.cpp.diff

File generic_x86.cpp.diff, 1.1 KB (added by kaoutsis, 18 years ago)
  • generic_x86.cpp

     
    2828#define IA32_MTRR_ENABLE_FIXED          (1UL << 10)
    2929#define IA32_MTRR_VALID_RANGE           (1UL << 11)
    3030
    31 
    3231struct mtrr_capabilities {
    3332    mtrr_capabilities(uint64 value) { *(uint64 *)this = value; }
    3433
     
    4847{
    4948    cpuid_info cpuInfo;
    5049    if (get_current_cpuid(&cpuInfo, 1) != B_OK
    51         || (cpuInfo.eax_1.features & IA32_FEATURE_MTRR) == 0)
     50        || (cpuInfo.eax_1.features & IA32_FEATURE_MTRR) == 0
     51        || (cpuInfo.eax_1.features & IA32_FEATURE_MSR) == 0)
    5252        return 0;
    5353
    5454    mtrr_capabilities capabilities(x86_read_msr(IA32_MSR_MTRR_CAPABILITIES));
     
    160160void
    161161generic_dump_mtrrs(uint32 count)
    162162{
     163
     164    cpuid_info cpuInfo;
     165    if (get_current_cpuid(&cpuInfo, 1) != B_OK
     166        || (cpuInfo.eax_1.features & IA32_FEATURE_MTRR) == 0
     167        || (cpuInfo.eax_1.features & IA32_FEATURE_MSR) == 0)
     168        return;
     169
    163170    if (x86_read_msr(IA32_MSR_MTRR_DEFAULT_TYPE) & IA32_MTRR_ENABLE) {
    164171        TRACE(("MTRR enabled\n"));
    165172    } else {