projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
12c2ab6
)
Improve comments.
author
Ben Pfaff
<blp@cs.stanford.edu>
Thu, 20 Apr 2006 05:03:50 +0000
(
05:03
+0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Thu, 20 Apr 2006 05:03:50 +0000
(
05:03
+0000)
src/threads/mmu.h
patch
|
blob
|
history
diff --git
a/src/threads/mmu.h
b/src/threads/mmu.h
index e635b1ec8bb3fad7e00bfd85b53df32986c6de31..9f71d4a3a9d2b970264371eceb310da098a25d6c 100644
(file)
--- a/
src/threads/mmu.h
+++ b/
src/threads/mmu.h
@@
-9,24
+9,24
@@
/* Virtual to physical translation works like this on an x86:
/* Virtual to physical translation works like this on an x86:
- - The top 10 bits of the virtual address (bits 22:3
2
) are used
+ - The top 10 bits of the virtual address (bits 22:3
1
) are used
to index into the page directory. If the PDE is marked
"present," the physical address of a page table is read from
the PDE thus obtained. If the PDE is marked "not present"
then a page fault occurs.
to index into the page directory. If the PDE is marked
"present," the physical address of a page table is read from
the PDE thus obtained. If the PDE is marked "not present"
then a page fault occurs.
- - The next 10 bits of the virtual address (bits 12:2
2
) are
+ - The next 10 bits of the virtual address (bits 12:2
1
) are
used to index into the page table. If the PTE is marked
"present," the physical address of a data page is read from
the PTE thus obtained. If the PTE is marked "not present"
then a page fault occurs.
used to index into the page table. If the PTE is marked
"present," the physical address of a data page is read from
the PTE thus obtained. If the PTE is marked "not present"
then a page fault occurs.
- - The bottom 12 bits of the virtual address (bits 0:1
2
) are
+ - The bottom 12 bits of the virtual address (bits 0:1
1
) are
added to the data page's physical base address, producing
the final physical address.
added to the data page's physical base address, producing
the final physical address.
-
32 22 12
0
+
31 22 21 12 11
0
+--------------------------------------------------------------------+
| Page Directory Index | Page Table Index | Page Offset |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| Page Directory Index | Page Table Index | Page Offset |
+--------------------------------------------------------------------+
@@
-147,7
+147,7
@@
vtop (const void *vaddr)
PDEs and PTEs share a common format:
PDEs and PTEs share a common format:
- 3
2 12
0
+ 3
1 12 11
0
+------------------------------------+------------------------+
| Physical Address | Flags |
+------------------------------------+------------------------+
+------------------------------------+------------------------+
| Physical Address | Flags |
+------------------------------------+------------------------+