tlb.cc revision 5004
12391SN/A/*
28931Sandreas.hansson@arm.com * Copyright (c) 2001-2005 The Regents of The University of Michigan
37733SN/A * All rights reserved.
47733SN/A *
57733SN/A * Redistribution and use in source and binary forms, with or without
67733SN/A * modification, are permitted provided that the following conditions are
77733SN/A * met: redistributions of source code must retain the above copyright
87733SN/A * notice, this list of conditions and the following disclaimer;
97733SN/A * redistributions in binary form must reproduce the above copyright
107733SN/A * notice, this list of conditions and the following disclaimer in the
117733SN/A * documentation and/or other materials provided with the distribution;
127733SN/A * neither the name of the copyright holders nor the names of its
137733SN/A * contributors may be used to endorse or promote products derived from
142391SN/A * this software without specific prior written permission.
152391SN/A *
162391SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
172391SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
182391SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
192391SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
202391SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
212391SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
222391SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
232391SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
242391SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
252391SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
262391SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272391SN/A *
282391SN/A * Authors: Gabe Black
292391SN/A */
302391SN/A
312391SN/A#include "cpu/thread_context.hh"
322391SN/A#include "mem/page_table.hh"
332391SN/A#include "sim/process.hh"
342391SN/A#include "sim/tlb.hh"
352391SN/A
362391SN/AFault
372391SN/AGenericTLBBase::translate(RequestPtr req, ThreadContext * tc)
382391SN/A{
392665SN/A#if FULL_SYSTEM
402665SN/A        panic("Generic translation shouldn't be used in full system mode.\n");
412914SN/A#else
428931Sandreas.hansson@arm.com        Process * p = tc->getProcessPtr();
432391SN/A
442391SN/A        Fault fault = p->pTable->translate(req);
4511793Sbrandon.potter@amd.com        if(fault != NoFault)
4611793Sbrandon.potter@amd.com            return fault;
4710466Sandreas.hansson@arm.com
4810466Sandreas.hansson@arm.com        return NoFault;
4910102Sali.saidi@arm.com#endif
5010102Sali.saidi@arm.com}
518232SN/A