13806SN/A/*
23806SN/A * Copyright (c) 2006 The Regents of The University of Michigan
33806SN/A * All rights reserved.
43806SN/A *
53806SN/A * Redistribution and use in source and binary forms, with or without
63806SN/A * modification, are permitted provided that the following conditions are
73806SN/A * met: redistributions of source code must retain the above copyright
83806SN/A * notice, this list of conditions and the following disclaimer;
93806SN/A * redistributions in binary form must reproduce the above copyright
103806SN/A * notice, this list of conditions and the following disclaimer in the
113806SN/A * documentation and/or other materials provided with the distribution;
123806SN/A * neither the name of the copyright holders nor the names of its
133806SN/A * contributors may be used to endorse or promote products derived from
143806SN/A * this software without specific prior written permission.
153806SN/A *
163806SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
173806SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
183806SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
193806SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
203806SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
213806SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
223806SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
233806SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
243806SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
253806SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
263806SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
273806SN/A *
283806SN/A * Authors: Ali Saidi
293806SN/A */
303806SN/A
318105Sgblack@eecs.umich.edu#ifndef __ARCH_SPARC_MMAPPED_IPR_HH__
328105Sgblack@eecs.umich.edu#define __ARCH_SPARC_MMAPPED_IPR_HH__
333806SN/A
343806SN/A/**
353806SN/A * @file
363806SN/A *
373806SN/A * ISA-specific helper functions for memory mapped IPR accesses.
383806SN/A */
393806SN/A
409897Sandreas@sandberg.pp.se#include "arch/generic/mmapped_ipr.hh"
418229Snate@binkert.org#include "arch/sparc/tlb.hh"
423806SN/A#include "cpu/thread_context.hh"
433806SN/A#include "mem/packet.hh"
443806SN/A
453806SN/Anamespace SparcISA
463806SN/A{
477741SN/A
489180Sandreas.hansson@arm.cominline Cycles
493806SN/AhandleIprRead(ThreadContext *xc, Packet *pkt)
503806SN/A{
519897Sandreas@sandberg.pp.se    if (GenericISA::isGenericIprAccess(pkt))
529897Sandreas@sandberg.pp.se        return GenericISA::handleGenericIprRead(xc, pkt);
539897Sandreas@sandberg.pp.se    else
5412406Sgabeblack@google.com        return dynamic_cast<TLB *>(xc->getDTBPtr())->doMmuRegRead(xc, pkt);
553806SN/A}
563806SN/A
579180Sandreas.hansson@arm.cominline Cycles
583806SN/AhandleIprWrite(ThreadContext *xc, Packet *pkt)
593806SN/A{
609897Sandreas@sandberg.pp.se    if (GenericISA::isGenericIprAccess(pkt))
619897Sandreas@sandberg.pp.se        return GenericISA::handleGenericIprWrite(xc, pkt);
629897Sandreas@sandberg.pp.se    else
6312406Sgabeblack@google.com        return dynamic_cast<TLB *>(xc->getDTBPtr())->doMmuRegWrite(xc, pkt);
643806SN/A}
653806SN/A
663806SN/A
673806SN/A} // namespace SparcISA
683806SN/A
693806SN/A#endif
70