summaryrefslogtreecommitdiffstats
path: root/libc/stdlib
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2014-07-31 14:29:58 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-08-08 16:07:26 +1000
commit62aadce2eeedb461c07f12ead92e6f8de97cedd0 (patch)
tree7c4d5a1c88a007f3f6927072688e7abf7f569565 /libc/stdlib
parenta93bf9ff8c90b2d2c6fbb5b15bfbc0215750c138 (diff)
downloadtalos-skiboot-62aadce2eeedb461c07f12ead92e6f8de97cedd0.tar.gz
talos-skiboot-62aadce2eeedb461c07f12ead92e6f8de97cedd0.zip
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/stdlib')
-rw-r--r--libc/stdlib/Makefile.inc2
-rw-r--r--libc/stdlib/abort.c23
2 files changed, 1 insertions, 24 deletions
diff --git a/libc/stdlib/Makefile.inc b/libc/stdlib/Makefile.inc
index 473cbfcc..6d1123e0 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 9c5ea471..00000000
--- 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();
-}
OpenPOWER on IntegriCloud