diff options
-rw-r--r-- | core/utils.c | 6 | ||||
-rw-r--r-- | libc/stdlib/Makefile.inc | 2 | ||||
-rw-r--r-- | libc/stdlib/abort.c | 23 |
3 files changed, 7 insertions, 24 deletions
diff --git a/core/utils.c b/core/utils.c index 11e9d85..71f3842 100644 --- a/core/utils.c +++ b/core/utils.c @@ -19,6 +19,12 @@ #include <fsp.h> #include <processor.h> +void assert_fail(const char *msg) +{ + prlog(PR_EMERG, "Assert fail: %s\n", msg); + abort(); +} + void abort(void) { static bool in_abort = false; 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(); -} |