projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rewrite palloc code so that it only touches the first 4 MB of RAM.
[pintos-anon]
/
src
/
threads
/
palloc.h
diff --git
a/src/threads/palloc.h
b/src/threads/palloc.h
index 5b75e5563ea3795725b88793cbc58049b8f98150..44cfb0efb406c35d2046ebb75fe57cae0b1fa31f 100644
(file)
--- a/
src/threads/palloc.h
+++ b/
src/threads/palloc.h
@@
-1,20
+1,23
@@
-#ifndef
HEADER
_PALLOC_H
-#define
HEADER_PALLOC_H 1
+#ifndef
THREADS
_PALLOC_H
+#define
THREADS_PALLOC_H
-/* Page allocator. Hands out memory in page-size chunks.
- See malloc.h for an allocator that hands out smaller
- chunks. */
-
-#include <stdint.h>
+#include <stddef.h>
+/* How to allocate pages. */
enum palloc_flags
{
PAL_ASSERT = 001, /* Panic on failure. */
enum palloc_flags
{
PAL_ASSERT = 001, /* Panic on failure. */
- PAL_ZERO = 002 /* Zero page contents. */
+ PAL_ZERO = 002, /* Zero page contents. */
+ PAL_USER = 004 /* User page. */
};
};
+/* Maximum number of pages to put in user pool. */
+extern size_t max_user_pages;
+
void palloc_init (void);
void palloc_init (void);
-void *palloc_get (enum palloc_flags);
-void palloc_free (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 /* palloc.h */
+#endif /*
threads/
palloc.h */