#define get_cpu() smp_processor_id()
#define put_cpu() do {} while(0)
-u32 num_var_ranges = 0;
+u32 __read_mostly num_var_ranges = 0;
-unsigned int *usage_table;
+unsigned int *__read_mostly usage_table;
static DEFINE_MUTEX(mtrr_mutex);
-u64 size_or_mask, size_and_mask;
+u64 __read_mostly size_or_mask;
+u64 __read_mostly size_and_mask;
-static struct mtrr_ops * mtrr_ops[X86_VENDOR_NUM] = {};
-
-struct mtrr_ops * mtrr_if = NULL;
+const struct mtrr_ops *__read_mostly mtrr_if = NULL;
static void set_mtrr(unsigned int reg, unsigned long base,
unsigned long size, mtrr_type type);
#define arr3_protected 0
#endif
-static const char *mtrr_strings[MTRR_NUM_TYPES] =
+static const char *const mtrr_strings[MTRR_NUM_TYPES] =
{
"uncachable", /* 0 */
"write-combining", /* 1 */
"write-back", /* 6 */
};
-const char *mtrr_attrib_to_str(int x)
+static const char *mtrr_attrib_to_str(int x)
{
return (x <= 6) ? mtrr_strings[x] : "?";
}
-void set_mtrr_ops(struct mtrr_ops * ops)
+#ifndef CONFIG_X86_64
+static const struct mtrr_ops *mtrr_ops[X86_VENDOR_NUM];
+
+void set_mtrr_ops(const struct mtrr_ops * ops)
{
if (ops->vendor && ops->vendor < X86_VENDOR_NUM)
mtrr_ops[ops->vendor] = ops;
}
+#endif
/* Returns non-zero if we have the write-combining memory type */
static int have_wrcomb(void)
* failures and do not wish system log messages to be sent.
*/
-int
+int __init
mtrr_add(unsigned long base, unsigned long size, unsigned int type,
char increment)
{
* code.
*/
-int
+int __init
mtrr_del(int reg, unsigned long base, unsigned long size)
{
if (mtrr_check(base, size))
return mtrr_del_page(reg, base >> PAGE_SHIFT, size >> PAGE_SHIFT);
}
-EXPORT_SYMBOL(mtrr_add);
-EXPORT_SYMBOL(mtrr_del);
-
/* HACK ALERT!
* These should be called implicitly, but we can't yet until all the initcall
* stuff is done...
extern int generic_validate_add_page(unsigned long base, unsigned long size,
unsigned int type);
-extern struct mtrr_ops generic_mtrr_ops;
+extern const struct mtrr_ops generic_mtrr_ops;
extern int positive_have_wrcomb(void);
void get_mtrr_state(void);
-extern void set_mtrr_ops(struct mtrr_ops * ops);
+extern void set_mtrr_ops(const struct mtrr_ops *);
extern u64 size_or_mask, size_and_mask;
-extern struct mtrr_ops * mtrr_if;
+extern const struct mtrr_ops *mtrr_if;
#define is_cpu(vnd) (mtrr_if && mtrr_if->vendor == X86_VENDOR_##vnd)
#define use_intel() (mtrr_if && mtrr_if->use_intel_if == 1)
extern unsigned int num_var_ranges;
void mtrr_state_warn(void);
-const char *mtrr_attrib_to_str(int x);
void mtrr_wrmsr(unsigned int msr, uint64_t msr_content);