[coreboot] [RFC] ASSERT

Stefan Reinauer stepan at coresystems.de
Mon Feb 22 12:42:48 CET 2010


Hi,

I rewrote the ASSERT() and BUG() implementations (src/include/assert.h)
from scratch.
The old one used different messages for preram and ram stages and would
not print any warnings if CONFIG_DEBUG was disabled.
In the case of CONFIG_DEBUG the code would die().

I wonder if that's the behavior we want. If something is bad enough to
stop a system during development, maybe the warning should not
be ignored completely when it happens in a productive system? I think we
should always print a warning if the code is inconsistent.

Also, do we want to die() on an assert? I believe in most cases we
don't.The worst case that happens when we run into a bug or assert
situation is that we can not boot the system.
But in some cases it's not that bad.. like in the mptable / acpi
generator or some IOAPIC and SuperIO drivers. We might still be able to
boot into a system and flash a new, fixed coreboot
image, but in case of a die() we desperately brick the system. I think
we should not do that.

What do you think?

Stefan

-- 
coresystems GmbH . Brahmsstr. 16 . D-79104 Freiburg i. Br.
      Tel.: +49 761 7668825 . Fax: +49 761 7664613
Email: info at coresystems.de  . http://www.coresystems.de/
Registergericht: Amtsgericht Freiburg . HRB 7656
Geschäftsführer: Stefan Reinauer . Ust-IdNr.: DE245674866

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20100222/85f446ee/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: assert.h
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20100222/85f446ee/attachment.h>


More information about the coreboot mailing list