git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
arch
/
i386
/
kernel
/
cpu
/
mtrr
/
centaur.c
diff --git
a/arch/i386/kernel/cpu/mtrr/centaur.c
b/arch/i386/kernel/cpu/mtrr/centaur.c
index
76af98d
..
cb9aa3a
100644
(file)
--- a/
arch/i386/kernel/cpu/mtrr/centaur.c
+++ b/
arch/i386/kernel/cpu/mtrr/centaur.c
@@
-17,7
+17,7
@@
static u8 centaur_mcr_type; /* 0 for winchip, 1 for winchip2 */
*/
static int
*/
static int
-centaur_get_free_region(unsigned long base, unsigned long size)
+centaur_get_free_region(unsigned long base, unsigned long size
, int replace_reg
)
/* [SUMMARY] Get a free MTRR.
<base> The starting (base) address of the region.
<size> The size (in bytes) of the region.
/* [SUMMARY] Get a free MTRR.
<base> The starting (base) address of the region.
<size> The size (in bytes) of the region.
@@
-26,10
+26,11
@@
centaur_get_free_region(unsigned long base, unsigned long size)
{
int i, max;
mtrr_type ltype;
{
int i, max;
mtrr_type ltype;
- unsigned long lbase;
- unsigned int lsize;
+ unsigned long lbase, lsize;
max = num_var_ranges;
max = num_var_ranges;
+ if (replace_reg >= 0 && replace_reg < max)
+ return replace_reg;
for (i = 0; i < max; ++i) {
if (centaur_mcr_reserved & (1 << i))
continue;
for (i = 0; i < max; ++i) {
if (centaur_mcr_reserved & (1 << i))
continue;
@@
-49,7
+50,7
@@
mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi)
static void
centaur_get_mcr(unsigned int reg, unsigned long *base,
static void
centaur_get_mcr(unsigned int reg, unsigned long *base,
- unsigned
int
*size, mtrr_type * type)
+ unsigned
long
*size, mtrr_type * type)
{
*base = centaur_mcr[reg].high >> PAGE_SHIFT;
*size = -(centaur_mcr[reg].low & 0xfffff000) >> PAGE_SHIFT;
{
*base = centaur_mcr[reg].high >> PAGE_SHIFT;
*size = -(centaur_mcr[reg].low & 0xfffff000) >> PAGE_SHIFT;
@@
-86,6
+87,8
@@
static void centaur_set_mcr(unsigned int reg, unsigned long base,
centaur_mcr[reg].low = low;
wrmsr(MSR_IDT_MCR0 + reg, low, high);
}
centaur_mcr[reg].low = low;
wrmsr(MSR_IDT_MCR0 + reg, low, high);
}
+
+#if 0
/*
* Initialise the later (saner) Winchip MCR variant. In this version
* the BIOS can pass us the registers it has used (but not their values)
/*
* Initialise the later (saner) Winchip MCR variant. In this version
* the BIOS can pass us the registers it has used (but not their values)
@@
-183,6
+186,7
@@
centaur_mcr_init(void)
set_mtrr_done(&ctxt);
}
set_mtrr_done(&ctxt);
}
+#endif
static int centaur_validate_add_page(unsigned long base,
unsigned long size, unsigned int type)
static int centaur_validate_add_page(unsigned long base,
unsigned long size, unsigned int type)
@@
-203,7
+207,7
@@
static int centaur_validate_add_page(unsigned long base,
static struct mtrr_ops centaur_mtrr_ops = {
.vendor = X86_VENDOR_CENTAUR,
static struct mtrr_ops centaur_mtrr_ops = {
.vendor = X86_VENDOR_CENTAUR,
-
.init = centaur_mcr_init,
+
//
.init = centaur_mcr_init,
.set = centaur_set_mcr,
.get = centaur_get_mcr,
.get_free_region = centaur_get_free_region,
.set = centaur_set_mcr,
.get = centaur_get_mcr,
.get_free_region = centaur_get_free_region,