pagetable.hh revision 7399:a378ac1e1615
12SN/A/*
21762SN/A * Copyright (c) 2010 ARM Limited
32SN/A * All rights reserved
42SN/A *
52SN/A * The license below extends only to copyright in the software and shall
62SN/A * not be construed as granting a license to any other intellectual
72SN/A * property including but not limited to intellectual property relating
82SN/A * to a hardware implementation of the functionality of the software
92SN/A * licensed hereunder.  You may use the software subject to the license
102SN/A * terms below provided that you ensure that this notice is replicated
112SN/A * unmodified and in its entirety in all distributions of the software,
122SN/A * modified or unmodified, in source code or in binary form.
132SN/A *
142SN/A * Copyright (c) 2002-2005 The Regents of The University of Michigan
152SN/A * All rights reserved.
162SN/A *
172SN/A * Redistribution and use in source and binary forms, with or without
182SN/A * modification, are permitted provided that the following conditions are
192SN/A * met: redistributions of source code must retain the above copyright
202SN/A * notice, this list of conditions and the following disclaimer;
212SN/A * redistributions in binary form must reproduce the above copyright
222SN/A * notice, this list of conditions and the following disclaimer in the
232SN/A * documentation and/or other materials provided with the distribution;
242SN/A * neither the name of the copyright holders nor the names of its
252SN/A * contributors may be used to endorse or promote products derived from
262SN/A * this software without specific prior written permission.
272665Ssaidi@eecs.umich.edu *
282665Ssaidi@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
292665Ssaidi@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
302SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
312SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
322SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
332SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
342SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
352SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
361354SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
371354SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
382SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
392SN/A *
402SN/A * Authors: Nathan Binkert
412SN/A *          Steve Reinhardt
422SN/A *          Ali Saidi
432SN/A */
442SN/A
452SN/A#ifndef __ARCH_ARM_PAGETABLE_H__
4656SN/A#define __ARCH_ARM_PAGETABLE_H__
472SN/A
4856SN/A#include "arch/arm/isa_traits.hh"
491354SN/A#include "arch/arm/utility.hh"
5056SN/A#include "arch/arm/vtophys.hh"
512SN/A#include "config/full_system.hh"
522SN/A
532SN/Anamespace ArmISA {
541354SN/A
551354SN/Astruct VAddr
561354SN/A{
571354SN/A    VAddr(Addr a) { panic("not implemented yet."); }
581354SN/A};
591354SN/A
601354SN/A
611354SN/A// ITB/DTB page table entry
621354SN/Astruct PTE
631354SN/A{
641354SN/A    void serialize(std::ostream &os)
651354SN/A    {
661354SN/A        panic("Need to implement PTE serialization\n");
672SN/A    }
682SN/A
692SN/A    void unserialize(Checkpoint *cp, const std::string &section)
702SN/A    {
712SN/A        panic("Need to implement PTE serialization\n");
72395SN/A    }
732SN/A
742SN/A};
752SN/A
762SN/A// ITB/DTB table entry
772SN/Astruct TlbEntry
782SN/A{
792SN/A    Addr tag;               // virtual page number tag
802SN/A    Addr ppn;               // physical page number
812SN/A    uint8_t asn;            // address space number
822SN/A    bool valid;             // valid page table entry
832SN/A
842SN/A
852SN/A    //Construct an entry that maps to physical address addr.
862SN/A    TlbEntry(Addr _asn, Addr _vaddr, Addr _paddr)
872SN/A    {
882SN/A        tag = _vaddr >> PageShift;
892SN/A        ppn = _paddr >> PageShift;
902SN/A        asn = _asn;
912SN/A        valid = true;
92237SN/A    }
932667Sstever@eecs.umich.edu
942667Sstever@eecs.umich.edu    TlbEntry()
952SN/A    {}
962SN/A
972SN/A    void
982SN/A    updateVaddr(Addr new_vaddr)
992SN/A    {
1002SN/A        tag = new_vaddr >> PageShift;
1012SN/A    }
1022SN/A
1032SN/A    Addr
1042SN/A    pageStart()
1052SN/A    {
1062SN/A        return ppn << PageShift;
1072SN/A    }
1082SN/A
1092SN/A    void serialize(std::ostream &os);
1102SN/A    void unserialize(Checkpoint *cp, const std::string &section);
1112SN/A};
1122SN/A
1132SN/A
1142SN/A
1152SN/A};
1162SN/A#endif // __ARCH_ARM_PAGETABLE_H__
117396SN/A
118396SN/A