[LinuxBIOS] r550 - LinuxBIOSv3/lib
svn at openbios.org
svn at openbios.org
Wed Jan 9 19:27:49 CET 2008
Author: mjones
Date: 2008-01-09 19:27:49 +0100 (Wed, 09 Jan 2008)
New Revision: 550
Modified:
LinuxBIOSv3/lib/console.c
Log:
Add hlt() back into the die() function and update the comments.
Signed-off-by: Marc Jones <marc.jones at amd.com>
Acked-by: Peter Stuge <peter at stuge.se>
Modified: LinuxBIOSv3/lib/console.c
===================================================================
--- LinuxBIOSv3/lib/console.c 2008-01-07 16:34:34 UTC (rev 549)
+++ LinuxBIOSv3/lib/console.c 2008-01-09 18:27:49 UTC (rev 550)
@@ -83,30 +83,37 @@
}
/**
- * Halt and loop due to a fatal error.
- * There have been several iterations of this function.
+ * Halt and loop due to a fatal error.
+ * There have been several iterations of this function.
* The first simply did a hlt(). Doing a hlt() can make jtag debugging
- * very difficult as one can not break into a hlt instruction on some CPUs.
- * Second was to do a console_tx_byte of a NULL character.
- * A number of concerns were raised about doing this idea.
- * Third idea was to do an inb from port 0x80, the POST port. That design
- * makes us very CPU-specific.
+ * very difficult as one can not break into a hlt instruction on some CPUs.
+ * Second was to do a console_tx_byte of a NULL character.
+ * A number of concerns were raised about doing this idea.
+ * Third idea was to do an inb from port 0x80, the POST port. That design
+ * makes us very CPU-specific.
* The fourth idea was just POSTING the same
- * code over and over. That would erase the most recent POST code,
- * hindering diagnosis.
+ * code over and over. That would erase the most recent POST code,
+ * hindering diagnosis.
*
- * For now, for lack of a good alternative,
- * we will continue to call console_tx_byte. We call with a NULL since
- * it will clear any FIFOs in the path and won't clutter up the output,
- * since NULL doesn't print a visible character on most terminal
- * emulators.
+ * For now, for lack of a better alternative,
+ * we will call console_tx_byte ten times and then halt.
+ * Some CPU JTAG debbuggers might have problems but it is the right thing
+ * to do. We call with a NULL since it will clear any FIFOs in the path and
+ * won't clutter up the output, since NULL doesn't print a visible character
+ * on most terminal emulators.
*
* @param str A string to print for the error
*
*/
void die(const char *str)
{
+ int i;
+
printk(BIOS_EMERG, str);
- while (1)
- console_tx_byte(0, (void *)0);
+
+ while (1) {
+ for (i = 0; i < 10; i++)
+ console_tx_byte(0, (void *)0);
+ hlt();
+ }
}
More information about the coreboot
mailing list