tlb.cc (4375:b89532cd1b7d) tlb.cc (4428:05bab139ebe0)
1/*
2 * Copyright (c) 2001-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 199 unchanged lines hidden (view full) ---

208TLB::flushAddr(Addr addr, uint8_t asn)
209{
210 VAddr vaddr = addr;
211
212 PageTable::iterator i = lookupTable.find(vaddr.vpn());
213 if (i == lookupTable.end())
214 return;
215
1/*
2 * Copyright (c) 2001-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 199 unchanged lines hidden (view full) ---

208TLB::flushAddr(Addr addr, uint8_t asn)
209{
210 VAddr vaddr = addr;
211
212 PageTable::iterator i = lookupTable.find(vaddr.vpn());
213 if (i == lookupTable.end())
214 return;
215
216 while (i->first == vaddr.vpn()) {
216 while (i != lookupTable.end() && i->first == vaddr.vpn()) {
217 int index = i->second;
218 PTE *pte = &table[index];
219 assert(pte->valid);
220
221 if (vaddr.vpn() == pte->tag && (pte->asma || pte->asn == asn)) {
222 DPRINTF(TLB, "flushaddr @%d: %#x -> %#x\n", index, vaddr.vpn(),
223 pte->ppn);
224
225 // invalidate this entry
226 pte->valid = false;
227
217 int index = i->second;
218 PTE *pte = &table[index];
219 assert(pte->valid);
220
221 if (vaddr.vpn() == pte->tag && (pte->asma || pte->asn == asn)) {
222 DPRINTF(TLB, "flushaddr @%d: %#x -> %#x\n", index, vaddr.vpn(),
223 pte->ppn);
224
225 // invalidate this entry
226 pte->valid = false;
227
228 lookupTable.erase(i);
228 lookupTable.erase(i++);
229 } else {
230 ++i;
229 }
231 }
230
231 ++i;
232 }
233}
234
235
236void
237TLB::serialize(ostream &os)
238{
239 SERIALIZE_SCALAR(size);

--- 47 unchanged lines hidden (view full) ---

287
288 accesses = hits + misses;
289}
290
291
292Fault
293ITB::translate(RequestPtr &req, ThreadContext *tc) const
294{
232 }
233}
234
235
236void
237TLB::serialize(ostream &os)
238{
239 SERIALIZE_SCALAR(size);

--- 47 unchanged lines hidden (view full) ---

287
288 accesses = hits + misses;
289}
290
291
292Fault
293ITB::translate(RequestPtr &req, ThreadContext *tc) const
294{
295 //If this is a pal pc, then set PHYSICAL
296 if(FULL_SYSTEM && PcPAL(req->getPC()))
297 req->setFlags(req->getFlags() | PHYSICAL);
298
299 if (PcPAL(req->getPC())) {
300 // strip off PAL PC marker (lsb is 1)
301 req->setPaddr((req->getVaddr() & ~3) & PAddrImplMask);
302 hits++;
303 return NoFault;
304 }
305
306 if (req->getFlags() & PHYSICAL) {

--- 337 unchanged lines hidden ---
295 if (PcPAL(req->getPC())) {
296 // strip off PAL PC marker (lsb is 1)
297 req->setPaddr((req->getVaddr() & ~3) & PAddrImplMask);
298 hits++;
299 return NoFault;
300 }
301
302 if (req->getFlags() & PHYSICAL) {

--- 337 unchanged lines hidden ---