diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2014-07-31 14:29:58 +1000 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-08-08 16:07:26 +1000 |
commit | 62aadce2eeedb461c07f12ead92e6f8de97cedd0 (patch) | |
tree | 7c4d5a1c88a007f3f6927072688e7abf7f569565 /libc | |
parent | a93bf9ff8c90b2d2c6fbb5b15bfbc0215750c138 (diff) | |
download | skiboot-62aadce2eeedb461c07f12ead92e6f8de97cedd0.zip skiboot-62aadce2eeedb461c07f12ead92e6f8de97cedd0.tar.gz skiboot-62aadce2eeedb461c07f12ead92e6f8de97cedd0.tar.bz2 |
Use PR_EMERG priority in assert() codepath
Moving assert_fail() out of libc and into core/utils.c so that we can
sanely call prlog(PR_EMERG).
We shorten it from three fputs calls down to one prlog() call.
This may increase the number of cycles and stack usage for when we
hit an assert, which may not be desirable.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'libc')
-rw-r--r-- | libc/stdlib/Makefile.inc | 2 | ||||
-rw-r--r-- | libc/stdlib/abort.c | 23 |
2 files changed, 1 insertions, 24 deletions
diff --git a/libc/stdlib/Makefile.inc b/libc/stdlib/Makefile.inc index 473cbfc..6d1123e 100644 --- a/libc/stdlib/Makefile.inc +++ b/libc/stdlib/Makefile.inc @@ -13,7 +13,7 @@ SUBDIRS += $(LIBCDIR)/stdlib STDLIB_OBJS = error.o atoi.o atol.o strtol.o strtoul.o \ - rand.o abort.o + rand.o STDLIB = $(LIBCDIR)/stdlib/built-in.o $(STDLIB): $(STDLIB_OBJS:%=$(LIBCDIR)/stdlib/%) diff --git a/libc/stdlib/abort.c b/libc/stdlib/abort.c deleted file mode 100644 index 9c5ea47..0000000 --- a/libc/stdlib/abort.c +++ /dev/null @@ -1,23 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2004, 2008, 2012 IBM Corporation - * All rights reserved. - * This program and the accompanying materials - * are made available under the terms of the BSD License - * which accompanies this distribution, and is available at - * http://www.opensource.org/licenses/bsd-license.php - * - * Contributors: - * IBM Corporation - initial implementation - *****************************************************************************/ - -#include <stdlib.h> -#include <stdio.h> -#include <assert.h> - -void assert_fail(const char *msg) -{ - fputs("Assert fail:", stderr); - fputs(msg, stderr); - fputs("\n", stderr); - abort(); -} |