pagetable.cc revision 10905:a6ca6831e775
12810SN/A/*
212724Snikos.nikoleris@arm.com * Copyright (c) 2007 The Hewlett-Packard Development Company
38856Sandreas.hansson@arm.com * All rights reserved.
48856Sandreas.hansson@arm.com *
58856Sandreas.hansson@arm.com * The license below extends only to copyright in the software and shall
68856Sandreas.hansson@arm.com * not be construed as granting a license to any other intellectual
78856Sandreas.hansson@arm.com * property including but not limited to intellectual property relating
88856Sandreas.hansson@arm.com * to a hardware implementation of the functionality of the software
98856Sandreas.hansson@arm.com * licensed hereunder.  You may use the software subject to the license
108856Sandreas.hansson@arm.com * terms below provided that you ensure that this notice is replicated
118856Sandreas.hansson@arm.com * unmodified and in its entirety in all distributions of the software,
128856Sandreas.hansson@arm.com * modified or unmodified, in source code or in binary form.
138856Sandreas.hansson@arm.com *
142810SN/A * Redistribution and use in source and binary forms, with or without
152810SN/A * modification, are permitted provided that the following conditions are
162810SN/A * met: redistributions of source code must retain the above copyright
172810SN/A * notice, this list of conditions and the following disclaimer;
182810SN/A * redistributions in binary form must reproduce the above copyright
192810SN/A * notice, this list of conditions and the following disclaimer in the
202810SN/A * documentation and/or other materials provided with the distribution;
212810SN/A * neither the name of the copyright holders nor the names of its
222810SN/A * contributors may be used to endorse or promote products derived from
232810SN/A * this software without specific prior written permission.
242810SN/A *
252810SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
262810SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
272810SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
282810SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
292810SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
302810SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
312810SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
322810SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
332810SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
342810SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
352810SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
362810SN/A *
372810SN/A * Authors: Gabe Black
382810SN/A */
392810SN/A
402810SN/A#include <cmath>
4112724Snikos.nikoleris@arm.com#include "arch/x86/isa_traits.hh"
422810SN/A#include "arch/x86/pagetable.hh"
432810SN/A#include "sim/serialize.hh"
442810SN/A
452810SN/Anamespace X86ISA
462810SN/A{
472810SN/A
482810SN/ATlbEntry::TlbEntry()
4911486Snikos.nikoleris@arm.com    : paddr(0), vaddr(0), logBytes(0), writable(0),
5011486Snikos.nikoleris@arm.com      user(true), uncacheable(0), global(false), patBit(0),
5112724Snikos.nikoleris@arm.com      noExec(false), lruSeq(0)
5212724Snikos.nikoleris@arm.com{
538232Snate@binkert.org}
5412724Snikos.nikoleris@arm.com
5512724Snikos.nikoleris@arm.comTlbEntry::TlbEntry(Addr asn, Addr _vaddr, Addr _paddr,
5611486Snikos.nikoleris@arm.com                   bool uncacheable, bool read_only) :
5712724Snikos.nikoleris@arm.com    paddr(_paddr), vaddr(_vaddr), logBytes(PageShift), writable(!read_only),
5812724Snikos.nikoleris@arm.com    user(true), uncacheable(uncacheable), global(false), patBit(0),
5912724Snikos.nikoleris@arm.com    noExec(false), lruSeq(0)
6012724Snikos.nikoleris@arm.com{}
6112724Snikos.nikoleris@arm.com
6212724Snikos.nikoleris@arm.comvoid
6312724Snikos.nikoleris@arm.comTlbEntry::serialize(CheckpointOut &cp) const
642810SN/A{
652810SN/A    SERIALIZE_SCALAR(paddr);
662810SN/A    SERIALIZE_SCALAR(vaddr);
678856Sandreas.hansson@arm.com    SERIALIZE_SCALAR(logBytes);
688856Sandreas.hansson@arm.com    SERIALIZE_SCALAR(writable);
698856Sandreas.hansson@arm.com    SERIALIZE_SCALAR(user);
708922Swilliam.wang@arm.com    SERIALIZE_SCALAR(uncacheable);
7112084Sspwilson2@wisc.edu    SERIALIZE_SCALAR(global);
7212084Sspwilson2@wisc.edu    SERIALIZE_SCALAR(patBit);
738856Sandreas.hansson@arm.com    SERIALIZE_SCALAR(noExec);
748856Sandreas.hansson@arm.com    SERIALIZE_SCALAR(lruSeq);
754475SN/A}
7611053Sandreas.hansson@arm.com
775034SN/Avoid
7812724Snikos.nikoleris@arm.comTlbEntry::unserialize(CheckpointIn &cp)
7912724Snikos.nikoleris@arm.com{
8011377Sandreas.hansson@arm.com    UNSERIALIZE_SCALAR(paddr);
8111377Sandreas.hansson@arm.com    UNSERIALIZE_SCALAR(vaddr);
8212724Snikos.nikoleris@arm.com    UNSERIALIZE_SCALAR(logBytes);
8312724Snikos.nikoleris@arm.com    UNSERIALIZE_SCALAR(writable);
8412724Snikos.nikoleris@arm.com    UNSERIALIZE_SCALAR(user);
8512724Snikos.nikoleris@arm.com    UNSERIALIZE_SCALAR(uncacheable);
8612724Snikos.nikoleris@arm.com    UNSERIALIZE_SCALAR(global);
8712724Snikos.nikoleris@arm.com    UNSERIALIZE_SCALAR(patBit);
8812724Snikos.nikoleris@arm.com    UNSERIALIZE_SCALAR(noExec);
8912724Snikos.nikoleris@arm.com    UNSERIALIZE_SCALAR(lruSeq);
9011053Sandreas.hansson@arm.com}
9111722Ssophiane.senni@gmail.com
9211722Ssophiane.senni@gmail.com}
9311722Ssophiane.senni@gmail.com