summaryrefslogtreecommitdiff
path: root/src/arch/x86/vtophys.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2012-04-14 23:24:18 -0700
committerGabe Black <gblack@eecs.umich.edu>2012-04-14 23:24:18 -0700
commitaacb676220ac1e6049304bef31a39090487da71e (patch)
tree3a5b4c951e6be13b59b2a0574e8b31032911acf8 /src/arch/x86/vtophys.cc
parentd6031d72df091a71567a7f43649d62b24c80f496 (diff)
downloadgem5-aacb676220ac1e6049304bef31a39090487da71e.tar.xz
X86: Use the AddrTrie class to implement the TLB.
This change also adjusts the TlbEntry class so that it stores the number of address bits wide a page is rather than its size in bytes. In other words, instead of storing 4K for a 4K page, it stores 12. 12 is easy to turn into 4K, but it's a little harder going the other way.
Diffstat (limited to 'src/arch/x86/vtophys.cc')
-rw-r--r--src/arch/x86/vtophys.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/arch/x86/vtophys.cc b/src/arch/x86/vtophys.cc
index e4abfca59..9fd9cc78d 100644
--- a/src/arch/x86/vtophys.cc
+++ b/src/arch/x86/vtophys.cc
@@ -61,12 +61,13 @@ namespace X86ISA
vtophys(ThreadContext *tc, Addr vaddr)
{
Walker *walker = tc->getDTBPtr()->getWalker();
- Addr size;
+ unsigned logBytes;
Addr addr = vaddr;
- Fault fault = walker->startFunctional(tc, addr, size, BaseTLB::Read);
+ Fault fault = walker->startFunctional(
+ tc, addr, logBytes, BaseTLB::Read);
if (fault != NoFault)
panic("vtophys page walk returned fault\n");
- Addr masked_addr = vaddr & (size - 1);
+ Addr masked_addr = vaddr & mask(logBytes);
Addr paddr = addr | masked_addr;
DPRINTF(VtoPhys, "vtophys(%#x) -> %#x\n", vaddr, paddr);
return paddr;