Skip to content

Commit

Permalink
libbase: add abort()
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien Bourdeauducq committed Oct 1, 2011
1 parent 6f8f96b commit 7414dca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion 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
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 7 additions & 1 deletion 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
Expand Down Expand Up @@ -569,3 +569,9 @@ unsigned int rand()
seed = 129 * seed + 907633385;
return seed;
}

void abort()
{
printf("Aborted.");
while(1);
}

0 comments on commit 7414dca

Please sign in to comment.