summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2010-05-21 16:03:32 -0500
committerPatrick Williams <iawillia@us.ibm.com>2010-05-21 16:03:32 -0500
commita0e3bdeaed824af328e0bafc59e69ebfd1b3de4e (patch)
tree469c99443aface768c7b70a018d34409cec432d8 /src/include
parent343cc75d83b7d71a23adb49e0d530eb59997a154 (diff)
downloadtalos-hostboot-a0e3bdeaed824af328e0bafc59e69ebfd1b3de4e.tar.gz
talos-hostboot-a0e3bdeaed824af328e0bafc59e69ebfd1b3de4e.zip
malloc / free support
Diffstat (limited to 'src/include')
-rw-r--r--src/include/kernel/heapmgr.H4
-rw-r--r--src/include/kernel/pagemgr.H2
-rw-r--r--src/include/stdlib.h18
3 files changed, 24 insertions, 0 deletions
diff --git a/src/include/kernel/heapmgr.H b/src/include/kernel/heapmgr.H
index 41a3e2cf5..6e189da93 100644
--- a/src/include/kernel/heapmgr.H
+++ b/src/include/kernel/heapmgr.H
@@ -7,12 +7,16 @@
class HeapManager
{
public:
+ static void init();
+
static void* allocate(size_t n);
static void free(void *);
enum
{
BUCKETS = 8,
+
+ MAX_ALLOC_SIZE = (1 << (BUCKETS + 4)) - 8,
};
protected:
diff --git a/src/include/kernel/pagemgr.H b/src/include/kernel/pagemgr.H
index b99cedff2..fded2c6c1 100644
--- a/src/include/kernel/pagemgr.H
+++ b/src/include/kernel/pagemgr.H
@@ -11,6 +11,8 @@
class PageManager
{
public:
+ static void init();
+
static void* allocatePage(size_t n = 1);
static void freePage(void*, size_t n = 1);
diff --git a/src/include/stdlib.h b/src/include/stdlib.h
new file mode 100644
index 000000000..46c463119
--- /dev/null
+++ b/src/include/stdlib.h
@@ -0,0 +1,18 @@
+#ifndef __STDLIB_H
+#define __STDLIB_H
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+void* malloc(size_t);
+void free(void*);
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif
OpenPOWER on IntegriCloud