tlb.cc (9738:304a37519d11) tlb.cc (9818:ebd7d3e04b5f)
1/*
2 * Copyright (c) 2007-2008 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

434TLB::getWalker()
435{
436 return walker;
437}
438
439void
440TLB::serialize(std::ostream &os)
441{
1/*
2 * Copyright (c) 2007-2008 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

434TLB::getWalker()
435{
436 return walker;
437}
438
439void
440TLB::serialize(std::ostream &os)
441{
442 // Only store the entries in use.
443 uint32_t _size = size - freeList.size();
444 SERIALIZE_SCALAR(_size);
445 SERIALIZE_SCALAR(lruSeq);
446
447 uint32_t _count = 0;
448
449 for (uint32_t x = 0; x < size; x++) {
450 if (tlb[x].trieHandle != NULL) {
451 os << "\n[" << csprintf("%s.Entry%d", name(), _count) << "]\n";
452 tlb[x].serialize(os);
453 _count++;
454 }
455 }
442}
443
444void
445TLB::unserialize(Checkpoint *cp, const std::string &section)
446{
456}
457
458void
459TLB::unserialize(Checkpoint *cp, const std::string &section)
460{
461 // Do not allow to restore with a smaller tlb.
462 uint32_t _size;
463 UNSERIALIZE_SCALAR(_size);
464 if (_size > size) {
465 fatal("TLB size less than the one in checkpoint!");
466 }
467
468 UNSERIALIZE_SCALAR(lruSeq);
469
470 for (uint32_t x = 0; x < _size; x++) {
471 TlbEntry *newEntry = freeList.front();
472 freeList.pop_front();
473
474 newEntry->unserialize(cp, csprintf("%s.Entry%d", name(), x));
475 newEntry->trieHandle = trie.insert(newEntry->vaddr,
476 TlbEntryTrie::MaxBits - newEntry->logBytes, newEntry);
477 }
447}
448
449BaseMasterPort *
450TLB::getMasterPort()
451{
452 return &walker->getMasterPort("port");
453}
454
455} // namespace X86ISA
456
457X86ISA::TLB *
458X86TLBParams::create()
459{
460 return new X86ISA::TLB(this);
461}
478}
479
480BaseMasterPort *
481TLB::getMasterPort()
482{
483 return &walker->getMasterPort("port");
484}
485
486} // namespace X86ISA
487
488X86ISA::TLB *
489X86TLBParams::create()
490{
491 return new X86ISA::TLB(this);
492}