14 static u8 centaur_mcr_reserved;
15 static u8 centaur_mcr_type;
26 centaur_get_free_region(
unsigned long base,
unsigned long size,
int replace_reg)
28 unsigned long lbase, lsize;
33 if (replace_reg >= 0 && replace_reg < max)
36 for (i = 0; i <
max; ++
i) {
37 if (centaur_mcr_reserved & (1 << i))
39 mtrr_if->get(i, &lbase, &lsize, <ype);
52 centaur_mcr[mcr].low = lo;
53 centaur_mcr[mcr].high = hi;
57 centaur_get_mcr(
unsigned int reg,
unsigned long *base,
64 if (centaur_mcr_type == 1 && ((centaur_mcr[reg].
low & 31) & 2))
66 if (centaur_mcr_type == 1 && (centaur_mcr[reg].low & 31) == 25)
68 if (centaur_mcr_type == 0 && (centaur_mcr[reg].low & 31) == 31)
73 centaur_set_mcr(
unsigned int reg,
unsigned long base,
83 if (centaur_mcr_type == 0) {
85 low = -size << PAGE_SHIFT | 0x1f;
88 low = -size << PAGE_SHIFT | 0x02;
90 low = -size << PAGE_SHIFT | 0x09;
94 centaur_mcr[
reg].low =
low;
99 centaur_validate_add_page(
unsigned long base,
unsigned long size,
unsigned int type)
106 pr_warning(
"mtrr: only write-combining%s supported\n",
107 centaur_mcr_type ?
" and uncacheable are" :
" is");
113 static const struct mtrr_ops centaur_mtrr_ops = {
115 .set = centaur_set_mcr,
116 .get = centaur_get_mcr,
117 .get_free_region = centaur_get_free_region,
118 .validate_add_page = centaur_validate_add_page,