pagetable.cc revision 7902
18528SN/A/* 28528SN/A * Copyright (c) 2007 The Hewlett-Packard Development Company 38528SN/A * All rights reserved. 48825Snilay@cs.wisc.edu * 58528SN/A * The license below extends only to copyright in the software and shall 68528SN/A * not be construed as granting a license to any other intellectual 78528SN/A * property including but not limited to intellectual property relating 88528SN/A * to a hardware implementation of the functionality of the software 98528SN/A * licensed hereunder. You may use the software subject to the license 108528SN/A * terms below provided that you ensure that this notice is replicated 118891SAli.Saidi@ARM.com * unmodified and in its entirety in all distributions of the software, 128891SAli.Saidi@ARM.com * modified or unmodified, in source code or in binary form. 139536SAli.Saidi@ARM.com * 148528SN/A * Redistribution and use in source and binary forms, with or without 159348SAli.Saidi@ARM.com * modification, are permitted provided that the following conditions are 169265SAli.Saidi@ARM.com * met: redistributions of source code must retain the above copyright 179055Ssaidi@eecs.umich.edu * notice, this list of conditions and the following disclaimer; 189348SAli.Saidi@ARM.com * redistributions in binary form must reproduce the above copyright 198528SN/A * notice, this list of conditions and the following disclaimer in the 208528SN/A * documentation and/or other materials provided with the distribution; 218528SN/A * neither the name of the copyright holders nor the names of its 229536SAli.Saidi@ARM.com * contributors may be used to endorse or promote products derived from 238528SN/A * this software without specific prior written permission. 248528SN/A * 258528SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 269449SAli.Saidi@ARM.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 279481Snilay@cs.wisc.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 289079SAli.Saidi@ARM.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 298660SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 308528SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 318528SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 328528SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 338528SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 348528SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 358528SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 368528SN/A * 378528SN/A * Authors: Gabe Black 388528SN/A */ 398891SAli.Saidi@ARM.com 408528SN/A#include "arch/x86/isa_traits.hh" 418528SN/A#include "arch/x86/pagetable.hh" 428528SN/A#include "sim/serialize.hh" 439348SAli.Saidi@ARM.com 448528SN/Anamespace X86ISA 458891SAli.Saidi@ARM.com{ 468721SN/A 478721SN/ATlbEntry::TlbEntry(Addr asn, Addr _vaddr, Addr _paddr) : 488891SAli.Saidi@ARM.com paddr(_paddr), vaddr(_vaddr), size(PageBytes), writable(true), user(true), 498891SAli.Saidi@ARM.com uncacheable(false), global(false), patBit(0), noExec(false) 508528SN/A{} 518528SN/A 528528SN/Avoid 538528SN/ATlbEntry::serialize(std::ostream &os) 548528SN/A{ 558528SN/A SERIALIZE_SCALAR(paddr); 568528SN/A SERIALIZE_SCALAR(vaddr); 578528SN/A SERIALIZE_SCALAR(size); 588528SN/A SERIALIZE_SCALAR(writable); 598528SN/A SERIALIZE_SCALAR(user); 608528SN/A SERIALIZE_SCALAR(uncacheable); 618528SN/A SERIALIZE_SCALAR(global); 628528SN/A SERIALIZE_SCALAR(patBit); 638528SN/A SERIALIZE_SCALAR(noExec); 648528SN/A} 658528SN/A 668528SN/Avoid 678528SN/ATlbEntry::unserialize(Checkpoint *cp, const std::string §ion) 689536SAli.Saidi@ARM.com{ 698528SN/A UNSERIALIZE_SCALAR(paddr); 708528SN/A UNSERIALIZE_SCALAR(vaddr); 718528SN/A UNSERIALIZE_SCALAR(size); 728528SN/A UNSERIALIZE_SCALAR(writable); 739481Snilay@cs.wisc.edu UNSERIALIZE_SCALAR(user); 748528SN/A UNSERIALIZE_SCALAR(uncacheable); 758528SN/A UNSERIALIZE_SCALAR(global); 768528SN/A UNSERIALIZE_SCALAR(patBit); 778528SN/A UNSERIALIZE_SCALAR(noExec); 788528SN/A} 798528SN/A 808528SN/A} 818528SN/A