projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Irq 7 is special. It is not just the parallel port. It can also be a
[pintos-anon]
/
src
/
userprog
/
pagedir.c
diff --git
a/src/userprog/pagedir.c
b/src/userprog/pagedir.c
index 013f8aa957635b54e9ee4a8ca5cc469d52b3cc50..7d993755ca2b5e10e3e0fe2cb3d530b560dc60c6 100644
(file)
--- a/
src/userprog/pagedir.c
+++ b/
src/userprog/pagedir.c
@@
-3,7
+3,7
@@
#include <stddef.h>
#include <string.h>
#include "threads/init.h"
#include <stddef.h>
#include <string.h>
#include "threads/init.h"
-#include "threads/
mmu
.h"
+#include "threads/
pte
.h"
#include "threads/palloc.h"
static uint32_t *active_pd (void);
#include "threads/palloc.h"
static uint32_t *active_pd (void);
@@
-34,13
+34,13
@@
pagedir_destroy (uint32_t *pd)
ASSERT (pd != base_page_dir);
for (pde = pd; pde < pd + pd_no (PHYS_BASE); pde++)
ASSERT (pd != base_page_dir);
for (pde = pd; pde < pd + pd_no (PHYS_BASE); pde++)
- if (*pde & P
G
_P)
+ if (*pde & P
TE
_P)
{
uint32_t *pt = pde_get_pt (*pde);
uint32_t *pte;
for (pte = pt; pte < pt + PGSIZE / sizeof *pte; pte++)
{
uint32_t *pt = pde_get_pt (*pde);
uint32_t *pte;
for (pte = pt; pte < pt + PGSIZE / sizeof *pte; pte++)
- if (*pte & P
G
_P)
+ if (*pte & P
TE
_P)
palloc_free_page (pte_get_page (*pte));
palloc_free_page (pt);
}
palloc_free_page (pte_get_page (*pte));
palloc_free_page (pt);
}
@@
-110,7
+110,7
@@
pagedir_set_page (uint32_t *pd, void *upage, void *kpage, bool writable)
if (pte != NULL)
{
if (pte != NULL)
{
- ASSERT ((*pte & P
G
_P) == 0);
+ ASSERT ((*pte & P
TE
_P) == 0);
*pte = pte_create_user (kpage, writable);
return true;
}
*pte = pte_create_user (kpage, writable);
return true;
}
@@
-130,7
+130,7
@@
pagedir_get_page (uint32_t *pd, const void *uaddr)
ASSERT (is_user_vaddr (uaddr));
pte = lookup_page (pd, uaddr, false);
ASSERT (is_user_vaddr (uaddr));
pte = lookup_page (pd, uaddr, false);
- if (pte != NULL && (*pte & P
G
_P) != 0)
+ if (pte != NULL && (*pte & P
TE
_P) != 0)
return pte_get_page (*pte) + pg_ofs (uaddr);
else
return NULL;
return pte_get_page (*pte) + pg_ofs (uaddr);
else
return NULL;
@@
-149,9
+149,9
@@
pagedir_clear_page (uint32_t *pd, void *upage)
ASSERT (is_user_vaddr (upage));
pte = lookup_page (pd, upage, false);
ASSERT (is_user_vaddr (upage));
pte = lookup_page (pd, upage, false);
- if (pte != NULL && (*pte & P
G
_P) != 0)
+ if (pte != NULL && (*pte & P
TE
_P) != 0)
{
{
- *pte &= ~P
G
_P;
+ *pte &= ~P
TE
_P;
invalidate_pagedir (pd);
}
}
invalidate_pagedir (pd);
}
}
@@
-164,7
+164,7
@@
bool
pagedir_is_dirty (uint32_t *pd, const void *vpage)
{
uint32_t *pte = lookup_page (pd, vpage, false);
pagedir_is_dirty (uint32_t *pd, const void *vpage)
{
uint32_t *pte = lookup_page (pd, vpage, false);
- return pte != NULL && (*pte & P
G
_D) != 0;
+ return pte != NULL && (*pte & P
TE
_D) != 0;
}
/* Set the dirty bit to DIRTY in the PTE for virtual page VPAGE
}
/* Set the dirty bit to DIRTY in the PTE for virtual page VPAGE
@@
-176,10
+176,10
@@
pagedir_set_dirty (uint32_t *pd, const void *vpage, bool dirty)
if (pte != NULL)
{
if (dirty)
if (pte != NULL)
{
if (dirty)
- *pte |= P
G
_D;
+ *pte |= P
TE
_D;
else
{
else
{
- *pte &= ~(uint32_t) P
G
_D;
+ *pte &= ~(uint32_t) P
TE
_D;
invalidate_pagedir (pd);
}
}
invalidate_pagedir (pd);
}
}
@@
-193,7
+193,7
@@
bool
pagedir_is_accessed (uint32_t *pd, const void *vpage)
{
uint32_t *pte = lookup_page (pd, vpage, false);
pagedir_is_accessed (uint32_t *pd, const void *vpage)
{
uint32_t *pte = lookup_page (pd, vpage, false);
- return pte != NULL && (*pte & P
G
_A) != 0;
+ return pte != NULL && (*pte & P
TE
_A) != 0;
}
/* Sets the accessed bit to ACCESSED in the PTE for virtual page
}
/* Sets the accessed bit to ACCESSED in the PTE for virtual page
@@
-205,10
+205,10
@@
pagedir_set_accessed (uint32_t *pd, const void *vpage, bool accessed)
if (pte != NULL)
{
if (accessed)
if (pte != NULL)
{
if (accessed)
- *pte |= P
G
_A;
+ *pte |= P
TE
_A;
else
{
else
{
- *pte &= ~(uint32_t) P
G
_A;
+ *pte &= ~(uint32_t) P
TE
_A;
invalidate_pagedir (pd);
}
}
invalidate_pagedir (pd);
}
}