armv7: don't hang on divide by zero
People make mistakes. Hanging the box is not a good reason to kill the firmware, esp. since this is probably happening in a printk. The only issue with the recursive call to printk is that we may deadlock if we have locked something. But we can at least try. Hanging is certainly not what we want ... Change-Id: Ib3bc87bc395ae89e115cf6d042f4167856422ca1 Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: http://review.coreboot.org/2233 Tested-by: build bot (Jenkins) Reviewed-by: Peter Stuge <peter@stuge.se>
This commit is contained in:
parent
b7e0535862
commit
bc3abbbaf0
|
@ -21,12 +21,13 @@
|
||||||
* MA 02111-1307 USA
|
* MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <console/console.h>
|
||||||
|
|
||||||
void __div0(void); // called from asm so no need for a prototype in a header
|
void __div0(void); // called from asm so no need for a prototype in a header
|
||||||
|
|
||||||
/* Replacement (=dummy) for GNU/Linux division-by zero handler */
|
/* Replacement (=dummy) for GNU/Linux division-by zero handler */
|
||||||
|
/* recursion is ok here because we have no formats ... */
|
||||||
void __div0 (void)
|
void __div0 (void)
|
||||||
{
|
{
|
||||||
extern void hang (void);
|
printk(BIOS_EMERG, "DIVIDE BY ZERO! continuing ... \n");
|
||||||
|
|
||||||
hang();
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue