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; --- 14 unchanged lines hidden (view full) --- 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * 28 * Authors: Ali Saidi 29 */ 30 |
31#include <cstring> 32 |
33#include "arch/sparc/asi.hh" 34#include "arch/sparc/miscregfile.hh" 35#include "arch/sparc/tlb.hh" 36#include "base/bitfield.hh" 37#include "base/trace.hh" 38#include "cpu/thread_context.hh" 39#include "cpu/base.hh" 40#include "mem/packet_access.hh" --- 9 unchanged lines hidden (view full) --- 50 : SimObject(name), size(s), usedEntries(0), lastReplaced(0), 51 cacheValid(false) 52{ 53 // To make this work you'll have to change the hypervisor and OS 54 if (size > 64) 55 fatal("SPARC T1 TLB registers don't support more than 64 TLB entries."); 56 57 tlb = new TlbEntry[size]; |
58 std::memset(tlb, 0, sizeof(TlbEntry) * size); |
59 60 for (int x = 0; x < size; x++) 61 freeList.push_back(&tlb[x]); 62} 63 64void 65TLB::clearUsedBits() 66{ --- 100 unchanged lines hidden (view full) --- 167 // Update the last ently if their all locked 168 if (!new_entry) { 169 new_entry = &tlb[size-1]; 170 } 171 172 freeList.remove(new_entry); 173 if (new_entry->valid && new_entry->used) 174 usedEntries--; |
175 if (new_entry->valid) 176 lookupTable.erase(new_entry->range); |
177 |
178 |
179 assert(PTE.valid()); 180 new_entry->range.va = va; 181 new_entry->range.size = PTE.size() - 1; 182 new_entry->range.partitionId = partition_id; 183 new_entry->range.contextId = context_id; 184 new_entry->range.real = real; 185 new_entry->pte = PTE; 186 new_entry->used = true;; --- 387 unchanged lines hidden (view full) --- 574 ASI asi; 575 asi = (ASI)req->getAsi(); 576 bool implicit = false; 577 bool hpriv = bits(tlbdata,0,0); 578 579 DPRINTF(TLB, "TLB: DTB Request to translate va=%#x size=%d asi=%#x\n", 580 vaddr, size, asi); 581 |
582 if (lookupTable.size() != 64 - freeList.size()) 583 panic("Lookup table size: %d tlb size: %d\n", lookupTable.size(), 584 freeList.size()); |
585 if (asi == ASI_IMPLICIT) 586 implicit = true; 587 588 if (hpriv && implicit) { 589 req->setPaddr(vaddr & PAddrImplMask); 590 return NoFault; 591 } 592 --- 712 unchanged lines hidden --- |