attached
ron
On Tue, Nov 27, 2007 at 08:24:15AM -0800, ron minnich wrote:
.. banner
Could this be made more generic/common for more boards?
+/**
- Halt and Catch Fire. Print an error, then loop, sending NULLs on serial port,
- to ensure the message is visible.
- */
+void hcf(void) +{
- printk(BIOS_EMERG, "DIE\r\n");
- /* this guarantees we flush the UART fifos (if any) and also
* ensures that things, in general, keep going so no debug output
* is lost
*/
- while (1)
printk(BIOS_EMERG, "\r");
+}
Could this be a common die() instead?
//Peter
On Nov 27, 2007 8:50 AM, Peter Stuge peter@stuge.se wrote:
On Tue, Nov 27, 2007 at 08:24:15AM -0800, ron minnich wrote:
.. banner
Could this be made more generic/common for more boards?
sure, I could put it in lib/console.c if people want it.
+/**
- Halt and Catch Fire. Print an error, then loop, sending NULLs on serial port,
- to ensure the message is visible.
- */
+void hcf(void) +{
printk(BIOS_EMERG, "DIE\r\n");
/* this guarantees we flush the UART fifos (if any) and also
* ensures that things, in general, keep going so no debug output
* is lost
*/
while (1)
printk(BIOS_EMERG, "\r");
+}
Could this be a common die() instead?
yes. I got burned in years past with UARTs that had fifos. Rather than halt I would rather this. You want a patch for console.c?
ron
something like this? So we have a standard banner format, and a die function that guarantees to push stuff out the uart -- handy if it is a usb debug device, might keep it alive.
ron Index: lib/console.c =================================================================== --- lib/console.c (revision 524) +++ lib/console.c (working copy) @@ -46,6 +46,17 @@ return i; }
+/** + * Print a nice banner so we know what step we died on. + * + * @param s String to put in the middle of the banner + */ + +void banner(int level, char *s) +{ + printk(level, "===========================%s===========================\n", s); +} + void console_init(void) { static const char console_test[] = @@ -63,5 +74,5 @@ { printk(BIOS_EMERG, str); while (1) - hlt(); + console_tx_byte(0, (void *)0); }
ron minnich wrote:
attached
ron
Acked-by: Marc Jones marc.jones@amd.com