1 /* 2 * local mtrr defines. 3 */ 4 5 #define MTRR_CHANGE_MASK_FIXED 0x01 6 #define MTRR_CHANGE_MASK_VARIABLE 0x02 7 #define MTRR_CHANGE_MASK_DEFTYPE 0x04 8 9 10 struct mtrr_ops { 11 u32 vendor; 12 bool use_intel_if; 13 // void (*init)(void); 14 void (*set)(unsigned int reg, unsigned long base, 15 unsigned long size, mtrr_type type); 16 void (*set_all)(void); 17 18 void (*get)(unsigned int reg, unsigned long *base, 19 unsigned long *size, mtrr_type * type); 20 int (*get_free_region)(unsigned long base, unsigned long size, 21 int replace_reg); 22 int (*validate_add_page)(unsigned long base, unsigned long size, 23 unsigned int type); 24 int (*have_wrcomb)(void); 25 }; 26 27 extern int generic_get_free_region(unsigned long base, unsigned long size, 28 int replace_reg); 29 extern int generic_validate_add_page(unsigned long base, unsigned long size, 30 unsigned int type); 31 32 extern const struct mtrr_ops generic_mtrr_ops; 33 34 void get_mtrr_state(void); 35 36 extern void set_mtrr_ops(const struct mtrr_ops *); 37 38 extern u64 size_or_mask, size_and_mask; 39 extern const struct mtrr_ops *mtrr_if; 40 41 #define is_cpu(vnd) (mtrr_if && mtrr_if->vendor == X86_VENDOR_##vnd) 42 #define use_intel() (mtrr_if && mtrr_if->use_intel_if) 43 44 extern unsigned int num_var_ranges; 45 46 void mtrr_state_warn(void); 47