CS318 - Pintos
Pintos source browser for JHU CS318 course
src
threads
palloc.h
Go to the documentation of this file.
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
14
void
palloc_init
(
size_t
user_page_limit
);
15
void
*
palloc_get_page
(
enum
palloc_flags
);
16
void
*
palloc_get_multiple
(
enum
palloc_flags
,
size_t
page_cnt);
17
void
palloc_free_page
(
void
*);
18
void
palloc_free_multiple
(
void
*,
size_t
page_cnt);
19
20
#endif
/**< threads/palloc.h */
PAL_ZERO
Zero page contents.
Definition:
palloc.h:10
user_page_limit
static size_t user_page_limit
-ul: Maximum number of pages to put into palloc's user pool.
Definition:
init.c:58
PAL_ASSERT
Panic on failure.
Definition:
palloc.h:9
palloc_free_page
void palloc_free_page(void *)
Frees the page at PAGE.
Definition:
palloc.c:146
PAL_USER
User page.
Definition:
palloc.h:11
palloc_get_multiple
void * palloc_get_multiple(enum palloc_flags, size_t page_cnt)
Obtains and returns a group of PAGE_CNT contiguous free pages.
Definition:
palloc.c:71
palloc_init
void palloc_init(size_t user_page_limit)
Initializes the page allocator.
Definition:
palloc.c:46
palloc_get_page
void * palloc_get_page(enum palloc_flags)
Obtains a single free page and returns its kernel virtual address.
Definition:
palloc.c:111
palloc_flags
palloc_flags
How to allocate pages.
Definition:
palloc.h:7
palloc_free_multiple
void palloc_free_multiple(void *, size_t page_cnt)
threads/palloc.h
Definition:
palloc.c:118
stddef.h
Generated on Thu Aug 22 2019 10:19:15 for CS318 - Pintos by
1.8.16