tlb.cc (8575:02332ce6d7da) tlb.cc (8607:5fb918115c07)
1/*
2 * Copyright (c) 2001-2005 The Regents of The University of Michigan
3 * Copyright (c) 2007 MIPS Technologies, Inc.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

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

124 assert(Index<size);
125 return &table[Index];
126}
127
128int
129TLB::probeEntry(Addr vpn, uint8_t asn) const
130{
131 // assume not found...
1/*
2 * Copyright (c) 2001-2005 The Regents of The University of Michigan
3 * Copyright (c) 2007 MIPS Technologies, Inc.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

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

124 assert(Index<size);
125 return &table[Index];
126}
127
128int
129TLB::probeEntry(Addr vpn, uint8_t asn) const
130{
131 // assume not found...
132 PTE *retval = NULL;
133 int Ind = -1;
134 PageTable::const_iterator i = lookupTable.find(vpn);
135 if (i != lookupTable.end()) {
136 while (i->first == vpn) {
137 int index = i->second;
138 PTE *pte = &table[index];
139
140 /* 1KB TLB Lookup code - from MIPS ARM Volume III - Rev. 2.50 */
141 Addr Mask = pte->Mask;
142 Addr InvMask = ~Mask;
143 Addr VPN = pte->VPN;
144 if (((vpn & InvMask) == (VPN & InvMask)) &&
145 (pte->G || (asn == pte->asid))) {
146 // We have a VPN + ASID Match
132 int Ind = -1;
133 PageTable::const_iterator i = lookupTable.find(vpn);
134 if (i != lookupTable.end()) {
135 while (i->first == vpn) {
136 int index = i->second;
137 PTE *pte = &table[index];
138
139 /* 1KB TLB Lookup code - from MIPS ARM Volume III - Rev. 2.50 */
140 Addr Mask = pte->Mask;
141 Addr InvMask = ~Mask;
142 Addr VPN = pte->VPN;
143 if (((vpn & InvMask) == (VPN & InvMask)) &&
144 (pte->G || (asn == pte->asid))) {
145 // We have a VPN + ASID Match
147 retval = pte;
148 Ind = index;
149 break;
150 }
151 ++i;
152 }
153 }
154 DPRINTF(MipsPRA,"VPN: %x, asid: %d, Result of TLBP: %d\n",vpn,asn,Ind);
155 return Ind;

--- 354 unchanged lines hidden ---
146 Ind = index;
147 break;
148 }
149 ++i;
150 }
151 }
152 DPRINTF(MipsPRA,"VPN: %x, asid: %d, Result of TLBP: %d\n",vpn,asn,Ind);
153 return Ind;

--- 354 unchanged lines hidden ---