~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/x86/kernel/cpu/mtrr/mtrr.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * local MTRR defines.
  4  */
  5 
  6 #include <linux/types.h>
  7 #include <linux/stddef.h>
  8 
  9 #define MTRR_CHANGE_MASK_FIXED     0x01
 10 #define MTRR_CHANGE_MASK_VARIABLE  0x02
 11 #define MTRR_CHANGE_MASK_DEFTYPE   0x04
 12 
 13 extern bool mtrr_debug;
 14 #define Dprintk(x...) do { if (mtrr_debug) pr_info(x); } while (0)
 15 
 16 extern unsigned int mtrr_usage_table[MTRR_MAX_VAR_RANGES];
 17 
 18 struct mtrr_ops {
 19         u32     var_regs;
 20         void    (*set)(unsigned int reg, unsigned long base,
 21                        unsigned long size, mtrr_type type);
 22         void    (*get)(unsigned int reg, unsigned long *base,
 23                        unsigned long *size, mtrr_type *type);
 24         int     (*get_free_region)(unsigned long base, unsigned long size,
 25                                    int replace_reg);
 26         int     (*validate_add_page)(unsigned long base, unsigned long size,
 27                                      unsigned int type);
 28         int     (*have_wrcomb)(void);
 29 };
 30 
 31 extern int generic_get_free_region(unsigned long base, unsigned long size,
 32                                    int replace_reg);
 33 extern int generic_validate_add_page(unsigned long base, unsigned long size,
 34                                      unsigned int type);
 35 
 36 extern const struct mtrr_ops generic_mtrr_ops;
 37 
 38 extern int positive_have_wrcomb(void);
 39 
 40 /* library functions for processor-specific routines */
 41 struct set_mtrr_context {
 42         unsigned long   flags;
 43         unsigned long   cr4val;
 44         u32             deftype_lo;
 45         u32             deftype_hi;
 46         u32             ccr3;
 47 };
 48 
 49 void set_mtrr_done(struct set_mtrr_context *ctxt);
 50 void set_mtrr_cache_disable(struct set_mtrr_context *ctxt);
 51 void set_mtrr_prepare_save(struct set_mtrr_context *ctxt);
 52 
 53 void fill_mtrr_var_range(unsigned int index,
 54                 u32 base_lo, u32 base_hi, u32 mask_lo, u32 mask_hi);
 55 bool get_mtrr_state(void);
 56 
 57 extern const struct mtrr_ops *mtrr_if;
 58 extern struct mutex mtrr_mutex;
 59 
 60 extern unsigned int num_var_ranges;
 61 extern u64 mtrr_tom2;
 62 extern struct mtrr_state_type mtrr_state;
 63 extern u32 phys_hi_rsvd;
 64 
 65 void mtrr_state_warn(void);
 66 const char *mtrr_attrib_to_str(int x);
 67 void mtrr_wrmsr(unsigned, unsigned, unsigned);
 68 #ifdef CONFIG_X86_32
 69 void mtrr_set_if(void);
 70 void mtrr_register_syscore(void);
 71 #else
 72 static inline void mtrr_set_if(void) { }
 73 static inline void mtrr_register_syscore(void) { }
 74 #endif
 75 void mtrr_build_map(void);
 76 void mtrr_copy_map(void);
 77 
 78 /* CPU specific mtrr_ops vectors. */
 79 extern const struct mtrr_ops amd_mtrr_ops;
 80 extern const struct mtrr_ops cyrix_mtrr_ops;
 81 extern const struct mtrr_ops centaur_mtrr_ops;
 82 
 83 extern int changed_by_mtrr_cleanup;
 84 extern int mtrr_cleanup(void);
 85 
 86 /*
 87  * Must be used by code which uses mtrr_if to call platform-specific
 88  * MTRR manipulation functions.
 89  */
 90 static inline bool mtrr_enabled(void)
 91 {
 92         return !!mtrr_if;
 93 }
 94 void generic_rebuild_map(void);
 95 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php