diff options
| author | klaar36 <klas.arvidsson@liu.se> | 2015-03-20 17:30:24 +0100 |
|---|---|---|
| committer | klaar36 <klas.arvidsson@liu.se> | 2015-03-20 17:30:24 +0100 |
| commit | e7bc50ca8ffcaa6ed68ebd2315f78b0f5a7d10ad (patch) | |
| tree | 4de97af7207676b69cb6a9aba8cb443cc134855d /src/threads/palloc.h | |
| parent | b0418a24e709f0632d2ede5b0f327c422931939b (diff) | |
| download | pintos-rs-e7bc50ca8ffcaa6ed68ebd2315f78b0f5a7d10ad.tar.gz | |
Initial Pintos
Diffstat (limited to 'src/threads/palloc.h')
| -rw-r--r-- | src/threads/palloc.h | 24 |
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 */ |
