summaryrefslogtreecommitdiff
path: root/src/kernel/lib
diff options
context:
space:
mode:
authorAlex AUVOLAT <alexis211@gmail.com>2012-05-01 14:55:18 +0200
committerAlex AUVOLAT <alexis211@gmail.com>2012-05-01 14:55:18 +0200
commite8cf65c07d78e3cfbac953b1b97c51998a5900df (patch)
tree7b75741a1d38b5da1ee79e877709b6b4723c4713 /src/kernel/lib
parent5cac9acd3aedc8043d4272d93c56805c46ff6214 (diff)
downloadTCE-e8cf65c07d78e3cfbac953b1b97c51998a5900df.tar.gz
TCE-e8cf65c07d78e3cfbac953b1b97c51998a5900df.zip
Now using Doug Lea's malloc in kernel land. Next: same in userland.
Diffstat (limited to 'src/kernel/lib')
-rw-r--r--src/kernel/lib/std.c11
-rw-r--r--src/kernel/lib/std.h14
2 files changed, 25 insertions, 0 deletions
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 <types.h> /* For size_t */
+
+void abort();
+#define sbrk ksbrk
+#define brk kbrk
+
+extern int errno;
+
+#endif