aboutsummaryrefslogtreecommitdiffstats
path: root/src/threads/palloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/threads/palloc.h')
-rw-r--r--src/threads/palloc.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/threads/palloc.h b/src/threads/palloc.h
new file mode 100644
index 0000000..c9a4281
--- /dev/null
+++ b/src/threads/palloc.h
@@ -0,0 +1,24 @@
+#ifndef THREADS_PALLOC_H
+#define THREADS_PALLOC_H
+
+#include <stddef.h>
+
+/* How to allocate pages. */
+enum palloc_flags
+ {
+ PAL_ASSERT = 001, /* Panic on failure. */
+ PAL_ZERO = 002, /* Zero page contents. */
+ PAL_USER = 004 /* User page. */
+ };
+
+/* Maximum number of pages to put in user pool. */
+extern size_t user_page_limit;
+extern size_t free_page_limit; // klaar@ida
+
+void palloc_init (void);
+void *palloc_get_page (enum palloc_flags);
+void *palloc_get_multiple (enum palloc_flags, size_t page_cnt);
+void palloc_free_page (void *);
+void palloc_free_multiple (void *, size_t page_cnt);
+
+#endif /* threads/palloc.h */