pagetable.hh revision 5124
17404SAli.Saidi@ARM.com/*
212709Sgiacomo.travaglini@arm.com * Copyright (c) 2007 The Hewlett-Packard Development Company
37404SAli.Saidi@ARM.com * All rights reserved.
47404SAli.Saidi@ARM.com *
57404SAli.Saidi@ARM.com * Redistribution and use of this software in source and binary forms,
67404SAli.Saidi@ARM.com * with or without modification, are permitted provided that the
77404SAli.Saidi@ARM.com * following conditions are met:
87404SAli.Saidi@ARM.com *
97404SAli.Saidi@ARM.com * The software must be used only for Non-Commercial Use which means any
107404SAli.Saidi@ARM.com * use which is NOT directed to receiving any direct monetary
117404SAli.Saidi@ARM.com * compensation for, or commercial advantage from such use.  Illustrative
127404SAli.Saidi@ARM.com * examples of non-commercial use are academic research, personal study,
137404SAli.Saidi@ARM.com * teaching, education and corporate research & development.
147404SAli.Saidi@ARM.com * Illustrative examples of commercial use are distributing products for
157404SAli.Saidi@ARM.com * commercial advantage and providing services using the software for
167404SAli.Saidi@ARM.com * commercial advantage.
177404SAli.Saidi@ARM.com *
187404SAli.Saidi@ARM.com * If you wish to use this software or functionality therein that may be
197404SAli.Saidi@ARM.com * covered by patents for commercial use, please contact:
207404SAli.Saidi@ARM.com *     Director of Intellectual Property Licensing
217404SAli.Saidi@ARM.com *     Office of Strategy and Technology
227404SAli.Saidi@ARM.com *     Hewlett-Packard Company
237404SAli.Saidi@ARM.com *     1501 Page Mill Road
247404SAli.Saidi@ARM.com *     Palo Alto, California  94304
257404SAli.Saidi@ARM.com *
267404SAli.Saidi@ARM.com * Redistributions of source code must retain the above copyright notice,
277404SAli.Saidi@ARM.com * this list of conditions and the following disclaimer.  Redistributions
287404SAli.Saidi@ARM.com * in binary form must reproduce the above copyright notice, this list of
297404SAli.Saidi@ARM.com * conditions and the following disclaimer in the documentation and/or
307404SAli.Saidi@ARM.com * other materials provided with the distribution.  Neither the name of
317404SAli.Saidi@ARM.com * the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its
327404SAli.Saidi@ARM.com * contributors may be used to endorse or promote products derived from
337404SAli.Saidi@ARM.com * this software without specific prior written permission.  No right of
347404SAli.Saidi@ARM.com * sublicense is granted herewith.  Derivatives of the software and
357404SAli.Saidi@ARM.com * output created using the software may be prepared, but only for
367404SAli.Saidi@ARM.com * Non-Commercial Uses.  Derivatives of the software may be shared with
377404SAli.Saidi@ARM.com * others provided: (i) the others agree to abide by the list of
3810037SARM gem5 Developers * conditions herein which includes the Non-Commercial Use restrictions;
397404SAli.Saidi@ARM.com * and (ii) such Derivatives of the software include the above copyright
4010873Sandreas.sandberg@arm.com * notice to acknowledge the contribution from this software where
417404SAli.Saidi@ARM.com * applicable, this list of conditions and the disclaimer below.
4210474Sandreas.hansson@arm.com *
4310474Sandreas.hansson@arm.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
447404SAli.Saidi@ARM.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
4510037SARM gem5 Developers * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
4610037SARM gem5 Developers * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
477404SAli.Saidi@ARM.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
487728SAli.Saidi@ARM.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
497404SAli.Saidi@ARM.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
508245Snate@binkert.org * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
519152Satgutier@umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
528245Snate@binkert.org * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
538245Snate@binkert.org * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5410873Sandreas.sandberg@arm.com *
557748SAli.Saidi@ARM.com * Authors: Gabe Black
567404SAli.Saidi@ARM.com */
577404SAli.Saidi@ARM.com
587404SAli.Saidi@ARM.com#ifndef __ARCH_X86_PAGETABLE_HH__
597404SAli.Saidi@ARM.com#define __ARCH_X86_PAGETABLE_HH__
6010913Sandreas.sandberg@arm.com
6110717Sandreas.hansson@arm.com#include <iostream>
6210717Sandreas.hansson@arm.com#include <string>
6310717Sandreas.hansson@arm.com
649258SAli.Saidi@ARM.com#include "sim/host.hh"
6510621SCurtis.Dunham@arm.com#include "base/misc.hh"
6610621SCurtis.Dunham@arm.com
6712086Sspwilson2@wisc.educlass Checkpoint;
6812086Sspwilson2@wisc.edu
6912086Sspwilson2@wisc.edunamespace X86ISA
7012086Sspwilson2@wisc.edu{
7112086Sspwilson2@wisc.edu    struct VAddr
7212086Sspwilson2@wisc.edu    {
7311588SCurtis.Dunham@arm.com        VAddr(Addr a) { panic("not implemented yet."); }
7411588SCurtis.Dunham@arm.com    };
7512086Sspwilson2@wisc.edu
767439Sdam.sunwoo@arm.com    struct TlbEntry
777576SAli.Saidi@ARM.com    {
7810037SARM gem5 Developers        // The base of the physical page.
7910037SARM gem5 Developers        Addr pageStart;
8010037SARM gem5 Developers        // Read permission is always available, assuming it isn't blocked by
8110717Sandreas.hansson@arm.com        // other mechanisms.
8210037SARM gem5 Developers        bool writeable;
8310037SARM gem5 Developers        // Whether this page is accesible without being in supervisor mode.
8410037SARM gem5 Developers        bool user;
8510037SARM gem5 Developers        // Whether to use write through or write back. M5 ignores this and
8610037SARM gem5 Developers        // lets the caches handle the writeback policy.
8710037SARM gem5 Developers        //bool pwt;
8810037SARM gem5 Developers        // Whether the page is cacheable or not.
8910037SARM gem5 Developers        bool uncacheable;
9010037SARM gem5 Developers        // Whether or not to kick this page out on a write to CR3.
9110037SARM gem5 Developers        bool global;
9210037SARM gem5 Developers        // A bit used to form an index into the PAT table.
9310037SARM gem5 Developers        bool patBit;
947439Sdam.sunwoo@arm.com        // Whether or not memory on this page can be executed.
957404SAli.Saidi@ARM.com        bool noExec;
967404SAli.Saidi@ARM.com
977404SAli.Saidi@ARM.com        // The beginning of the virtual page this entry maps.
987404SAli.Saidi@ARM.com        Addr vaddr;
997404SAli.Saidi@ARM.com        // The size of the page this entry represents.
1007404SAli.Saidi@ARM.com        Addr size;
10110717Sandreas.hansson@arm.com
10210717Sandreas.hansson@arm.com        TlbEntry() {}
10310717Sandreas.hansson@arm.com        TlbEntry(Addr paddr) : pageStart(paddr) {}
10410717Sandreas.hansson@arm.com
10510717Sandreas.hansson@arm.com        void serialize(std::ostream &os);
10610717Sandreas.hansson@arm.com        void unserialize(Checkpoint *cp, const std::string &section);
10710717Sandreas.hansson@arm.com    };
10810717Sandreas.hansson@arm.com}
10910717Sandreas.hansson@arm.com
11010717Sandreas.hansson@arm.com#endif
11110717Sandreas.hansson@arm.com