summaryrefslogtreecommitdiff
path: root/src/arch/armv7/lib
diff options
context:
space:
mode:
authorRonald G. Minnich <rminnich@gmail.com>2013-01-30 15:05:19 -0600
committerPeter Stuge <peter@stuge.se>2013-01-30 22:36:25 +0100
commitbc3abbbaf05123f87cee143845868bf6b95fdd3e (patch)
tree7c8066f68b2c5c22c3be1a4b33ccfa378de4db5f /src/arch/armv7/lib
parentb7e05358621344e0d777853c34960944d680f804 (diff)
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>
Diffstat (limited to 'src/arch/armv7/lib')
-rw-r--r--src/arch/armv7/lib/div0.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/arch/armv7/lib/div0.c b/src/arch/armv7/lib/div0.c
index 632c247b5c..ab06ad3bee 100644
--- a/src/arch/armv7/lib/div0.c
+++ b/src/arch/armv7/lib/div0.c
@@ -21,12 +21,13 @@
* MA 02111-1307 USA
*/
+#include <console/console.h>
+
void __div0(void); // called from asm so no need for a prototype in a header
/* Replacement (=dummy) for GNU/Linux division-by zero handler */
+/* recursion is ok here because we have no formats ... */
void __div0 (void)
{
- extern void hang (void);
-
- hang();
+ printk(BIOS_EMERG, "DIVIDE BY ZERO! continuing ... \n");
}