projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
391d6eb
)
Fix bug in pagedir_get_page(): didn't apply uaddr page offset to kaddr
author
Ben Pfaff
<blp@cs.stanford.edu>
Wed, 20 Oct 2004 06:12:36 +0000
(06:12 +0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Wed, 20 Oct 2004 06:12:36 +0000
(06:12 +0000)
return value (!)
src/userprog/pagedir.c
patch
|
blob
|
history
diff --git
a/src/userprog/pagedir.c
b/src/userprog/pagedir.c
index fa8f244d88220a954e43ebc880e1140d242643f4..937f433da030505e701d00f7a9bb8a15feb49dcb 100644
(file)
--- a/
src/userprog/pagedir.c
+++ b/
src/userprog/pagedir.c
@@
-121,7
+121,9
@@
void *
pagedir_get_page (uint32_t *pd, const void *uaddr)
{
uint32_t *pte = lookup_page (pd, (void *) uaddr, false);
- return pte != NULL && *pte != 0 ? pte_get_page (*pte) : NULL;
+ return (pte != NULL && *pte != 0
+ ? (uint8_t *) pte_get_page (*pte) + pg_ofs (uaddr)
+ : NULL);
}
/* Clears any mapping for user virtual address UPAGE in page