Deleted Added
sdiff udiff text old ( 4957:f858d0b8ef99 ) new ( 4962:4e939f4629c3 )
full compact
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;

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

75
76// look up an entry in the TLB
77PTE *
78TLB::lookup(Addr vpn, uint8_t asn) const
79{
80 // assume not found...
81 PTE *retval = NULL;
82
83 if (PTECache[0] && vpn == PTECache[0]->tag &&
84 (PTECache[0]->asma || PTECache[0]->asn == asn))
85 retval = PTECache[0];
86 else if (PTECache[1] && vpn == PTECache[1]->tag &&
87 (PTECache[1]->asma || PTECache[1]->asn == asn))
88 retval = PTECache[1];
89 else if (PTECache[2] && vpn == PTECache[2]->tag &&
90 (PTECache[2]->asma || PTECache[2]->asn == asn))
91 retval = PTECache[2];
92 else {
93 PageTable::const_iterator i = lookupTable.find(vpn);
94 if (i != lookupTable.end()) {
95 while (i->first == vpn) {
96 int index = i->second;
97 PTE *pte = &table[index];
98 assert(pte->valid);
99 if (vpn == pte->tag && (pte->asma || pte->asn == asn)) {
100 retval = pte;
101 break;
102 }
103
104 ++i;
105 }
106 }
107 }
108

--- 522 unchanged lines hidden ---