Author: hailfinger
Date: 2009-02-11 17:57:32 +0100 (Wed, 11 Feb 2009)
New Revision: 3937

Modified:
   trunk/coreboot-v2/src/cpu/x86/mtrr/mtrr.c
Log:
Print a loud warning message if we run out of MTRRs.

Signed-off-by: Carl-Daniel Hailfinger <[email protected]>
Acked-by: Myles Watson <[email protected]>


Modified: trunk/coreboot-v2/src/cpu/x86/mtrr/mtrr.c
===================================================================
--- trunk/coreboot-v2/src/cpu/x86/mtrr/mtrr.c   2009-02-11 12:08:55 UTC (rev 
3936)
+++ trunk/coreboot-v2/src/cpu/x86/mtrr/mtrr.c   2009-02-11 16:57:32 UTC (rev 
3937)
@@ -228,9 +228,14 @@
        unsigned long range_startk, unsigned long range_sizek,
        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;
+       }
        while(range_sizek) {
                unsigned long max_align, align;
                unsigned long sizek;
@@ -249,8 +254,10 @@
                set_var_mtrr(reg++, range_startk, sizek, type, address_bits);
                range_startk += sizek;
                range_sizek -= sizek;
-               if (reg >= BIOS_MTRRS)
+               if (reg >= BIOS_MTRRS) {
+                       printk_err("Running out of variable MTRRs!\n");
                        break;
+               }
        }
        return reg;
 }


--
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to