From 7414dcaeed3fdb00fa4eb8b9ced32bd23b2d9615 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 1 Oct 2011 11:35:51 +0200 Subject: [PATCH] libbase: add abort() --- software/include/base/stdlib.h | 3 ++- software/libbase/libc.c | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/software/include/base/stdlib.h b/software/include/base/stdlib.h index e6d6fb15..eb95caff 100644 --- a/software/include/base/stdlib.h +++ b/software/include/base/stdlib.h @@ -1,6 +1,6 @@ /* * Milkymist SoC (Software) - * Copyright (C) 2007, 2008, 2009 Sebastien Bourdeauducq + * Copyright (C) 2007, 2008, 2009, 2011 Sebastien Bourdeauducq * Copyright (C) Linux kernel developers * * This program is free software: you can redistribute it and/or modify @@ -50,6 +50,7 @@ long strtol(const char *nptr, char **endptr, int base); float atof(const char *s); unsigned int rand(); +void abort(); void *malloc(size_t size); void free(void *p); diff --git a/software/libbase/libc.c b/software/libbase/libc.c index 59dfb06a..1e079b09 100644 --- a/software/libbase/libc.c +++ b/software/libbase/libc.c @@ -1,6 +1,6 @@ /* * Milkymist SoC (Software) - * Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq + * Copyright (C) 2007, 2008, 2009, 2010, 2011 Sebastien Bourdeauducq * Copyright (C) Linus Torvalds and Linux kernel developers * * This program is free software: you can redistribute it and/or modify @@ -569,3 +569,9 @@ unsigned int rand() seed = 129 * seed + 907633385; return seed; } + +void abort() +{ + printf("Aborted."); + while(1); +}