mmapped_ipr.hh revision 8229:78bf55f23338
19384SAndreas.Sandberg@arm.com/*
29384SAndreas.Sandberg@arm.com * Copyright (c) 2006 The Regents of The University of Michigan
39384SAndreas.Sandberg@arm.com * All rights reserved.
49384SAndreas.Sandberg@arm.com *
59384SAndreas.Sandberg@arm.com * Redistribution and use in source and binary forms, with or without
69384SAndreas.Sandberg@arm.com * modification, are permitted provided that the following conditions are
79384SAndreas.Sandberg@arm.com * met: redistributions of source code must retain the above copyright
89384SAndreas.Sandberg@arm.com * notice, this list of conditions and the following disclaimer;
99384SAndreas.Sandberg@arm.com * redistributions in binary form must reproduce the above copyright
109384SAndreas.Sandberg@arm.com * notice, this list of conditions and the following disclaimer in the
119384SAndreas.Sandberg@arm.com * documentation and/or other materials provided with the distribution;
129384SAndreas.Sandberg@arm.com * neither the name of the copyright holders nor the names of its
139384SAndreas.Sandberg@arm.com * contributors may be used to endorse or promote products derived from
149384SAndreas.Sandberg@arm.com * this software without specific prior written permission.
159384SAndreas.Sandberg@arm.com *
169384SAndreas.Sandberg@arm.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
179384SAndreas.Sandberg@arm.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
189384SAndreas.Sandberg@arm.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
199384SAndreas.Sandberg@arm.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
209384SAndreas.Sandberg@arm.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
219384SAndreas.Sandberg@arm.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
229384SAndreas.Sandberg@arm.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
239384SAndreas.Sandberg@arm.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
249384SAndreas.Sandberg@arm.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
259384SAndreas.Sandberg@arm.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
269384SAndreas.Sandberg@arm.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
279384SAndreas.Sandberg@arm.com *
289384SAndreas.Sandberg@arm.com * Authors: Ali Saidi
299384SAndreas.Sandberg@arm.com */
309384SAndreas.Sandberg@arm.com
319384SAndreas.Sandberg@arm.com#ifndef __ARCH_SPARC_MMAPPED_IPR_HH__
329384SAndreas.Sandberg@arm.com#define __ARCH_SPARC_MMAPPED_IPR_HH__
339384SAndreas.Sandberg@arm.com
349384SAndreas.Sandberg@arm.com/**
359384SAndreas.Sandberg@arm.com * @file
369384SAndreas.Sandberg@arm.com *
379384SAndreas.Sandberg@arm.com * ISA-specific helper functions for memory mapped IPR accesses.
389384SAndreas.Sandberg@arm.com */
399384SAndreas.Sandberg@arm.com
409384SAndreas.Sandberg@arm.com#include "arch/sparc/tlb.hh"
419384SAndreas.Sandberg@arm.com#include "config/full_system.hh"
429384SAndreas.Sandberg@arm.com#include "cpu/thread_context.hh"
439384SAndreas.Sandberg@arm.com#include "mem/packet.hh"
449384SAndreas.Sandberg@arm.com
459384SAndreas.Sandberg@arm.comnamespace SparcISA
469384SAndreas.Sandberg@arm.com{
479384SAndreas.Sandberg@arm.com
489384SAndreas.Sandberg@arm.cominline Tick
499384SAndreas.Sandberg@arm.comhandleIprRead(ThreadContext *xc, Packet *pkt)
509384SAndreas.Sandberg@arm.com{
519384SAndreas.Sandberg@arm.com#if FULL_SYSTEM
529384SAndreas.Sandberg@arm.com    return xc->getDTBPtr()->doMmuRegRead(xc, pkt);
539384SAndreas.Sandberg@arm.com#else
549384SAndreas.Sandberg@arm.com    panic("Shouldn't have a memory mapped register in SE\n");
559384SAndreas.Sandberg@arm.com#endif
569384SAndreas.Sandberg@arm.com}
579384SAndreas.Sandberg@arm.com
589384SAndreas.Sandberg@arm.cominline Tick
599384SAndreas.Sandberg@arm.comhandleIprWrite(ThreadContext *xc, Packet *pkt)
609384SAndreas.Sandberg@arm.com{
619384SAndreas.Sandberg@arm.com#if FULL_SYSTEM
629384SAndreas.Sandberg@arm.com    return xc->getDTBPtr()->doMmuRegWrite(xc, pkt);
639384SAndreas.Sandberg@arm.com#else
649384SAndreas.Sandberg@arm.com    panic("Shouldn't have a memory mapped register in SE\n");
659384SAndreas.Sandberg@arm.com#endif
66}
67
68
69} // namespace SparcISA
70
71#endif
72