00001 /*++ 00002 00003 Copyright (c) 1991 Microsoft Corporation 00004 00005 Module Name: 00006 00007 mtrr.h 00008 00009 Abstract: 00010 00011 This module contains the i386 specific mtrr register 00012 hardware definitions. 00013 00014 Author: 00015 00016 Ken Reneris (kenr) 11-Oct-95 00017 00018 Environment: 00019 00020 Kernel mode only. 00021 00022 Revision History: 00023 00024 --*/ 00025 00026 // 00027 // MTRR MSR architecture definitions 00028 // 00029 00030 #define MTRR_MSR_CAPABILITIES 0x0fe 00031 #define MTRR_MSR_DEFAULT 0x2ff 00032 #define MTRR_MSR_VARIABLE_BASE 0x200 00033 #define MTRR_MSR_VARIABLE_MASK (MTRR_MSR_VARIABLE_BASE+1) 00034 00035 #define MTRR_PAGE_SIZE 4096 00036 #define MTRR_PAGE_MASK (~(MTRR_PAGE_SIZE-1)) 00037 00038 // 00039 // Memory range types 00040 // 00041 00042 #define MTRR_TYPE_UC 0 00043 #define MTRR_TYPE_USWC 1 00044 #define MTRR_TYPE_WT 4 00045 #define MTRR_TYPE_WP 5 00046 #define MTRR_TYPE_WB 6 00047 #define MTRR_TYPE_MAX 7 00048 00049 // 00050 // MTRR specific registers - capability register, default 00051 // register, and variable mask and base register 00052 // 00053 00054 #include "pshpack1.h" 00055 00056 typedef struct _MTRR_CAPABILITIES { 00057 union { 00058 struct { 00059 ULONG VarCnt:8; 00060 ULONG FixSupported:1; 00061 ULONG Reserved_0:1; 00062 ULONG UswcSupported:1; 00063 ULONG Reserved_1:21; 00064 ULONG Reserved_2; 00065 } hw; 00066 ULONGLONG QuadPart; 00067 } u; 00068 } MTRR_CAPABILITIES, *PMTRR_CAPABILITIES; 00069 00070 typedef struct _MTRR_DEFAULT { 00071 union { 00072 struct { 00073 ULONG Type:8; 00074 ULONG Reserved_0:2; 00075 ULONG FixedEnabled:1; 00076 ULONG MtrrEnabled:1; 00077 ULONG Reserved_1:20; 00078 ULONG Reserved_2; 00079 } hw; 00080 ULONGLONG QuadPart; 00081 } u; 00082 } MTRR_DEFAULT, *PMTRR_DEFAULT; 00083 00084 typedef struct _MTRR_VARIABLE_BASE { 00085 union { 00086 struct { 00087 ULONG Type:8; 00088 ULONG Reserved_0:4; 00089 ULONG PhysBase_1:20; 00090 ULONG PhysBase_2:4; 00091 ULONG Reserved_1:28; 00092 } hw; 00093 ULONGLONG QuadPart; 00094 } u; 00095 } MTRR_VARIABLE_BASE, *PMTRR_VARIABLE_BASE; 00096 00097 #define MTRR_MASK_BASE 0x0000000ffffff000 00098 00099 typedef struct _MTRR_VARIABLE_MASK { 00100 union { 00101 struct { 00102 ULONG Reserved_0:11; 00103 ULONG Valid:1; 00104 ULONG PhysMask_1:20; 00105 ULONG PhysMask_2:4; 00106 ULONG Reserved_1:28; 00107 } hw; 00108 ULONGLONG QuadPart; 00109 } u; 00110 } MTRR_VARIABLE_MASK, *PMTRR_VARIABLE_MASK; 00111 00112 #define MTRR_MASK_MASK 0x0000000ffffff000 00113 00114 // 00115 // Masks/constants to check for non-contiguous masks, 00116 // mask out reserved bits of variable MTRR's, 00117 // and construct MTRR variable register masks 00118 // 00119 00120 #define MASK_OVERFLOW_MASK (~0x1000000000) 00121 #define MTRR_RESVBIT_MASK 0xfffffffff 00122 #define MTRR_MAX_RANGE_SHIFT 36 00123 00124 #include "poppack.h"