tlb.hh revision 5894
12SN/A/* 21762SN/A * Copyright (c) 2006 The Regents of The University of Michigan 32SN/A * All rights reserved. 42SN/A * 52SN/A * Redistribution and use in source and binary forms, with or without 62SN/A * modification, are permitted provided that the following conditions are 72SN/A * met: redistributions of source code must retain the above copyright 82SN/A * notice, this list of conditions and the following disclaimer; 92SN/A * redistributions in binary form must reproduce the above copyright 102SN/A * notice, this list of conditions and the following disclaimer in the 112SN/A * documentation and/or other materials provided with the distribution; 122SN/A * neither the name of the copyright holders nor the names of its 132SN/A * contributors may be used to endorse or promote products derived from 142SN/A * this software without specific prior written permission. 152SN/A * 162SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 172SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 182SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 192SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 202SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 212SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 222SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 232SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 242SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 252SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 262SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272665Ssaidi@eecs.umich.edu * 282760Sbinkertn@umich.edu * Authors: Gabe Black 292760Sbinkertn@umich.edu */ 302665Ssaidi@eecs.umich.edu 312SN/A#ifndef __SIM_TLB_HH__ 322SN/A#define __SIM_TLB_HH__ 332SN/A 342SN/A#include "base/misc.hh" 352SN/A#include "mem/request.hh" 362SN/A#include "sim/faults.hh" 372SN/A#include "sim/sim_object.hh" 382SN/A 392SN/Aclass ThreadContext; 402SN/Aclass Packet; 418229Snate@binkert.org 422SN/Aclass BaseTLB : public SimObject 438229Snate@binkert.org{ 444841Ssaidi@eecs.umich.edu protected: 452SN/A BaseTLB(const Params *p) : SimObject(p) 466214Snate@binkert.org {} 472SN/A 482738Sstever@eecs.umich.edu public: 49395SN/A virtual void demapPage(Addr vaddr, uint64_t asn) = 0; 50237SN/A 514000Ssaidi@eecs.umich.edu class Translation 522SN/A { 53217SN/A public: 54502SN/A virtual ~Translation() 55217SN/A {} 56217SN/A 57237SN/A /* 58502SN/A * The memory for this object may be dynamically allocated, and it may 59217SN/A * be responsible for cleaning itself up which will happen in this 60217SN/A * function. Once it's called, the object is no longer valid. 616820SLisa.Hsu@amd.com */ 626820SLisa.Hsu@amd.com virtual void finish(Fault fault, RequestPtr req, 636820SLisa.Hsu@amd.com ThreadContext *tc, bool write=false) = 0; 646820SLisa.Hsu@amd.com }; 65217SN/A}; 666227Snate@binkert.org 67217SN/Aclass GenericTLB : public BaseTLB 68217SN/A{ 694841Ssaidi@eecs.umich.edu protected: 704841Ssaidi@eecs.umich.edu GenericTLB(const Params *p) : BaseTLB(p) 714841Ssaidi@eecs.umich.edu {} 724841Ssaidi@eecs.umich.edu 737948SAli.Saidi@ARM.com public: 747948SAli.Saidi@ARM.com void demapPage(Addr vaddr, uint64_t asn); 757948SAli.Saidi@ARM.com 767948SAli.Saidi@ARM.com Fault translateAtomic(RequestPtr req, ThreadContext *tc, bool=false); 77237SN/A void translateTiming(RequestPtr req, ThreadContext *tc, 786227Snate@binkert.org Translation *translation, bool=false); 79217SN/A}; 804841Ssaidi@eecs.umich.edu 814841Ssaidi@eecs.umich.edu#endif // __ARCH_SPARC_TLB_HH__ 824841Ssaidi@eecs.umich.edu