Print a loud warning message if we run out of MTRRs.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Myles Watson <mylesgw@gmail.com>


git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3937 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Carl-Daniel Hailfinger 2009-02-11 16:57:32 +00:00
parent 9dff094efd
commit 7dde1da9a7
1 changed files with 9 additions and 2 deletions

View File

@ -228,7 +228,12 @@ static unsigned int range_to_mtrr(unsigned int reg,
unsigned long range_startk, unsigned long range_sizek, unsigned long range_startk, unsigned long range_sizek,
unsigned long next_range_startk, unsigned char type, unsigned address_bits) unsigned long next_range_startk, unsigned char type, unsigned address_bits)
{ {
if (!range_sizek || (reg >= BIOS_MTRRS)) { if (!range_sizek) {
printk_debug("range_to_mtrr called for empty range\n");
return reg;
}
if (reg >= BIOS_MTRRS) {
printk_err("Running out of variable MTRRs!\n");
return reg; return reg;
} }
while(range_sizek) { while(range_sizek) {
@ -249,9 +254,11 @@ static unsigned int range_to_mtrr(unsigned int reg,
set_var_mtrr(reg++, range_startk, sizek, type, address_bits); set_var_mtrr(reg++, range_startk, sizek, type, address_bits);
range_startk += sizek; range_startk += sizek;
range_sizek -= sizek; range_sizek -= sizek;
if (reg >= BIOS_MTRRS) if (reg >= BIOS_MTRRS) {
printk_err("Running out of variable MTRRs!\n");
break; break;
} }
}
return reg; return reg;
} }