diff options
Diffstat (limited to 'threads/palloc.h')
| -rw-r--r-- | threads/palloc.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/threads/palloc.h b/threads/palloc.h new file mode 100644 index 0000000..d7f4e0b --- /dev/null +++ b/threads/palloc.h | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | #ifndef THREADS_PALLOC_H | ||
| 2 | #define THREADS_PALLOC_H | ||
| 3 | |||
| 4 | #include <stddef.h> | ||
| 5 | |||
| 6 | /* How to allocate pages. */ | ||
| 7 | enum palloc_flags | ||
| 8 | { | ||
| 9 | PAL_ASSERT = 001, /* Panic on failure. */ | ||
| 10 | PAL_ZERO = 002, /* Zero page contents. */ | ||
| 11 | PAL_USER = 004 /* User page. */ | ||
| 12 | }; | ||
| 13 | void palloc_init (size_t user_page_limit); | ||
| 14 | void *palloc_get_page (enum palloc_flags); | ||
| 15 | void *palloc_get_multiple (enum palloc_flags, size_t page_cnt); | ||
| 16 | void palloc_free_page (void *); | ||
| 17 | void palloc_free_multiple (void *, size_t page_cnt); | ||
| 18 | void palloc_dump_used_pages (void); | ||
| 19 | |||
| 20 | #endif /* threads/palloc.h */ | ||
