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

TOMOYO Linux Cross Reference
Linux/arch/x86/include/asm/mtrr.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ 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.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/x86/include/asm/mtrr.h (Architecture sparc64) and /arch/sparc/include/asm-sparc/mtrr.h (Architecture sparc)


  1 /*  Generic MTRR (Memory Type Range Register)       1 
  2                                                   
  3     Copyright (C) 1997-1999  Richard Gooch        
  4                                                   
  5     This library is free software; you can red    
  6     modify it under the terms of the GNU Libra    
  7     License as published by the Free Software     
  8     version 2 of the License, or (at your opti    
  9                                                   
 10     This library is distributed in the hope th    
 11     but WITHOUT ANY WARRANTY; without even the    
 12     MERCHANTABILITY or FITNESS FOR A PARTICULA    
 13     Library General Public License for more de    
 14                                                   
 15     You should have received a copy of the GNU    
 16     License along with this library; if not, w    
 17     Software Foundation, Inc., 675 Mass Ave, C    
 18                                                   
 19     Richard Gooch may be reached by email at      
 20     The postal address is:                        
 21       Richard Gooch, c/o ATNF, P. O. Box 76, E    
 22 */                                                
 23 #ifndef _ASM_X86_MTRR_H                           
 24 #define _ASM_X86_MTRR_H                           
 25                                                   
 26 #include <linux/bits.h>                           
 27 #include <uapi/asm/mtrr.h>                        
 28                                                   
 29 /* Defines for hardware MTRR registers. */        
 30 #define MTRR_CAP_VCNT           GENMASK(7, 0)     
 31 #define MTRR_CAP_FIX            BIT_MASK(8)       
 32 #define MTRR_CAP_WC             BIT_MASK(10)      
 33                                                   
 34 #define MTRR_DEF_TYPE_TYPE      GENMASK(7, 0)     
 35 #define MTRR_DEF_TYPE_FE        BIT_MASK(10)      
 36 #define MTRR_DEF_TYPE_E         BIT_MASK(11)      
 37                                                   
 38 #define MTRR_DEF_TYPE_ENABLE    (MTRR_DEF_TYPE    
 39 #define MTRR_DEF_TYPE_DISABLE   ~(MTRR_DEF_TYP    
 40                                                   
 41 #define MTRR_PHYSBASE_TYPE      GENMASK(7, 0)     
 42 #define MTRR_PHYSBASE_RSVD      GENMASK(11, 8)    
 43                                                   
 44 #define MTRR_PHYSMASK_RSVD      GENMASK(10, 0)    
 45 #define MTRR_PHYSMASK_V         BIT_MASK(11)      
 46                                                   
 47 struct mtrr_state_type {                          
 48         struct mtrr_var_range var_ranges[MTRR_    
 49         mtrr_type fixed_ranges[MTRR_NUM_FIXED_    
 50         unsigned char enabled;                    
 51         bool have_fixed;                          
 52         mtrr_type def_type;                       
 53 };                                                
 54                                                   
 55 /*                                                
 56  * The following functions are for use by othe    
 57  * arch_phys_wc_add and arch_phys_wc_del.         
 58  */                                               
 59 # ifdef CONFIG_MTRR                               
 60 void mtrr_bp_init(void);                          
 61 void mtrr_overwrite_state(struct mtrr_var_rang    
 62                           mtrr_type def_type);    
 63 extern u8 mtrr_type_lookup(u64 addr, u64 end,     
 64 extern void mtrr_save_fixed_ranges(void *);       
 65 extern void mtrr_save_state(void);                
 66 extern int mtrr_add(unsigned long base, unsign    
 67                     unsigned int type, bool in    
 68 extern int mtrr_add_page(unsigned long base, u    
 69                          unsigned int type, bo    
 70 extern int mtrr_del(int reg, unsigned long bas    
 71 extern int mtrr_del_page(int reg, unsigned lon    
 72 extern int mtrr_trim_uncached_memory(unsigned     
 73 extern int amd_special_default_mtrr(void);        
 74 void mtrr_disable(void);                          
 75 void mtrr_enable(void);                           
 76 void mtrr_generic_set_state(void);                
 77 #  else                                           
 78 static inline void mtrr_overwrite_state(struct    
 79                                         unsign    
 80                                         mtrr_t    
 81 {                                                 
 82 }                                                 
 83                                                   
 84 static inline u8 mtrr_type_lookup(u64 addr, u6    
 85 {                                                 
 86         /*                                        
 87          * Return the default MTRR type, witho    
 88          * that range.                            
 89          */                                       
 90         *uniform = 1;                             
 91                                                   
 92         return MTRR_TYPE_UNCACHABLE;              
 93 }                                                 
 94 #define mtrr_save_fixed_ranges(arg) do {} whil    
 95 #define mtrr_save_state() do {} while (0)         
 96 static inline int mtrr_add(unsigned long base,    
 97                            unsigned int type,     
 98 {                                                 
 99     return -ENODEV;                               
100 }                                                 
101 static inline int mtrr_add_page(unsigned long     
102                                 unsigned int t    
103 {                                                 
104     return -ENODEV;                               
105 }                                                 
106 static inline int mtrr_del(int reg, unsigned l    
107 {                                                 
108     return -ENODEV;                               
109 }                                                 
110 static inline int mtrr_del_page(int reg, unsig    
111 {                                                 
112     return -ENODEV;                               
113 }                                                 
114 static inline int mtrr_trim_uncached_memory(un    
115 {                                                 
116         return 0;                                 
117 }                                                 
118 #define mtrr_bp_init() do {} while (0)            
119 #define mtrr_disable() do {} while (0)            
120 #define mtrr_enable() do {} while (0)             
121 #define mtrr_generic_set_state() do {} while (    
122 #  endif                                          
123                                                   
124 #ifdef CONFIG_COMPAT                              
125 #include <linux/compat.h>                         
126                                                   
127 struct mtrr_sentry32 {                            
128     compat_ulong_t base;    /*  Base address      
129     compat_uint_t size;    /*  Size of region     
130     compat_uint_t type;     /*  Type of region    
131 };                                                
132                                                   
133 struct mtrr_gentry32 {                            
134     compat_ulong_t regnum;   /*  Register numb    
135     compat_uint_t base;    /*  Base address       
136     compat_uint_t size;    /*  Size of region     
137     compat_uint_t type;     /*  Type of region    
138 };                                                
139                                                   
140 #define MTRR_IOCTL_BASE 'M'                       
141                                                   
142 #define MTRRIOC32_ADD_ENTRY      _IOW(MTRR_IOC    
143 #define MTRRIOC32_SET_ENTRY      _IOW(MTRR_IOC    
144 #define MTRRIOC32_DEL_ENTRY      _IOW(MTRR_IOC    
145 #define MTRRIOC32_GET_ENTRY      _IOWR(MTRR_IO    
146 #define MTRRIOC32_KILL_ENTRY     _IOW(MTRR_IOC    
147 #define MTRRIOC32_ADD_PAGE_ENTRY _IOW(MTRR_IOC    
148 #define MTRRIOC32_SET_PAGE_ENTRY _IOW(MTRR_IOC    
149 #define MTRRIOC32_DEL_PAGE_ENTRY _IOW(MTRR_IOC    
150 #define MTRRIOC32_GET_PAGE_ENTRY _IOWR(MTRR_IO    
151 #define MTRRIOC32_KILL_PAGE_ENTRY                 
152                                  _IOW(MTRR_IOC    
153 #endif /* CONFIG_COMPAT */                        
154                                                   
155 /* Bit fields for enabled in struct mtrr_state    
156 #define MTRR_STATE_SHIFT                10        
157 #define MTRR_STATE_MTRR_FIXED_ENABLED   (MTRR_    
158 #define MTRR_STATE_MTRR_ENABLED         (MTRR_    
159                                                   
160 #endif /* _ASM_X86_MTRR_H */                      
161                                                   

~ [ 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