From e8cf65c07d78e3cfbac953b1b97c51998a5900df Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Tue, 1 May 2012 14:55:18 +0200 Subject: Now using Doug Lea's malloc in kernel land. Next: same in userland. --- src/kernel/lib/std.c | 11 +++++++++++ src/kernel/lib/std.h | 14 ++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 src/kernel/lib/std.c create mode 100644 src/kernel/lib/std.h (limited to 'src/kernel/lib') diff --git a/src/kernel/lib/std.c b/src/kernel/lib/std.c new file mode 100644 index 0000000..316dfa3 --- /dev/null +++ b/src/kernel/lib/std.c @@ -0,0 +1,11 @@ +#include "std.h" +#include "core/sys.h" + +int errno = 0; + +void abort() { + monitor_write("\n\n ABORT - errno: "); + monitor_writeDec(errno); + monitor_write("\n"); + PANIC("abort() called, probably a memory manager failure."); +} diff --git a/src/kernel/lib/std.h b/src/kernel/lib/std.h new file mode 100644 index 0000000..51e0435 --- /dev/null +++ b/src/kernel/lib/std.h @@ -0,0 +1,14 @@ +#ifndef DEF_LIB_STD_H +#define DEF_LIB_STD_H + +// Functions enabling the use of dlmalloc code + +#include /* For size_t */ + +void abort(); +#define sbrk ksbrk +#define brk kbrk + +extern int errno; + +#endif -- cgit v1.2.3