PKUOS - Pintos
Pintos source browser for PKU Operating System course
pagedir.h
Go to the documentation of this file.
1#ifndef USERPROG_PAGEDIR_H
2#define USERPROG_PAGEDIR_H
3
4#include <stdbool.h>
5#include <stdint.h>
6
9bool pagedir_set_page (uint32_t *pd, void *upage, void *kpage, bool rw);
10void *pagedir_get_page (uint32_t *pd, const void *upage);
11void pagedir_clear_page (uint32_t *pd, void *upage);
12bool pagedir_is_dirty (uint32_t *pd, const void *upage);
13void pagedir_set_dirty (uint32_t *pd, const void *upage, bool dirty);
14bool pagedir_is_accessed (uint32_t *pd, const void *upage);
15void pagedir_set_accessed (uint32_t *pd, const void *upage, bool accessed);
16void pagedir_activate (uint32_t *pd);
17
18#endif /**< userprog/pagedir.h */
uint32_t * pagedir_create(void)
Creates a new page directory that has mappings for kernel virtual addresses, but none for user virtua...
Definition: pagedir.c:17
void pagedir_set_accessed(uint32_t *pd, const void *upage, bool accessed)
Sets the accessed bit to ACCESSED in the PTE for virtual page VPAGE in PD.
Definition: pagedir.c:202
void pagedir_set_dirty(uint32_t *pd, const void *upage, bool dirty)
Set the dirty bit to DIRTY in the PTE for virtual page VPAGE in PD.
Definition: pagedir.c:173
bool pagedir_is_accessed(uint32_t *pd, const void *upage)
Returns true if the PTE for virtual page VPAGE in PD has been accessed recently, that is,...
Definition: pagedir.c:193
void pagedir_clear_page(uint32_t *pd, void *upage)
Marks user virtual page UPAGE "not present" in page directory PD.
Definition: pagedir.c:144
bool pagedir_is_dirty(uint32_t *pd, const void *upage)
Returns true if the PTE for virtual page VPAGE in PD is dirty, that is, if the page has been modified...
Definition: pagedir.c:164
void pagedir_destroy(uint32_t *pd)
Destroys page directory PD, freeing all the pages it references.
Definition: pagedir.c:28
void pagedir_activate(uint32_t *pd)
userprog/pagedir.h
Definition: pagedir.c:220
bool pagedir_set_page(uint32_t *pd, void *upage, void *kpage, bool rw)
Adds a mapping in page directory PD from user virtual page UPAGE to the physical frame identified by ...
Definition: pagedir.c:99
void * pagedir_get_page(uint32_t *pd, const void *upage)
Looks up the physical address that corresponds to user virtual address UADDR in PD.
Definition: pagedir.c:126
unsigned int uint32_t
Definition: stdint.h:26